Skip to content

The Grinch stole all the vowels: Odd naming in .cabal/store (macOS)  #7209

Open

Description

@andreasabel

This affects only macOS, I think.
If I look into .cabal/store, I see:

~/.cabal/store/ghc-8.10.3$ ls
Dff-0.4.0-e2417685                 n-0.4.1-98d17fa3
Dff-0.4.0-e6c8ed46                 nclsd-xcptns-1.0.3-7f7ef320
HTF-0.14.0.3-710f7bdf              ndxd-trvrsbl-0.1-9a7dbfcd
HUnt-1.6.1.0-74fb3e3f              ndxd-trvrsbl-0.1-ec48aff0
HsYAML-0.2.1.0-7c9cf1ca            ndxd-trvrsbl-nstncs-0.1-be410491
QckChck-2.14.2-3e204cf1            nrdrd-cntnrs-0.2.13.0-0b73c8ca
QckChck-2.14.2-605cea58            nrdrd-cntnrs-0.2.13.0-a7a57927
ShllChck-0.7.1-f3d01607            ns-trmnl-0.11-fcd1ff58
...

Seriously! The Grinch stole all the vowels.
I cannot help feeling trolled by cabal v2. (Which I am still trying to learn.)
#5399 (comment)
Apparently, removing the vowels should help the Mach-O linker with its space limitations.
https://github.com/typedrat/cabal/blob/638c78e790721566780dbf75a2e6f884ceafa970/cabal-install/Distribution/Client/PackageHash.hs#L137-L145
I feels I am on the C64 again. Sure this isn't an Easter egg?

Questions:

  • Just how many bytes are saved by dropping the vowels?
  • Does this measure guarantee that things will work? (How? And how does this fight super long package names?)
  • Do thinks break without the measure?
  • Is this a systematic fix of the problem?
  • How does this weigh against the confusion of the users?

Odd.

Activity

  1. phadej commented on Dec 21, 2020

    @phadej
    Collaborator

    Just how many bytes are saved by dropping the vowels?

    unordered-containers
    nrdrd-cntnrs
    

    About a third?

    Does this measure guarantee that things will work? (How? And how does this fight super long package names?)

    No it doesn't, but things are less likely to hit the limit

    Do things break without the measure?

    Yes. See e.g. #5220

    Is this a systematic fix of the problem?

    No. People work on it though, e.g. #7094

    How does this weigh against the confusion of the users?

    It's a necessary hack, for now.

  2. added 2 commits that reference this issue on Aug 28, 2021
  3. andreasabel commented on Sep 5, 2021

    @andreasabel
    MemberAuthor

    @gbaz: I protest, this isn't a just a "user-question". I strongly hope this crutch will be dropped as soon as possible! It is already requiring workarounds, see agda/agda@b44a0bd.

  4. gbaz commented on Sep 5, 2021

    @gbaz
    Collaborator

    Sorry, I tried to read through the big diff, but I can't figure out what the workaround is there? It seems to me that the naming in cabal's store should be an internal detail that users don't have to concern themselves with.

    It seems like Big Sur has improved linker limitations that existed with prior mac os versions, but this is entirely an ad-hoc thing we noticed at work, not something I have any clear documentation of, and even if this is true, we can't remove the vowel stripping anytime soon. If we can confirm that it is true, and to what degree it is true (i.e. did they just bump the limit, remove it, raise it drastically?), then maybe we could start a clock at least.

  5. andreasabel commented on Sep 6, 2021

    @andreasabel
    MemberAuthor

    @gbaz wrote:

    Sorry, I tried to read through the big diff, but I can't figure out what the workaround is there? It seems to me that the naming in cabal's store should be an internal detail that users don't have to concern themselves with.

    Sorry for the long diff (commits got squashed), the workaround is here:
    https://github.com/agda/agda/blob/731f300deac14e10792a0bbf22c86cbe0c9c7e4b/test/Utils.hs#L315-L327

    To normalize an error message, we replace Agda-$VER-$HASH by <<Agda-package>>. However, due to the OP, we also have to consider Agd-$VER-$HASH, on macOS.

    I agree that "the naming in cabal's store should be an internal detail that users don't have to concern themselves with", but unfortunately, is leaks e.g. through error locations given by HasCallStack and the like.

    Also, as long as there is no automatic garbage collection, the user might have to go into .cabal/store and manually delete stuff, and is then confronted with cryptic packages like sn-1.4.7.1-51bc2765 (quiz: where did this one come from?).

  6. phadej commented on Sep 6, 2021

    @phadej
    Collaborator

    sn-1.4.7.1-51bc2765

    easy, aeson.

    More seriously: if you just go and selectively delete stuff in .cabal/store you most likely break everything, simpler to delete whole store. OTOH, you can look into into cabal-hash.txt files: they look something like:

    % cat /cabal/store/ghc-8.2.2/aeson-1.5.6.0-65f6f8abc52f93055181a621a9052f070efa24aa2c62e9c1b6ce8b90fc2fdae2/cabal-hash.txt 
    pkgid: aeson-1.5.6.0
    component: ComponentLib
    src: 0361c34be3d2ec945201f02501693436fbda10dcc549469481a084b2de22bfe8
    pkg-config-deps: 
    deps: attoparsec-0.14.1-c24c67c02ee9218c31692d203c6c1d2a724ed3f7bdbc79c2141cf9de984bd0cd, base-4.10.1.0, base-compat-batteries-0.11.2-b9b16c908a3f04cf0802928ac16bf54a58b443ed3d9896b3248886da06cf52e5, bytestring-0.10.8.2, containers-0.5.10.2, contravariant-1.5.5-4adff088b7d750ecf7d3c52be2c3606cce80234b3b0d4b496244e3ee93a4f0f3, data-fix-0.3.2-82d9427a473a25f9b3ba3a61e48b5a191244e717e8890e12123e7ba96074b481, deepseq-1.4.3.0, dlist-1.0-be8ac3510ea30b30d04e38f4cbe8f404b697da8c3938c54151872ae8c3885115, ghc-prim-0.5.1.1, hashable-1.3.2.0-58027f2f2c3477eaaa874990d188b97b0debea1c4b5842fd399d403832cf2640, primitive-0.7.1.0-fcdfd35f70cea734e35ea53fa899add072a15fd0691c37c1898fc3a228eb1d1e, scientific-0.3.7.0-88de3ed3c1727f6edb60eb145705948194c3f3b4bd9a613b06bdabd989822b2e, strict-0.4.0.1-b6dce21bb07454c8b93e8969e10bf03112cca8bfd69c9f37fef8f4f94b3fd21e, tagged-0.8.6.1-a90c974de1d25b206713c0c5a3be6bd406292c5ac34b47e358fcb4adea808db8, template-haskell-2.12.0.0, text-1.2.4.1-3dcb090626d10a059b7e10441942d9e839bb776c3d74fbe3fef3582b4dcc9066, th-abstraction-0.4.2.0-c0ab0bd4daa390f4f1b3d31b0e37eea24b0834a0152c60554423d6c3ce0b5e7a, these-1.1.1.1-ff33d9736624d26942b8085943de4f7461c61e38525d9cb2b397703561a5ae54, time-1.8.0.2, time-compat-1.9.6-19e52692d4cfdf66be49f66f0dcdd62c37036f14f7dfec5f3c0a438626ab1618, unordered-containers-0.2.14.0-136afc4d4166d90a7333c7b40eac8a4dfe88fc171a4fb0f50896c5021416872d, uuid-types-1.0.5-f8e2ba0e3824070865d5f3dd87d1ad7fa211a829cc3528c026cbb00315df7836, vector-0.12.3.0-7291eb8fe75d2c5daedc5af82393c61876665d118660d03d72b2e19739ee4fe8
    compilerid: ghc-8.2.2
    platform: x86_64-linux
    flags: -bytestring-builder -cffi -developer -fast
    shared-lib: True
    stripped-exe: False
    debug-info: 0
    

    It's great that there are these "receipt" files!

  7. andreasabel commented on Sep 6, 2021

    @andreasabel
    MemberAuthor

    sn-1.4.7.1-51bc2765

    easy, aeson.

    Congrats, @phadej! (I suppose aeson was too easy, it's ubiquitous.)

  8. jneira commented on Nov 11, 2021

    @jneira
    Member

    @andreasabel is there some actionable here? do you think we should keep this open, tracking and blocked on a upstream os clear and coumented fix?

  9. andreasabel commented on Nov 11, 2021

    @andreasabel
    MemberAuthor

    Are we tracking the upstream issue somewhere? Maybe it would be good to a add a pointer here.
    I think we should keep this open so that we can remember to revert the workaround as soon as upstream is fixed. (Unfortunately, we won't get any help from github with the tracking unless the upstream issue is also on github (very unlikely).)

  10. 27 remaining items

  11. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    It seems the earliest GHC release containing the fix is 9.2.1 9.0.2.

    Anything lower than 9.2.x is not even listed on the status page anymore and can be considered EOL: https://gitlab.haskell.org/ghc/ghc/-/wikis/GHC%20Status

  12. added a commit that references this issue on Feb 24, 2026
    04d654c
  13. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    It appears cabal devs still find it useful to support GHC 8.10.6, so we can't apply the fix.

  14. phadej commented on Feb 24, 2026

    @phadej
    Collaborator

    My 5c, Cabal should support using as old GHCs as you can relatively easily install. @hasufell's GHCup has GHC-8.4.4 in its list as today, so I'd expect being able to use latest cabal-install with that compiler (edit: at least that).

    "Cabal support" is ambiguous term. Being buildable with is one interpretation, this issue is however about being able to use&command.

  15. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    First of all: Supporting anything but the latest minor version of a major GHC release is nonsensical. I can't believe that cabal devs are actually suggesting such practice.

    Second: I can backport the fix downstream until 8.4 if you really care. Those would be GHCup-only patch releases though.

  16. phadej commented on Feb 24, 2026

    @phadej
    Collaborator

    I can backport the fix downstream until 8.4 if you really care

    I don't see any challenge in doing something different for particular GHC versions in Cabal / cabal-install: there are a lot of feature check conditionals.

    That said, I actually have no idea what is the latest GHC working on recent macOS versions, and this being macOS-only issue. Maybe the fix in GHC is so old, that nothing without isn't usuable on macOS anyway. (Anything older than GHC-9.2 isn't usable on arm based macs, AFAIK).

  17. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    Yes, x86_64 mac is probably going to be phased out in a year or so. I don't think we should be investing here.

    8.10.7 is kinda usable on Mac ARM, but a pretty rough experience.

  18. geekosaur commented on Feb 24, 2026

    @geekosaur
    Collaborator

    The sting in the tail of 8.10.7 is ghcjs, which some people still use.

  19. Bodigrim commented on Feb 24, 2026

    @Bodigrim
    Collaborator

    It seems to be a recurring confusion and it does not seem to be documented anywhere. Could the Cabal team clarify which versions of GHC are supported to be driven by Cabal (not which GHCs are supported to build Cabal sources)?

    8.10.7 is kinda usable on Mac ARM, but a pretty rough experience.

    Maybe on macOS contemporary to 8.10 it was, but I was never able to use anything prior to 9.2 on Apple Silicon because of toolchain upgrades (llvm version and such).

  20. geekosaur commented on Feb 24, 2026

    @geekosaur
    Collaborator

    While there's no formal documentation that I'm aware of, .github/workflows/validate.yml lists the supported-for-building and supported-for-driving-only ghcs in the matrix sections of the validate and validate-old-ghcs jobs respectively. The stalled validate-actions PR moves these to a config file.

  21. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    The sting in the tail of 8.10.7 is ghcjs, which some people still use.

    That's not even an official compiler.

    I've worked at a company that uses that and they use nix heavily, because there is absolutely no way you could sensibly do ghcjs development without nix (and for nix it wouldn't matter at all whether we drop support for these old ghc versions).

  22. geekosaur commented on Feb 24, 2026

    @geekosaur
    Collaborator

    I mentioned that mainly because I know people still use it (sadly). The real reason for this is https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md?plain=1#L270-L271.

    Our GHC support window is five years for the Cabal library and three years for cabal-install: that is, the Cabal library must be buildable out-of-the-box with the dependencies that shipped with GHC for at least five years.

    Combining this with GHC's (arguably excessively aggressive) release schedule means a lot of older ghcs in both support windows.

  23. geekosaur commented on Feb 24, 2026

    @geekosaur
    Collaborator

    I don't think the window for driving ghc, as opposed to building it, is published anywhere. It's come up before, and we really should resolve what it should be and document it with the other windows.

  24. hasufell commented on Feb 24, 2026

    @hasufell
    Member

    I mentioned that mainly because I know people still use it (sadly).

    I don't think anyone uses ghcjs without nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions