Open guibou opened 6 years ago
The workaround I generally use for that is to use --docker-stack-exe download
which asks stack to re-install itself inside the container instead of mounting the host's stack
@regnat Thanks for the solution.
Do you think it may be a good idea to set this value by default on the stack
provided in nixpkgs?
Do you think it may be a good idea to set this value by default on the stack provided in nixpkgs?
@guibou That seems legit indeed, except that this must be done in such a way that it doesn't override whichever value is set in the stack.yaml
since the option can take other values (so we can't do that by just wrapping the executable, but we probably have to patch the source to change the default)
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Issue description
Any invocation of
stack
configured withdocker
will fail on nixos.Stack mounts himself inside the container (using docker
-v
argument). However the container may not contains the necessary dependencies, especially the dynamic linker (which are stored in/nix/store
). Hence it fails with a "classic"file not found
error.Steps to reproduce
This fails with:
Workaround
The failing command can be changed slightly to get a success:
(Please note the
-v /nix/store:/nix/store
)Having this change integrated in
stack
requires a patch, I was able to getnix-shell
with a workingstack
using this:In which there is two steps:
a) Patch
stack
. This patch will be used to mount/nix/store
in the container whenstack
setup it (i.e. this fix the first failing command line) b) Wrapstack
to add the--docker-mount
option. This will be used to mount/nix/store
in the container for any other stack command.Note: using this nix file, then
nix-shell
and the initial example, I have a successful build.Workaround discussion
Unfortunately, my solution is an adhoc hack: it won't work if the container already contains a
/nix/store
. I'm open to suggestions.Technical details