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

Generated packages should include packages for *all* platforms #1681

Open
michaelpj opened this issue Jan 6, 2021 · 4 comments
Open

Generated packages should include packages for *all* platforms #1681

michaelpj opened this issue Jan 6, 2021 · 4 comments
Labels
preserved Keep stale bot away

Comments

@michaelpj
Copy link
Collaborator

fsnotify depends on shelly only on linux. The generated Nix code to build fsnotify correctly reifies this cabal conditional to require shelly only if we're building on linux. But if you generate the Nix for a project that includes fsnotify, the packages will contain shelly iff you generated the plan on linux.

This means that, although the build expression for fsnotify itself is platform-independent, the Nix for the whole project is not. This means:

  • You can't pin the plan-sha256 unconditionally, you need a different sha for linux and non-linux.
  • If you do pin it with, say, the linux sha and then try to build on darwin, you will pull down the linux plan-nix, and this will fail because it will try to depend on shelly which isn't there. (Note: I haven't tried this, but I'm extrapolating)

You can observe this with IntersectMBO/plutus#2581, compare:

nix-build default.nix -A plutus.haskell.extraPackages.haskell-language-server.project.plan-nix --argstr system x86_64-linux

and

nix-build default.nix -A plutus.haskell.extraPackages.haskell-language-server.project.plan-nix --argstr system x86_64-darwin
@michaelpj
Copy link
Collaborator Author

Oh, to be clear, I think we should put all the packages we might need with any conditionals into packages.

@quetz
Copy link

quetz commented Jan 19, 2021

Having this issue with haskell-language-server (different build plans on darwin and linux).
So proposed solution is either unpinning plan-sha256 or using conditional like in https://github.com/input-output-hk/plutus/blob/c4685b8ad54cdb8ca33d67a7be252ecccbccd31f/nix/pkgs/haskell/extra.nix#L91 ?

@michaelpj
Copy link
Collaborator Author

Yes. It's quite painful :(

@hamishmack
Copy link
Collaborator

I think this will require #1696

@hamishmack hamishmack added the preserved Keep stale bot away label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

3 participants