You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal-install-3.8.1.0 update and sdist require ghc in PATH #8352
Project settings changed, reconfiguring...
creating /__w/splitmix/splitmix/dist-newstyle/cache
creating /__w/splitmix/splitmix/dist-newstyle
creating /__w/splitmix/splitmix/dist-newstyle/cache
Compiler settings changed, reconfiguring...
CallStack (from HasCallStack):
withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-inplace:Distribution.Simple.Utils
Error: cabal-3.8.1.0: The program 'ghc' version >=7.0.1 is required but it
Would enabling --with-compiler be a sufficient fix?
Sufficient but ugly. Even if cabal.project supported conditionals based on compiler version, sdist could still work without knowing anything about a compiler, taking union of all possibly available packages. sdist for single package doesn't need a compiler.
changed the title [-]cabal-install-3.8.1.0 update and sdist require GHC in PATH[/-][+]cabal-install-3.8.1.0 update and sdist require ghc in PATH[/+]on Aug 10, 2022
That's a probably a release blocker. Too bad, we've already released. Are there any workarounds for haskell-ci?
A pity nobody tried 3.8.1.0-rc1 with haskell-ci. Is that reasonably easy to do for a haskell-ci user, for next time (3.8.1.0-rc1 was installable with ghcup)?
A pity nobody tried 3.8.1.0-rc1 with haskell-ci. Is that reasonably easy to do for a haskell-ci user, for next time (3.8.1.0-rc1 was installable with ghcup)?
I wasn't aware it was available through ghcup. It shouldn't be hard to test release candidates in the future. Though there is little insensitive as older cabal-install seems to work well enough. And that is a workaround for now: stick to using older cabal-install.
haskell-ci always generates own cabal.project files, it doesn't use projects' own ones.
And there are no plans to generate cabal.project files with conditionals? at a first look it could be useful for haskell-ci.
To have even the chance to use them haskell-ci, the command would need -w and no remove the need for ghc (so remove the use of ghc conditionals)
cabal sdist all would not behave the same way having in account ghc versions or fusing all branches
IMO it should not account for ghc ever. cabal sdist all should sdist all packages, regardless of which ghc happens to be in $PATH. Same applies for cabal update, updating more repositories won't destroy anything.
This is not just an opinion. cabal sdist is used for uploading to hackage, which means that the sdists must include the source files for all supported configurations, regardless of conditionals, including conditionals that involve ghc.
Hmm sdist is not used to upload to hackage diretly, you could use another tool to generate the tarball to be uploaded and you can use the tar generated by sdist for other purposes.
Otoh you dont upload cabal.project to hackage so changing manually the field packages in a cabal.project.local before a sdist would be equivalent to use one or another ghc in my example (or, he, upload only some of the tar generated or whatever) and hackage will never know why there are those packages and no other ones.
Hmm sdist is not used to upload to hackage diretly
My release scripts do call sdist before uploading. IIRC cabal upload fails if you don't call cabal sdist first. If there's a better way to do it, I'm all ears.
Regardless, the current behavior is a breaking change.
Otoh you dont upload cabal.project to hackage so changing manually the field packages
Are you suggesting that the ghc dependency is only due to the cabal.project feature?
My first encounter with this bug was in a Nixpkgs feature that does not use cabal.project, so that was a little confusing. My release scripts don't rely on cabal.project either, so I guess I'm mostly unaffected then.
Shouldn't release commands always produce the same behavior regardless of the Haskell and OS platforms they run on?
Activity
phadej commentedon Aug 10, 2022
cabal sdistis not runnable without GHC in PATH, andcabal sdistdoesn't have--with-compileroption.This is major blocker for using
cabal-install-3.8.1.0.Mikolaj commentedon Aug 10, 2022
I don't know when it changed, but my guess would be that
cabal sdistnow requires GHC for some of its checks. @ffaf1: do you have any inkling?Would enabling
--with-compilerbe a sufficient fix?phadej commentedon Aug 10, 2022
Sufficient but ugly. Even if
cabal.projectsupported conditionals based on compiler version,sdistcould still work without knowing anything about a compiler, taking union of all possibly available packages.sdistfor single package doesn't need a compiler.RyanGlScott commentedon Aug 10, 2022
Indeed, this prevents
cabal-install-3.8.1.0from being usable from withinhaskell-ci, which avoids putting compilers on thePATHby design.[-]cabal-install-3.8.1.0 requires GHC in PATH[/-][+]cabal-install-3.8.1.0 update and sdist require GHC in PATH[/+][-]cabal-install-3.8.1.0 update and sdist require GHC in PATH[/-][+]cabal-install-3.8.1.0 update and sdist require ghc in PATH[/+]Mikolaj commentedon Aug 10, 2022
Uh, oh,
cabal updateneeding GHC sounds definitely like a bug.Mikolaj commentedon Aug 10, 2022
That's a probably a release blocker. Too bad, we've already released. Are there any workarounds for haskell-ci?
A pity nobody tried 3.8.1.0-rc1 with haskell-ci. Is that reasonably easy to do for a haskell-ci user, for next time (3.8.1.0-rc1 was installable with ghcup)?
phadej commentedon Aug 10, 2022
I wasn't aware it was available through ghcup. It shouldn't be hard to test release candidates in the future. Though there is little insensitive as older cabal-install seems to work well enough. And that is a workaround for now: stick to using older
cabal-install.18 remaining items
jneira commentedon Aug 11, 2022
And there are no plans to generate cabal.project files with conditionals? at a first look it could be useful for haskell-ci.
To have even the chance to use them haskell-ci, the command would need
-wand no remove the need for ghc (so remove the use of ghc conditionals)phadej commentedon Aug 11, 2022
IMO it should not account for ghc ever.
cabal sdist allshould sdist all packages, regardless of whichghchappens to be in$PATH. Same applies forcabal update, updating more repositories won't destroy anything.roberth commentedon Aug 21, 2022
This is not just an opinion.
cabal sdistis used for uploading to hackage, which means that the sdists must include the source files for all supported configurations, regardless of conditionals, including conditionals that involve ghc.jneira commentedon Aug 21, 2022
Hmm sdist is not used to upload to hackage diretly, you could use another tool to generate the tarball to be uploaded and you can use the tar generated by sdist for other purposes.
Otoh you dont upload cabal.project to hackage so changing manually the field
packagesin acabal.project.localbefore a sdist would be equivalent to use one or another ghc in my example (or, he, upload only some of the tar generated or whatever) and hackage will never know why there are those packages and no other ones.roberth commentedon Aug 21, 2022
My release scripts do
call sdistbefore uploading. IIRCcabal uploadfails if you don't callcabal sdistfirst. If there's a better way to do it, I'm all ears.Regardless, the current behavior is a breaking change.
Are you suggesting that the ghc dependency is only due to the
cabal.projectfeature?My first encounter with this bug was in a Nixpkgs feature that does not use
cabal.project, so that was a little confusing. My release scripts don't rely oncabal.projecteither, so I guess I'm mostly unaffected then.Shouldn't release commands always produce the same behavior regardless of the Haskell and OS platforms they run on?
Use cabal 3.8
Mikolaj commentedon Sep 5, 2022
Also affects GHC CI: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8943
Use cabal 3.8 (#1641)
Add cabal-issue-8352-workaround
Add cabal-issue-8352-workaround (#1671)
gbaz commentedon Sep 21, 2022
resolved by #8358
haskellPackages.cabalSdist: remove ghc workaround