-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cabal does not compile with recent versions of GHC #7904
Comments
Hi @PiJoKra, So you are trying to boostrap cabal using only GHC? I'm afraid that's not trivial. Please look at the last line of https://github.com/haskell/cabal/blob/master/README.md and let us know if that works for you. |
Hello @Mikolaj The reason for trying to bootstrap is me not getting cabal via the package-manager to work for ghc 9.2.1
And running `cabal install cabal-install yields:
|
OOI, did you try the newest one and it didn't work? I wouldn't worry about the warning. Which point of https://github.com/haskell/cabal/blob/master/README.md are you following now? If the "Installing cabal-install (preferred, with cabal-install)" one, did you do |
It did not work. This is was the result:
I also find it strange there are packages in both |
Thank you for the details about bootstrapping. Good to know. Two locations for packages is fine --- one comes with the GHC, another stores user-downloaded packages. Reading your log, it seems cabal 3.6.2 indeed rules out newer GHCs. Even GHC 9.0.2 is off-limits. The version in the repo probably accepts 9.0.2, but not 9.2.*. I'm afraid, the only remaining options are downloading the binary, either via ghcup or as told in the README. Cabal doesn't mind being compiled with one GHC and used with different ones. |
I guess we should amend the README to say "but not with bleeding edge GHC" or something to that effect, so that others don't need to repeat our investigation. What text would help you, initially? |
Especially that the way that doesn't work two last versions of GHC is marked as "preferred". |
I think the "but not with bleeding edge GHC" would be good enough, or maybe state that the json-files with the ghcversion-naming dictate the last version you can use or something like that. |
Good idea, thank you. |
@fendor also suggests to add to the .cabal file (I'd say, the minimum would be cabal-install.cabal) the "tested-with section to indicate with which GHC version you are supposed to be able to build". That'd require some maintenance though, from both ends; in particular removing GHCs we no longer support. |
Seems like a good idea! Should I rename this issue to something to reflect cabal not working with recent GHC-versions? I decided to try my luck with ghcup and now have cabal-install version 3.6.2.0, but now I always get the following when using
I tried multiple packages. Is this related to the previous problem, or is this something I should create a new issue for? |
That would make sense.
I think this works as expected. You normally don't install packages by hand, unless they have an exe you need. Cabal installs everything it needs automatically when you |
Again, if dev version of cabal docs is misleading in this respect, let's fix them: https://cabal.readthedocs.io/en/latest/ |
Oh, I had a .cabal with the package in it, but removed and started over. Now the package was no longer in the .cabal and cabal complained it could not load a module. I got a bit confused :') |
Yes. Nix is also always an option. After the Nix installation & restarting the terminal - run the Overall the good rule of thumb - is not to use package managers to install other package managers. Most often, having each package manager/management installed in the official package management way, or at least as a separate custom deployment / structural dependency tree with independent root (package manager) - the more comfortable & stable usage is. |
I have another bug and want to check if it has to do with this one. If not I can make a new issue.
|
And is there Is that installed with |
Mmm, that is strange... It expects the version number in the name...
Seems to not be an issue with cabal though... Thanks anyway ^^' |
Looks like scripts left over from previous installation? |
Could be the reason. Renaming |
FWIW, while looking to upgrade Void to GHC 9.0.2 (not 9.2.2) I did manage to create a --- a/bootstrap/src/Main.hs
+++ b/bootstrap/src/Main.hs
@@ -34,5 +34,5 @@ main = do
main1 :: FilePath -> IO ()
main1 planPath = do
- meta <- I.cachedHackageMetadata
+ (_, meta) <- I.cachedHackageMetadata
plan <- P.decodePlanJson planPath
main2 meta plan The finished json file{"builtin":[{"package":"rts","version":"1.0.2"},{"package":"ghc-prim","version":"0.7.0"},{"package":"ghc-bignum","version":"1.1"},{"package":"base","version":"4.15.1.0"},{"package":"array","version":"0.5.4.0"},{"package":"deepseq","version":"1.4.5.0"},{"package":"bytestring","version":"0.10.12.1"},{"package":"containers","version":"0.6.4.1"},{"package":"binary","version":"0.8.8.0"},{"package":"filepath","version":"1.4.2.1"},{"package":"time","version":"1.9.3"},{"package":"unix","version":"2.7.2.2"},{"package":"directory","version":"1.3.6.2"},{"package":"transformers","version":"0.5.6.2"},{"package":"mtl","version":"2.2.2"},{"package":"ghc-boot-th","version":"9.0.2"},{"package":"pretty","version":"1.1.3.6"},{"package":"template-haskell","version":"2.17.0.0"},{"package":"text","version":"1.2.5.0"},{"package":"parsec","version":"3.1.14.0"},{"package":"process","version":"1.6.13.2"},{"package":"stm","version":"2.5.0.0"}],"dependencies":[{"cabal_sha256":null,"flags":["-bundled-binary-generic"],"package":"Cabal","revision":null,"source":"local","src_sha256":null,"version":"3.6.3.0"},{"cabal_sha256":"714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1","flags":["-optimised-mixer"],"package":"splitmix","revision":0,"source":"hackage","src_sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","version":"0.1.0.4"},{"cabal_sha256":"8bee24dc0c985a90ee78d94c61f8aed21c49633686f0f1c14c5078d818ee43a2","flags":[],"package":"random","revision":0,"source":"hackage","src_sha256":"265c768fc5f2ca53cde6a87e706b4448cad474c3deece933c103f24453661457","version":"1.2.1"},{"cabal_sha256":"3a2beeafb220f9de706568a7e4a5b3c762cc4c9f25c94d7ef795b8c2d6a691d7","flags":["+integer-gmp","-random-initial-seed"],"package":"hashable","revision":1,"source":"hackage","src_sha256":"baaad82cd4271b197016bdbe76f22d5c3d3913fe38534cec7d817db9bae19886","version":"1.3.5.0"},{"cabal_sha256":"b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0","flags":["-bench"],"package":"async","revision":1,"source":"hackage","src_sha256":"484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725","version":"2.2.4"},{"cabal_sha256":"037d70bb091c49f68726dde920f6a003b646835a86cdcb5b5ad58ad9af3207d9","flags":[],"package":"Cabal-syntax","revision":0,"source":"hackage","src_sha256":"ca25e5fc601397565fa857f1aa477740fac7f43d659e77c4d9b1485dca239251","version":"3.6.0.0"},{"cabal_sha256":"d8699f46b485f105eea9c7158f3d432ca578e6bbe5d68751184e9899a41d430d","flags":["-old-bytestring","-old-time"],"package":"tar","revision":4,"source":"hackage","src_sha256":"b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de","version":"0.5.1.1"},{"cabal_sha256":"e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568","flags":["-devel"],"package":"network","revision":0,"source":"hackage","src_sha256":"7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85","version":"3.1.2.7"},{"cabal_sha256":"a16dd922947a6877defe52c4c38d1ab48ed3f85a826930f5d1a568741d619993","flags":[],"package":"th-compat","revision":0,"source":"hackage","src_sha256":"6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6","version":"0.1.3"},{"cabal_sha256":"a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d","flags":[],"package":"network-uri","revision":0,"source":"hackage","src_sha256":"57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584","version":"2.6.4.1"},{"cabal_sha256":"6042643c15a0b43e522a6693f1e322f05000d519543a84149cb80aeffee34f71","flags":["-conduit10","-mtl1","+network-uri","-warn-as-error","-warp-tests"],"package":"HTTP","revision":1,"source":"hackage","src_sha256":"d6091c037871ac3d08d021c906206174567499d5a26a6cb804cf530cd590fe2d","version":"4000.3.16"},{"cabal_sha256":"64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a","flags":[],"package":"base16-bytestring","revision":0,"source":"hackage","src_sha256":"1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784","version":"1.0.2.0"},{"cabal_sha256":"50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8","flags":[],"package":"base64-bytestring","revision":0,"source":"hackage","src_sha256":"fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9","version":"1.2.1.0"},{"cabal_sha256":"188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332","flags":["-exe","+use-cbits"],"package":"cryptohash-sha256","revision":0,"source":"hackage","src_sha256":"73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6","version":"0.11.102.1"},{"cabal_sha256":"ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42","flags":["-example"],"package":"echo","revision":0,"source":"hackage","src_sha256":"c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43","version":"0.1.4"},{"cabal_sha256":"4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee","flags":[],"package":"edit-distance","revision":1,"source":"hackage","src_sha256":"3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a","version":"0.2.2.1"},{"cabal_sha256":"24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2","flags":["+no-donna","+test-doctests","+test-hlint","+test-properties"],"package":"ed25519","revision":5,"source":"hackage","src_sha256":"d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d","version":"0.0.5.0"},{"cabal_sha256":"c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0","flags":["+ofd-locking"],"package":"lukko","revision":2,"source":"hackage","src_sha256":"a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f","version":"0.1.1.3"},{"cabal_sha256":"262a93dbf370be59f4ee57f3b1a51b338bc2c309797daa37c14f2262ae61dae4","flags":["-bundled-c-zlib","-non-blocking-ffi","-pkg-config"],"package":"zlib","revision":1,"source":"hackage","src_sha256":"807f6bddf9cb3c517ce5757d991dde3c7e319953a22c86ee03d74534bd5abc88","version":"0.6.2.3"},{"cabal_sha256":"eb34c3e2fa39f9819293045c03e56148a7125573c1de265cdfe5d967f1d71c6e","flags":["+base48","-cabal-syntax","+lukko","-mtl21","-old-directory","+use-network-uri"],"package":"hackage-security","revision":1,"source":"hackage","src_sha256":"bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8","version":"0.6.2.1"},{"cabal_sha256":"2561adac8ce373910948066debe090a22b336b129ba5af18c0332524d16e72ce","flags":[],"package":"regex-base","revision":0,"source":"hackage","src_sha256":"7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1","version":"0.94.0.2"},{"cabal_sha256":"b6421e5356766b0c0a78b6094ae2e3a6259b42c147b717283c03c1cb09163dca","flags":["-_regex-posix-clib"],"package":"regex-posix","revision":0,"source":"hackage","src_sha256":"c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c","version":"0.96.0.1"},{"cabal_sha256":"2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4","flags":[],"package":"resolv","revision":4,"source":"hackage","src_sha256":"81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671","version":"0.1.2.0"},{"cabal_sha256":null,"flags":["-debug-conflict-sets","-debug-expensive-assertions","-debug-tracetree","+lukko","+native-dns"],"package":"cabal-install","revision":null,"source":"local","src_sha256":null,"version":"3.6.2.0"}]} (I know that this post was originally about 9.2.1., but the title says "recent versions of GHC" so perhaps this will still help someone) |
@Mikolaj From what I have seen, the cabal-install releases 3.2.0.0, 3.4.0.0, 3.4.1.0 and 3.6.2.0 have source downloads that are unable to bootstrap. The 3.6.2.0 also does not have a valid checksum in https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/SHA256SUMS . Will the cabal-install source code release be able to be built in isolation in the future? |
@okeuday, thank you for your comments.
I think the instruction for bootstrapping https://github.com/haskell/cabal/tree/master/bootstrap involve manually copying boostrap files from the repo. There is #7289 about including the files somewhere, but is downloading them really such a burden? It's not supposed to be a streamlined process, anyway --- for comfort you use cabal. Nor is it supposed to be exhaustive, since the person porting cabal may have yet another version of GHC or other special circumstances that we can't predict in advance.
Well spotted. If you that's crucial for you, please open a ticket. Is https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0-rc1 OK in this respect? This should be the same in 3.8.1.0, to be released RSN.
We don't have such plans, but we welcome discussion and contributions. |
…ox functionality was removed (cabal-install >= 3.4) without replacement functionality (haskell/cabal#6445). cabal-install source code releases are unable to bootstrap with local dependencies due to undependable releases that promote opaque binaries (haskell/cabal#7904). Manually create a Cabal sandbox without cabal-install for Haskell GHC compilation.
Should this be closed due to inactivity and no clear goal? |
👍 I am keen to make sure everything mentioned in this thread works but I am not sure what does not (or did not). |
The clear goal was to have |
|
@gbaz Other compilation would make the version dependency explicit in the build process, so it is clear. I see no reason why |
All right, let's inspect more. @okeuday could you, please, update the issue description (the top post) with your current problem? We need a precise description of your environment, i.e. versions of tools you're using, and what you're trying to achieve, i.e. whethere you're bootstrapping or trying to |
@ulysses4ever It has been more than 1 year since I checked |
Thank you for explaining your case. I'm afraid we can't move forward with this issue without a clear explanation what the goal was and where it failed. If the issue raises again, please feel free to open a new ticket with a clear reproducer. |
Describe the bug
When building cabal from source,
./Setup configure
cannot find any packagesTo Reproduce
Steps to reproduce the behavior:
Please use version-prefixed commands (e.g.
v2-build
orv1-build
) to avoid ambiguity.Expected behavior
./Setup
to be configured and ready to be used as./Setup build
System information
cabal
,ghc
versions: cabal 3.6.2.0 and ghc 9.2.1Additional context
No other versions of cabal or ghc are installed
The text was updated successfully, but these errors were encountered: