-
Notifications
You must be signed in to change notification settings - Fork 841
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
Stack/Nix integration: does not include "git" in dependencies when going into nix-shell #2089
Comments
If I manually add
If Cabal needs pkg-config, shouldn't that one also be |
@rrnewton Actually yes for now it's something you should add manually to your nix packages when you need it. |
Surely the docs can be improved yes, since it tripped up @rrnewton. The question is - is there a bug here, no matter how easy the workaround? There is a tension between automagic and least surprise. If Stack silently adds packages inside a sandbox, then the content of the sandbox is ill-defined, and not easy to reproduce when e.g. the user switches to using a |
@mboes : I agree that there's a tension here. IMHO there is necessarily a degree of auto-magic in this feature. Stack is launching itself inside Nix! Am I supposed to know that as a user? I.e. that stack calls itself, via e.g. If stack is automagically including itself in the nix derivation (not to mention Btw, in the above example I think it's Cabal that brings in the Regarding the possibility of "conflicts arising": it's really too bad that the current way of calling into nix-shell doesn't provide a means for |
Stack is not adding itself in the nix derivation, it relaunches the same 2016-05-03 17:12 GMT+02:00 Ryan Newton [email protected]:
|
@rnewton makes a good point about
If we want full reproducibility for container builds, we can't have stack depend on more external programs in the future. Seems like there are a few decent ways of handling this:
|
@YPares I admit to being a bit confused by |
Ok, it sounds like folks in this thread would perhaps prefer a patch that implements something like this:
The implication is that the ability to shell out to git/pkg-config becomes part of the "public interface" of stack/Cabal, not an internal implementation detail hidden by the abstraction. As people here have suggested, as long as that set of things does not grow, that's probably not too bad for users to learn. |
I want to understand this previous question though, before letting it drop: @YPares : regarding stack not adding itself to the derivation -- why not? Then wouldn't it be able to list things like git and pkg-config as runtime dependencies in a precise way? To possibly answer my own question, something seems to be wrong with |
Because I see no point in making the user re-dowload a software they 2016-05-04 14:49 GMT+02:00 Ryan Newton [email protected]:
|
Yes, to get a matched version nixpkgs would need to contain at least all the publicly released versions of stack. That way stack could ask for the same version as its currently running. When using either Nix or Docker, it seems like massive downloads and disk usage are in the cards ;-). I don't think the extra 10MB for another stack binary would be a big problem. @mboes: I read the original blog post. Is there an explanation somewhere of why the design has stack shelling into |
stack remains the build tool. 2016-05-04 15:33 GMT+02:00 Ryan Newton [email protected]:
|
To be honest, the current integration is fragile in ways I don't yet understand. For instance, if you download that repo mentioned at the top of this issue, it builds with As far as I can tell, they really should do the same thing. The |
@YPares: Thanks, I can see that if nix-build must always create an output to I suspect this means that stack/Docker will provide stronger isolation and better reproducibility than stack/nix for now. |
@rrnewton I'm not sure I have a good answer to that question. |
@rrnewton sounds eminently reasonable to me. Let's open a new ticket regarding that. |
To Reproduce:
Error output:
The problem seems to be with the
nix-shell
command that stack is formulating, which does not include git:Run process: nix-shell --pure -I nixpkgs=https://github.com/iu-parfunc/nixpkgs/archive/hpx-master.tar.gz -E "wi th (import <nixpkgs> {}); runCommand \"myEnv\" { buildInputs=lib.optional stdenv.isLinux glibcLocales ++ [ hpx haskell.packages.lts-5_9.ghc ]; STAC K_PLATFORM_VARIANT=''nix''; STACK_IN_NIXSHELL=1; STACK_IN_NIX_EXTRA_ARGS='' --extra-lib-dirs=${hpx}/lib --extra-include-dirs=${hpx}/include --extr a-lib-dirs=${haskell.packages.lts-5_9.ghc}/lib --extra-include-dirs=${haskell.packages.lts-5_9.ghc}/include '' ; } \"\"" --command "'/nix/store/kf f433s61k9808vwb9m0yl8pmipirvxs-stack-1.0.4.3/bin/stack' $STACK_IN_NIX_EXTRA_ARGS '--internal-re-exec-version=1.0.4.3' 'build' '--verbose'" @(stack_ HKArHFFZq7p7BGX6AeJtxh:Stack.Exec src/Stack/Exec.hs:51:5)
So the solution would seem to be to either (1) always ask for git, or (2) ask for git only when the
stack.yaml
file includes stanzas like this:CC @RyanGlScott
The text was updated successfully, but these errors were encountered: