-
Notifications
You must be signed in to change notification settings - Fork 87
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
Shell.nix, almost #645
Shell.nix, almost #645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to work for me (whereas the previous iteration did):
[nc@lorien:~/topos/iohk/ouroboros-network]$ nix-shell --run "cabal new-build ouroboros-consensus"
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-crypto-wrapper-1.3.0 (user goal)
[__1] trying: base64-bytestring-type-1.0.1/installed-Hpj... (dependency of
cardano-crypto-wrapper)
[__2] next goal: serialise (dependency of base64-bytestring-type)
[__2] rejecting: serialise-0.2.1.0/installed-LOU... (package is broken)
[__2] fail (backjumping, conflict set: base64-bytestring-type, serialise)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base64-bytestring-type,
cardano-crypto-wrapper, serialise
@nc6, two options for what could have gone wrong:
(EDIT: to clarify, I couldn't reproduce locally.) |
shell.nix
Outdated
default = import ./default.nix {}; | ||
in | ||
default.nix-tools._raw.shellFor { | ||
packages = p: map (x: p."${x}") [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not this?
packages = p: map (x: p."${x}") [ | |
packages = ps: with ps; [ io-sim io-sim-classes ... ]; | |
inherit withHoogle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks!
]; | ||
withHoogle = withHoogle; | ||
buildInputs = with default.nix-tools._raw; [ | ||
cabal-install.components.exes.cabal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to assume that the user already has the latest cabal in their profile, so we don't need to add it to the project's dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really? The cabal in question might be incongruent in some fashion with the GHC in use -- or even completely absent.
If we choose not to specify it here, it would be one of those extra things for someone to care (as in debug, research etc.) about.
This project's Haskell.nix package set is generated from I got the same error as @nc6. If I removed the constraints and source-repository-package sections from `cabal.project then it worked. |
1924da8
to
928673e
Compare
@rvl, indeed. I've mentioned that in the PR description -- there is an upstream issue regarding this problem. Do you have a suggestion of a workaround in the meantime? |
I don't think this is an upstream issue with Cabal. The Haskell.nix But if So you need to make sure that |
What you just described is specifically the Cabal behavior I asked the upstream for -- and according to them, it's not currently possible -- if you have a |
928673e
to
8d41620
Compare
80d03eb
to
81e61c6
Compare
Closed in favor of #723 -- same, but updated. |
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
For source-repository-package's, cabal tries to build them on its own, even when all dependencies are already provided by Nix. Relevant issues: - haskell/cabal#6049 - IntersectMBO/ouroboros-network#645 - haskell/cabal#5586 (comment) This seems to be a problem even with a cabal that includes haskell/cabal#6917 (see input-output-hk/haskell.nix#720 (comment) for how to test a cabal-install 3.4) The only known workaround is to remove the source-repository-package sections from cabal.project, but this should only be done for cabal when used from a nix-shell, not from cabal without a nix-shell, and not outside the nix-shell. To make this work smoothly, the script `scripts/nix-setup` can be used, which splits the source-repository-package sections into cabal.project.srcs, which is then again included from here (to make the Nix setup still work). Running the script again undoes it.
This almost brings back
nix-shell
that can build/rundemo-playground
.The only blocker is the need to remove the source package definitions in the Cabal project file, which is caused by this Cabal issue: haskell/cabal#6049 (comment)