Skip to content

cabal-install-3.8.1.0 update and sdist require ghc in PATH #8352

Closed

Description

@phadej

Otherwise

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

I guess I'm required to pass --with-compiler now?

Activity

  1. phadej commented on Aug 10, 2022

    @phadej
    CollaboratorAuthor
    Error: cabal-3.8.1.0: The program 'ghc' version >=7.0.1 is required but it could not be found.
    

    cabal sdist is not runnable without GHC in PATH, and cabal sdist doesn't have --with-compiler option.

    This is major blocker for using cabal-install-3.8.1.0.

  2. Mikolaj commented on Aug 10, 2022

    @Mikolaj
    Member

    I don't know when it changed, but my guess would be that cabal sdist now requires GHC for some of its checks. @ffaf1: do you have any inkling?

    Would enabling --with-compiler be a sufficient fix?

  3. phadej commented on Aug 10, 2022

    @phadej
    CollaboratorAuthor

    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.

  4. RyanGlScott commented on Aug 10, 2022

    @RyanGlScott
    Member

    Indeed, this prevents cabal-install-3.8.1.0 from being usable from within haskell-ci, which avoids putting compilers on the PATH by design.

  5. changed the title [-]cabal-install-3.8.1.0 requires GHC in PATH[/-] [+]cabal-install-3.8.1.0 update and sdist require GHC in PATH[/+] on Aug 10, 2022
  6. 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
  7. Mikolaj commented on Aug 10, 2022

    @Mikolaj
    Member

    Uh, oh, cabal update needing GHC sounds definitely like a bug.

  8. Mikolaj commented on Aug 10, 2022

    @Mikolaj
    Member

    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)?

  9. added
    regression on master
    on Aug 10, 2022
  10. phadej commented on Aug 10, 2022

    @phadej
    CollaboratorAuthor

    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.

  11. 18 remaining items

  12. jneira commented on Aug 11, 2022

    @jneira
    Member

    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)

  13. phadej commented on Aug 11, 2022

    @phadej
    CollaboratorAuthor

    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.

  14. roberth commented on Aug 21, 2022

    @roberth

    IMO it should not account for ghc ever.

    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.

  15. jneira commented on Aug 21, 2022

    @jneira
    Member

    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.

  16. roberth commented on Aug 21, 2022

    @roberth

    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?

  17. added a commit that references this issue on Sep 2, 2022
  18. removed
    regression on master
    on Sep 8, 2022
  19. self-assigned this
    on Sep 8, 2022
  20. gbaz commented on Sep 21, 2022

    @gbaz
    Collaborator

    resolved by #8358

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

Metadata

Metadata

Assignees

Labels

attention: needs-backport 3.8can-workaroundpriority: high 🔥regression in 3.8type: bugtype: regression

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions