Skip to content
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

source-repository-package stanzas in conditionals don't work #1943

Open
michaelpj opened this issue May 11, 2023 · 8 comments
Open

source-repository-package stanzas in conditionals don't work #1943

michaelpj opened this issue May 11, 2023 · 8 comments
Labels
bug Something isn't working preserved Keep stale bot away

Comments

@michaelpj
Copy link
Collaborator

e.g.

if impl(ghc >= 9.6)
  -- Version on Hackages does not compile with `ghc-9.6`
  -- https://github.com/haskell-foundation/foundation/issues/576
  source-repository-package
    type: git
    location: https://github.com/Topsii/foundation
    tag: d3136f4bb8b69e273535352620e53f2196941b35
    subdir:
      basement
      edge
      foundation

We fail to replace this, so even if you have a sha256map it fails trying to access the network.

Not surprising give out ad-hoc parser in Nix. Probably the best way to fix it is to continue pulling stuff into Haskell where we can use cabal's parser, cc @andreabedini

@michaelpj michaelpj added the bug Something isn't working label May 11, 2023
@andreabedini
Copy link
Member

Yes, I am not surprised. Thanks for reporting this.

@stale
Copy link

stale bot commented Sep 13, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 13, 2023
@stale stale bot closed this as completed Nov 12, 2023
@michaelpj
Copy link
Collaborator Author

Wait, is this actually fixed? @andreabedini

@michaelpj michaelpj reopened this Nov 13, 2023
@michaelpj michaelpj removed the wontfix label Nov 22, 2023
@michaelpj
Copy link
Collaborator Author

The latest release of HLS has a conditional stanza for 9.8 that includes head.hackage, and as such isn't buildable (from the repository) with haskell.nix because of this issue.

@angerman
Copy link
Collaborator

@andreabedini for my understanding. The issue is an additional conditional compiler stanza, in the cabal.project file, which then ends up prohibiting us from going forward, even if it's completely irrelevant to the build?

@andreabedini
Copy link
Member

It look like we just ignore it, so the example above would work with ghc < 9.6 (because cabal would skip that section and won't pull the srp) but it would fail on ghc >= 9.6 whether or not you add the -- sha256: xxx line to the srp.

@michaelpj
Copy link
Collaborator Author

Yes, exactly. The situation is:

  • We don't replace it like we normally do
  • If cabal doesn't use the body of the conditional, that's fine
  • If cabal does use the body of the conditional, it all goes wrong because we haven't replaced it

@michaelpj
Copy link
Collaborator Author

This also applies to things like repository stanzas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

3 participants