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

docker on NixOS: /opt/host/bin/stack: No such file or directory #974

Closed
Fuuzetsu opened this issue Sep 10, 2015 · 10 comments
Closed

docker on NixOS: /opt/host/bin/stack: No such file or directory #974

Fuuzetsu opened this issue Sep 10, 2015 · 10 comments

Comments

@Fuuzetsu
Copy link
Contributor

Continuing from #972:

Here is the --verbose output, using few hours old master:

[nix-shell:~/programming/HaskellR]$ stack --docker build --verbose
Version 0.1.4.1 X86_64
2015-09-10 16:14:45.675949: [debug] Checking for project config at: /home/shana/programming/HaskellR/stack.yaml @(stack_GVfklN9Tojh5esYxSZDgKy:Stack.Config src/Stack/Config.hs:466:9)
2015-09-10 16:14:45.67683: [debug] Loading project config file stack.yaml @(stack_GVfklN9Tojh5esYxSZDgKy:Stack.Config src/Stack/Config.hs:489:13)
2015-09-10 16:14:45.685199: [debug] Run process: docker --version @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-10 16:14:45.70892: [debug] Run process: id -u @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-10 16:14:45.710515: [debug] Run process: id -g @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-10 16:14:45.711576: [debug] Run process: docker inspect tweag/haskellr:latest @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-10 16:14:45.798687: [debug] Run process: docker create --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/home/shana/.stack -e WORK_UID=1000 -e WORK_GID=65534 -e WORK_WD=/home/shana/programming/HaskellR -e WORK_HOME=/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -e WORK_ROOT=/home/shana/programming/HaskellR -v /home/shana/.stack:/home/shana/.stack -v /home/shana/programming/HaskellR:/home/shana/programming/HaskellR -v /home/shana/programming/HaskellR/.stack-work/docker/_sandbox/basic_build_lts-2.14_20150620:/home/shana/programming/HaskellR/.stack-work/docker -v /home/shana/programming/HaskellR/.stack-work/docker/_home:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -v /home/shana/.stack:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.stack -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs -v /nix/store/46cm44rfcdvkmff86nr1sgz9xpr8qhlx-stack-0.1.4.1/bin/stack:/opt/host/bin/stack -t -i tweag/haskellr:latest /opt/host/bin/stack --internal-re-exec --docker build --verbose @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-10 16:14:46.045681: [debug] Run process: /run/current-system/sw/bin/docker start -a -i 7754f963c674e7245a15fa5caa78083cd66b1739644619c0dee843e67edcf346 @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Run src/System/Process/Run.hs:92:5)
/bin/bash: /opt/host/bin/stack: No such file or directory
2015-09-10 16:14:46.501969: [debug] Run process: docker rm -f 7754f963c674e7245a15fa5caa78083cd66b1739644619c0dee843e67edcf346 @(stack_GVfklN9Tojh5esYxSZDgKy:System.Process.Read src/System/Process/Read.hs:260:3)

You can find the docker file at https://github.com/tweag/HaskellR/blob/master/etc/Dockerfile

@borsboom

@borsboom
Copy link
Contributor

So it does look like it's mounting the stack binary correctly.

Can you try running opening a shell in the container using this command (copied from the verbose output above but tweaked slightly):

docker run --rm --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/home/shana/.stack -e WORK_UID=1000 -e WORK_GID=65534 -e WORK_WD=/home/shana/programming/HaskellR -e WORK_HOME=/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -e WORK_ROOT=/home/shana/programming/HaskellR -v /home/shana/.stack:/home/shana/.stack -v /home/shana/programming/HaskellR:/home/shana/programming/HaskellR -v /home/shana/programming/HaskellR/.stack-work/docker/_sandbox/basic_build_lts-2.14_20150620:/home/shana/programming/HaskellR/.stack-work/docker -v /home/shana/programming/HaskellR/.stack-work/docker/_home:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -v /home/shana/.stack:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.stack -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs -v /nix/store/46cm44rfcdvkmff86nr1sgz9xpr8qhlx-stack-0.1.4.1/bin/stack:/opt/host/bin/stack -t -i tweag/haskellr:latest bash

And then you should be able to poke around the filesystem as its seen when running stack in the container. Some commands (in-container) I'd be interested in seeing the result of:

  1. ls -l /opt/host/bin/stack
  2. ldd /opt/host/bin/stack
  3. /opt/host/bin/stack --version

And on the host OS (outside the container):

  1. ls -l /nix/store/46cm44rfcdvkmff86nr1sgz9xpr8qhlx-stack-0.1.4.1/bin/stack

@borsboom
Copy link
Contributor

I have a pretty good hunch what this is. If stack is a symlink (or in a symlinked directory), the target of the symlink won't be available in the container. I think all we need to do is canonicalize the stack executable location and that will fix it.

@borsboom borsboom self-assigned this Sep 12, 2015
@borsboom borsboom added this to the P1: Must milestone Sep 12, 2015
@borsboom borsboom removed their assignment Sep 13, 2015
@borsboom
Copy link
Contributor

It appears that getExecutablePath already canonicalizes the path, so my hunch turns out to be incorrect.

@Fuuzetsu
Copy link
Contributor Author

Hi, sorry for late response, I was off. Here are the commands you wanted:

[nix-shell:~/programming/HaskellR]$ docker run --rm --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/home/shana/.stack -e WORK_UID=1000 -e WORK_GID=65534 -e WORK_WD=/home/shana/programming/HaskellR -e WORK_HOME=/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -e WORK_ROOT=/home/shana/programming/HaskellR -v /home/shana/.stack:/home/shana/.stack -v /home/shana/programming/HaskellR:/home/shana/programming/HaskellR -v /home/shana/programming/HaskellR/.stack-work/docker/_sandbox/basic_build_lts-2.14_20150620:/home/shana/programming/HaskellR/.stack-work/docker -v /home/shana/programming/HaskellR/.stack-work/docker/_home:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620 -v /home/shana/.stack:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.stack -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghc -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.cabal -v /home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs:/home/shana/programming/HaskellR/.stack-work/docker/basic_build_lts-2.14_20150620/.ghcjs -v /nix/store/46cm44rfcdvkmff86nr1sgz9xpr8qhlx-stack-0.1.4.1/bin/stack:/opt/host/bin/stack -t -i tweag/haskellr:latest bash
stack@lenalee:/home/shana/programming/HaskellR$ ls -l /opt/host/bin/stack
-r-xr-xr-x 1 root 30000 365696 Jan  1  1970 /opt/host/bin/stack
stack@lenalee:/home/shana/programming/HaskellR$ ldd /opt/host/bin/stack
    linux-vdso.so.1 =>  (0x00007ffc8e5bb000)
    libHSstack-0.1.4.1-GVfklN9Tojh5esYxSZDgKy-ghc7.10.2.so => not found
    libHSyaml-0.8.15.1-BcSGE9pPGbg1ZAhd2VZlOw-ghc7.10.2.so => not found
    libHSword8-0.1.2-F5KuxUDTuLlLpP6lg5w0dg-ghc7.10.2.so => not found
    libHSvector-binary-instances-0.2.1.0-3y37c9WQJ5Z4f6NvGxuYaV-ghc7.10.2.so => not found
    libHStemporary-1.2.0.3-AUvm2lX9uVnC7kbai2lQrC-ghc7.10.2.so => not found
    libHStar-0.4.2.1-19R4lOIcQA105qQ1MgTQaS-ghc7.10.2.so => not found
    libHSsafe-0.3.9-BXSoeRP9IFG6t9s3abNgVi-ghc7.10.2.so => not found
    libHSretry-0.6-LHNlvrwGivt2ZrxsvFHpOf-ghc7.10.2.so => not found
    libHSproject-template-0.2.0-3lvdoCI2Cfq74Db0HAqcOD-ghc7.10.2.so => not found
    libHSpersistent-template-2.1.3.4-7o0NAlRpOYAIGvjhqVx5pA-ghc7.10.2.so => not found
    libHSpersistent-sqlite-2.2-ByAdJNreou39ycBV4uJvlL-ghc7.10.2.so => not found
    libHSpersistent-2.2-3X6zEGMlQvfG3EDQnI9kKG-ghc7.10.2.so => not found
    libHSsilently-1.2.5-DN4FcQasaezFZ9bb43mcTn-ghc7.10.2.so => not found
    libHSresource-pool-0.2.3.2-5slEkFv1Vd42LuahoFsUkg-ghc7.10.2.so => not found
    libHSpath-pieces-0.2.0-4PipLSLbSZ4FqEiAVf0S4D-ghc7.10.2.so => not found
    libHSblaze-html-0.8.1.0-7DtdeEgK6xSKCxTx1g9dz4-ghc7.10.2.so => not found
    libHSblaze-markup-0.7.0.2-LYvVnMfZAPZEhkGl0afJaq-ghc7.10.2.so => not found
    libHSignore-0.1.1.0-9WvQa5TdZRS0oHW54KMgl1-ghc7.10.2.so => not found
    libHSpcre-heavy-1.0.0.1-4l0hLwqqIutGSWIHVH8EXM-ghc7.10.2.so => not found
    libHSstring-conversions-0.4-CM3uQgirrYoJ74zeMMuV3e-ghc7.10.2.so => not found
    libHSutf8-string-1.0.1.1-HWC8Qen5AZrArJxFQJuE72-ghc7.10.2.so => not found
    libHSpcre-light-0.4.0.3-J9bYKMfE86x9lEV1P3lTdK-ghc7.10.2.so => not found
    libHSbase-compat-0.8.2-2KFqPZOo6cy5X59kua49UN-ghc7.10.2.so => not found
    libHSGlob-0.7.5-AAXdrBx6cxvEk8AuISdINC-ghc7.10.2.so => not found
    libHShastache-0.6.1-K1z3urbRmpkHnYaSTBROxD-ghc7.10.2.so => not found
    libHSieee754-0.7.6-83kzroviKXw4npyWO9tKff-ghc7.10.2.so => not found
    libHSfsnotify-0.2.1-B6jqeh1rVP90BtAGJARZTn-ghc7.10.2.so => not found
    libHShinotify-0.3.8.1-B0v3H0Vm64OHnCEHWqVKIf-ghc7.10.2.so => not found
    libHSfile-embed-0.0.9-4dfRBRLb53AF2yn2BJst2q-ghc7.10.2.so => not found
    libHSextra-1.4.1-IKY34EN5PTb0DzUdjptup1-ghc7.10.2.so => not found
    libHSenclosed-exceptions-1.0.1.1-7cItBEFiDhc9PqzbYdNCmC-ghc7.10.2.so => not found
    libHSdeepseq-generics-0.1.1.2-InYFfDJdRWKEDFZEbm1sNS-ghc7.10.2.so => not found
    libHScryptohash-conduit-0.1.1-D5aoxYPqQfsH0z5zaTAsTA-ghc7.10.2.so => not found
    libHScryptohash-0.11.6-IMtLofzLTto5c22UMNTUWN-ghc7.10.2.so => not found
    libHSconduit-combinators-1.0.3-HBh4rXhe15nExF8HBkY7fD-ghc7.10.2.so => not found
    libHSunix-compat-0.4.1.4-DeAF5HEzYMu4CPLnbGbHUz-ghc7.10.2.so => not found
    libHSmwc-random-0.13.3.2-1WrZJW3egJmEia6zKtS045-ghc7.10.2.so => not found
    libHSchunked-data-0.2.0-BfVDTZD5yanAqXSIpfFEbH-ghc7.10.2.so => not found
    libHSmono-traversable-0.9.3-0NoMEClsYFkEBRDTbRkHLh-ghc7.10.2.so => not found
    libHSvector-instances-3.3.1-DXko5hwXirmDUbVYTYMlx4-ghc7.10.2.so => not found
    libHSpointed-4.2.0.2-5vRQesa7sEBKb2XzsrO7RY-ghc7.10.2.so => not found
    libHSkan-extensions-4.2.2-JRZ5jn9MwTb7gke7RJGcJ9-ghc7.10.2.so => not found
    libHSadjunctions-4.2.1-4dl6ynDYj3WJFWz3KrYfSd-ghc7.10.2.so => not found
    libHSkeys-3.10.2-6Y8Z3iG1psEGkbawKTwYee-ghc7.10.2.so => not found
    libHSvector-algorithms-0.7.0.1-2qReOhCyXWA923CUE1juTP-ghc7.10.2.so => not found
    libHSdlist-instances-0.1-B2dgmITkvSe6j9dSh7DbhX-ghc7.10.2.so => not found
    libHSbinary-tagged-0.1.1.0-EPJIqQNVBOuHJuL6fR0xDM-ghc7.10.2.so => not found
    libHSgenerics-sop-0.1.1.2-8CLcdaBSikE6ZrADGGMH7b-ghc7.10.2.so => not found
    libHSSHA-1.6.4.2-20KlMyn8Koo9JaxkzhCkQD-ghc7.10.2.so => not found
    libHSbase16-bytestring-0.1.1.6-LGFgY5jaffY4IePNqJx55U-ghc7.10.2.so => not found
    libHSaeson-0.9.0.1-CSmOs4U22EJB0E9eNFTOgh-ghc7.10.2.so => not found
    libHSvector-0.11.0.0-IGqA3lcV4NRBLLOABIuP1q-ghc7.10.2.so => not found
    libHSsyb-0.5.1-8qmIMcBFhWM7BKRUTFb5M4-ghc7.10.2.so => not found
    libHSdlist-0.7.1.2-4rEePBNsN6XHnfLlQiZgn8-ghc7.10.2.so => not found
    libHSsplit-0.2.2-FgrALIwTPiFDd8L4SuXVjJ-ghc7.10.2.so => not found
    libHSpath-0.5.2-7hlI2Rp8u4nI53tbNXCTzM-ghc7.10.2.so => not found
    libHSoptparse-simple-0.0.3-Cr1HDLDXK8AA51KalSdDsE-ghc7.10.2.so => not found
    libHSoptparse-applicative-0.11.0.2-BEBXxtKsRLOBokZuUXDllq-ghc7.10.2.so => not found
    libHSansi-wl-pprint-0.6.7.3-L9VWSOkNQnr968iyONGTUD-ghc7.10.2.so => not found
    libHSansi-terminal-0.6.2.2-DCfHCgFvnuf54wPou7VfOb-ghc7.10.2.so => not found
    libHSmonad-logger-0.3.13.2-CMeTMEAAiyW2Ax7dHYPNbf-ghc7.10.2.so => not found
    libHSstm-chans-3.0.0.4-7j9sHjGqeHj8Gs1cUILhfw-ghc7.10.2.so => not found
    libHSmonad-loops-0.4.3-EZKM1XshhukFUiBKcgN4pF-ghc7.10.2.so => not found
    libHSfast-logger-2.4.1-KgjTLJmubYe8WkasxImNGi-ghc7.10.2.so => not found
    libHSauto-update-0.1.2.2-2DkwjWlXXrh60SbDElbu3f-ghc7.10.2.so => not found
    libHSconduit-extra-1.1.9.1-Ja6H9SCooyXAFNmNMz1flO-ghc7.10.2.so => not found
    libHSprimitive-0.6-3d4UsQu7pJCEtlsxN3gLjk-ghc7.10.2.so => not found
    libHSattoparsec-0.13.0.1-IkxhU2cVm4k1URy764vkWi-ghc7.10.2.so => not found
    libHSscientific-0.3.3.8-La1GXn3rWuc3Jj76RXMUIq-ghc7.10.2.so => not found
    libHShttp-conduit-2.1.8-Ei0m1yrWzHu1p2093aBtto-ghc7.10.2.so => not found
    libHShttp-client-tls-0.2.2-0SGR9M5V4ekKY6kqHYgPnn-ghc7.10.2.so => not found
    libHSconnection-0.2.5-K9tfl8T1nVECSdAmiF8QW5-ghc7.10.2.so => not found
    libHSx509-system-1.6.1-Hqa68EYiqnVDxweka2QykG-ghc7.10.2.so => not found
    libHStls-1.3.2-4UCuFLIptXpDTLdDkC7yK2-ghc7.10.2.so => not found
    libHSx509-validation-1.6.2-FzPK6zWV8UcCB9Dndjme6T-ghc7.10.2.so => not found
    libHSx509-store-1.6.1-IJksxn7HiFrK9ZhzJd69cm-ghc7.10.2.so => not found
    libHSx509-1.6.1-9ITlFNTAIkTKDBDAKRddqN-ghc7.10.2.so => not found
    libHSpem-0.2.2-4PUXmfRI2ByCg3FTmRX4B4-ghc7.10.2.so => not found
    libHSasn1-parse-0.9.1-IvBZJbuh1DMFueT7OOQwj3-ghc7.10.2.so => not found
    libHScryptonite-0.7-HErh8HmlWFGFOhEIT9fMPu-ghc7.10.2.so => not found
    libHSmemory-0.10-3JiJnhr8ZB39OWm2GrbDNY-ghc7.10.2.so => not found
    libHSasync-2.0.2-AJHLfW4A1ei2oOxQEaJtVz-ghc7.10.2.so => not found
    libHSasn1-encoding-0.9.2-DjNP9NsG8i00vPLJfo430Y-ghc7.10.2.so => not found
    libHSasn1-types-0.3.0-3wNFDV2nXRGBkCCcfW6osX-ghc7.10.2.so => not found
    libHShourglass-0.2.9-ApT0cncUdlN4f3sTkU7of2-ghc7.10.2.so => not found
    libHSsocks-0.5.4-FEVoSoqJdHWDw2IlRSM1jL-ghc7.10.2.so => not found
    libHScereal-0.4.1.1-LMaR4P6lFvNJtmY00msKYH-ghc7.10.2.so => not found
    libHSbyteable-0.1.1-F2pcQljAfpbDG2panTEyo8-ghc7.10.2.so => not found
    libHShttp-client-0.4.21-6FDdyi0zGYeBCoXpXjFbA9-ghc7.10.2.so => not found
    libHSstreaming-commons-0.1.12.1-6xz7wfTO5gCFgJwvQL9ok3-ghc7.10.2.so => not found
    libHSzlib-0.6.1.1-IYDcUciccRK7uPRFSGbDhG-ghc7.10.2.so => not found
    libHSnetwork-uri-2.6.0.3-8J7KJPaf30Y0x5yeg98vZT-ghc7.10.2.so => not found
    libHSparsec-3.1.9-0lrZ4mSfCNG07mOjfc5kDM-ghc7.10.2.so => not found
    libHSnetwork-2.6.2.1-JJd0YV8Npqk4HDjYBpemdK-ghc7.10.2.so => not found
    libHSmime-types-0.1.0.6-JHK4sTG5bkkIKqHr9mvNKl-ghc7.10.2.so => not found
    libHShttp-types-0.8.6-ElID8T5s8ev0Mqi1ULgmnJ-ghc7.10.2.so => not found
    libHScookie-0.4.1.6-77DUdv0bYzI8AAmYeoLNf5-ghc7.10.2.so => not found
    libHSold-locale-1.0.0.7-D6X1KPq5Sui5XjrHMwvFwK-ghc7.10.2.so => not found
    libHSdata-default-class-0.0.1-CgDdtafiXY68XlqDb5IqXw-ghc7.10.2.so => not found
    libHScase-insensitive-1.2.0.4-1EfC0zxsbU5L4FgGXegGPu-ghc7.10.2.so => not found
    libHSblaze-builder-0.4.0.1-J615fyrcVhYF205KfxSrTc-ghc7.10.2.so => not found
    libHSbase64-bytestring-1.0.0.1-4ZJj8QsGFT8DENf9D2r6QV-ghc7.10.2.so => not found
    libHSgitrev-1.1.0-DbWnIqXKCbR1oS3lXy7p2G-ghc7.10.2.so => not found
    libHSfilelock-0.1.0.1-I1Q1Sh906rHHwvf8N0Gf05-ghc7.10.2.so => not found
    libHSeither-4.4.1-J4nmHvdAFGy1LVyiyWlogS-ghc7.10.2.so => not found
    libHSfree-4.12.1-FZNpImUqTho8esO82lbiRd-ghc7.10.2.so => not found
    libHSsemigroupoids-5.0.0.4-8X5RaeIOHcxIhjSLAhiMmP-ghc7.10.2.so => not found
    libHSbase-orphans-0.4.4-E55c3OEBLyu45sND7mOuE9-ghc7.10.2.so => not found
    libHSprofunctors-5.1.1-7uX0N1iLbR390pJSclHrTn-ghc7.10.2.so => not found
    libHSprelude-extras-0.4.0.2-57eavILAbKD5CaKv31zEDY-ghc7.10.2.so => not found
    libHScomonad-4.2.7.2-3PWUTAEOZmwJ7mvxB9TnLX-ghc7.10.2.so => not found
    libHSdistributive-0.4.4-BqIJ7BEyJlrAEFpIZftSfH-ghc7.10.2.so => not found
    libHScontravariant-1.3.3-HDDs6OokpW8JZgEgGMsFzn-ghc7.10.2.so => not found
    libHSvoid-0.7-0GuNvCITfn9Jyj7qLNEM3g-ghc7.10.2.so => not found
    libHSStateVar-1.1.0.1-6K4a3UqSdqh6lGAm1wlr9s-ghc7.10.2.so => not found
    libHSbifunctors-5-1zdJMfPdNpc9Z16eiVKCpk-ghc7.10.2.so => not found
    libHStagged-0.8.1-6Tf46oJAk552xT73wGffBW-ghc7.10.2.so => not found
    libHStemplate-haskell-2.10.0.0-1ejK907jvoTHoZ6iZtHeyN-ghc7.10.2.so => not found
    libHSsemigroups-0.16.2.2-CxH3HlLjs8C45oRrS1FiUZ-ghc7.10.2.so => not found
    libHSunordered-containers-0.2.5.1-9sBQblFbrP9KYsBj2g1eos-ghc7.10.2.so => not found
    libHShashable-1.2.3.3-HH3tspe6vqwK9PYExV5HBN-ghc7.10.2.so => not found
    libHStext-1.2.1.3-1l1AN4I48k37RaQ6fm6CEh-ghc7.10.2.so => not found
    libHSMonadRandom-0.4-0HPLrpuIT1h0NYNnfFzaza-ghc7.10.2.so => not found
    libHSrandom-1.1-1z8Ujelqc6aKgvPnbRUKkP-ghc7.10.2.so => not found
    libHSconduit-1.2.5-LU53fqng6dUEfAAzrwyOGW-ghc7.10.2.so => not found
    libHSresourcet-1.1.6-65VnvnmSKLoC1fuoeuKCxg-ghc7.10.2.so => not found
    libHSmmorph-1.0.4-8dNpUU8QFPe77rrwKAb20b-ghc7.10.2.so => not found
    libHSlifted-base-0.2.3.6-2QbmQh2LyJaA5ZDhCqKV2m-ghc7.10.2.so => not found
    libHSmonad-control-1.0.0.4-3XCDr1mqlERGZgaxuwJF6b-ghc7.10.2.so => not found
    libHStransformers-base-0.4.4-88TAFm21vtn2NrYUppy50c-ghc7.10.2.so => not found
    libHSexceptions-0.8.0.2-3uVlA6sPqaW7JThKnLKVK1-ghc7.10.2.so => not found
    libHStransformers-compat-0.4.0.4-DCQioW2d4vYEa3T0AmFBPv-ghc7.10.2.so => not found
    libHSstm-2.4.4-C1kFMnPqFjvDhFjgMZGUpr-ghc7.10.2.so => not found
    libHSmtl-2.2.1-KMpng31YRYc5JfMWFZ3FCU-ghc7.10.2.so => not found
    libHStransformers-0.4.2.0-3eG64VdP2vzGjP6wJiCp5X-ghc7.10.2.so => not found
    libHSCabal-1.22.4.0-96aI7pZyaxU3dsgngOxbdK-ghc7.10.2.so => not found
    libHSprocess-1.2.3.0-FLTz0SLwyG6LJUpZ52HjkU-ghc7.10.2.so => not found
    libHSpretty-1.1.2.0-7UQTOB05U7lIYPkFOVraeR-ghc7.10.2.so => not found
    libHSdirectory-1.2.2.0-KowvXytSqazBcvN7MGpFtg-ghc7.10.2.so => not found
    libHSunix-2.7.1.0-A3WgcI5QiHK4PDo4jSYdwQ-ghc7.10.2.so => not found
    libHStime-1.5.0.1-AXTdBF9VRQoBOqJT6qtmVH-ghc7.10.2.so => not found
    libHSfilepath-1.4.0.0-KsGE6pHE5eZHSN90ZVax6A-ghc7.10.2.so => not found
    libHSbinary-0.7.5.0-IvYoLp9H6Xy3zEH13MmZwd-ghc7.10.2.so => not found
    libHScontainers-0.5.6.2-LKCPrTJwOTOLk4OU37YmeN-ghc7.10.2.so => not found
    libHSbytestring-0.10.6.0-6elQVSg5cWdFrvRnfxTUrH-ghc7.10.2.so => not found
    libHSdeepseq-1.4.1.1-LbCWUlehDDeLxurARKDH5o-ghc7.10.2.so => not found
    libHSarray-0.5.1.0-E0sTtauuKsGDLZoT7lTbgZ-ghc7.10.2.so => not found
    libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw-ghc7.10.2.so => not found
    libHSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS-ghc7.10.2.so => not found
    libHSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3-ghc7.10.2.so => not found
    libHSrts_thr-ghc7.10.2.so => not found
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f941f091000)
    libyaml-0.so.2 => /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 (0x00007f941ee71000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f941ec52000)
    libpcre.so.1 => not found
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f941ea39000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f941e830000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f941e62d000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f941e429000)
    libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f941e1b4000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f941deae000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f941dae9000)
    /nix/store/qlxp7vb63fp8kx5vk9a0y3rj8svbvl27-glibc-2.21/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000056402ccba000)
stack@lenalee:/home/shana/programming/HaskellR$ /opt/host/bin/stack --version
bash: /opt/host/bin/stack: No such file or directory

@Fuuzetsu
Copy link
Contributor Author

I do point out that in the past stack --docker worked fine however.

@borsboom
Copy link
Contributor

@Fuuzetsu Where did you get your stack executable? Yours appears to be dynamically linked, but AFAIK we only release statically linked binaries. Since the shared libraries aren't bind-mounted in the container, it can't can't access them.

@Fuuzetsu
Copy link
Contributor Author

I built it either from git or nixpkgs, I do not remember now. But if dynamically linked stack is an issue then it seems like something @peti should know about.

@peti
Copy link
Contributor

peti commented Sep 22, 2015

I'm not familiar with the docker feature, so I may be way off here, but my understanding is that stack tries to start itself inside of the docker container, which is based on a Debian/Ubuntu/Whatever installation. Is that right? That attempt will invariably fail if stack comes from a Nix-based installation, because Nix doesn't have its dynamic linker at the same location as other Linuxes do. For example, standard stack binaries don't work on NixOS either:

$ wget https://github.com/commercialhaskell/stack/releases/download/v0.1.3.1/stack-0.1.3.1-x86_64-linux.gz
$ gunzip stack-0.1.3.1-x86_64-linux.gz 
$ chmod +x stack-0.1.3.1-x86_64-linux 
$ file stack-0.1.3.1-x86_64-linux 
stack-0.1.3.1-x86_64-linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26, BuildID[sha1]=1e01979917957009e68354948db9018cf36a4f1b, stripped
$ ./stack-0.1.3.1-x86_64-linux 
bash: ./stack-0.1.3.1-x86_64-linux: No such file or directory

stack expects /lib64/ld-linux-x86-64.so.2, but our linker lives at /nix/store/npfsi1d9ka8zwnxzn3sr08hbwvpapyk7-glibc-2.21/lib/ld-linux-x86-64.so.2. Because of that issue, no Nix-built binary will work on a system that doesn't have the appropriate /nix/store paths available, which the docker images do not, I suppose?

@borsboom borsboom self-assigned this Oct 1, 2015
@borsboom borsboom changed the title docker: /opt/host/bin/stack: No such file or directory docker on NixOS: /opt/host/bin/stack: No such file or directory Oct 1, 2015
@borsboom
Copy link
Contributor

borsboom commented Oct 8, 2015

Starting with the next release (stack-0.1.6.0), Stack will have the ability to download a Docker-compatible stack executable to re-run in the container when the host's executable is not known to work in the container. This will only work out-of the-box for released versions of Stack, since those will be the ones for which a Docker-compatible bindist is available. However, it is also possible to override the location of the stack executable that is bind-mounted, to support use with unreleased versions (in which case, the user is responsible for building a Docker-compatible stack executable).

This should fix the NixOS use case, as well as CentOS 6.x, and is a step toward supporting Docker from non-Linux 64-bit platforms.

Please re-open the issue if this is still not working after the next Stack release (stack-0.1.6.0).

@borsboom borsboom closed this as completed Oct 8, 2015
@snoyberg snoyberg removed the ready label Oct 8, 2015
@Fuuzetsu
Copy link
Contributor Author

Fuuzetsu commented Oct 8, 2015

That's a fine solution, thank you!

borsboom added a commit that referenced this issue Oct 9, 2015
dysinger added a commit that referenced this issue Nov 13, 2015
* master: (59 commits)
  Ignore global database when copying precompiled packages #1146
  Revert an unneeded change to 'runAndLog'
  Remove old GHCJS unpack directory if it exists
  Allow "stack setup ghcjs-0.1.0.20150924_ghc-7.10.2"
  Properly unzip GHCJS on windows (stack setup)
  Consider user-specified package flags in stack solver #1071
  Fix a warning
  Colored build status in filewatch mode
  Add NixOS to 'How to install'.
  Include NixOS information #1118
  Style improvements for Docker compatibility check
  Fix `awaiting pr` label link
  Fix GHC 7.8 build
  Docker: check host's stack compatibility by attempting to run in container and caching the result (#974)
  Fix formatting in `explicit-setup-deps` section
  Provide more information about changed files
  Compile custom Setup.hs instead of interpreting them (fixes #1041)
  Detect when hpc report gives trivial 100% #1009
  Unified coverage report #579
  Recommend extra-dep in yaml_configuration.yml
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants