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

stack build with 'docker: true' fails with 'fpco/stack-build:lts-5.16' but works with 'haskell' on docker mac beta #2157

Closed
vizowl opened this issue May 18, 2016 · 7 comments

Comments

@vizowl
Copy link

vizowl commented May 18, 2016

The error is

[1 of 1] Compiling Main             ( /tmp/stack1/Setup.hs, /tmp/stack1/Setup.o )
Linking /Users/risto/.stack/setup-exe-cache/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 ...
/usr/bin/ld: fatal error: /Users/risto/.stack/setup-exe-cache/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: Function not implemented
collect2: error: ld returned 1 exit status
Exit code ExitFailure 1 while running ["ghc","-clear-package-db","-global-package-db","-hide-all-packages","-package","base","-package","Cabal-1.22.5.0","/tmp/stack1/Setup.hs","-o","/Users/risto/.stack/setup-exe-cache/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3","-rtsopts"] in /tmp/stack1/

It can be reproduced (and then worked around) with the following steps

stack new docker-test
cd docker-test

edit stack.yaml and add

docker:
  enable: true
  set-user: true

run stack build - and it will produce the error above

edit stack.yaml again

docker:
  enable: true
  set-user: true
  image: haskell

run stack build and it will build

Versions:

  • OS X 10.11.5 (15F34)
  • stack (os x) 1.1.0 x86_64 hpack-0.13.0
  • docker 1.11.1-beta12 (build: 7528)

Docker images

  • fpco/stack-build d82e549a8ca6
  • haskell 55523bbc8107
@christiantakle
Copy link

christiantakle commented May 23, 2016

I could recreate the above however after updating stack I get the following error when following the steps above:
SQLite3 returned ErrorCan'tOpen while attempting to perform open "~/.stack/docker.db".

aside: I get the same error in all my stack docker projects.

Versions

  • OS X 10.11.5 (15F34)
  • stack (os x) 1.1.2 x86_64 hpack-0.14.0
  • docker 1.11.1-beta12 (build: 7528)

Edit

I get the above error on all my projects using stack+docker.
I will try stack v1.1.0 from nix since brew no longer have it available.

@borsboom
Copy link
Contributor

Interesting that it seems to work with the haskell image. I'd tried it when I got access to the Docker for Mac beta (with the stack images) and got the same error as you, but chalked it up to Docker for Mac being in pre-release (there are lots of other problems with it too). We'd certainly like for Stack to work with Docker for Mac once it's released, and would greatly appreciate any help digging into these problems to figure out why it's not working now.

@christiantakle
Copy link

I should specify. I got the same SQLite3 error after reinstalling Docker toolbox and disabling docker for mac - beta

I will try to verify if the error is only related to docker beta. Then I can investigate why that is.

@borsboom
Copy link
Contributor

Maybe check the permissions of ~/.stack/docker.db in case the previous experiment caused it to end up owned by root or something like that. You could also try deleting the file in case it was somehow corrupted (there's nothing important stored in it that Stack can't re-create).

@vizowl
Copy link
Author

vizowl commented May 23, 2016

I just confirmed that this is still an issue with fpco/stack-build:lts-5.18 and with stack 1.1.0 - I can take a look at what is going once #2137 is resolved and the underlying dockerfiles for fpco/stack-build are published.

I upgraded to stack 1.1.2 and observed the same problem as @christiantakle - I have filed a new issue for that (#2182).

@mgsloan
Copy link
Contributor

mgsloan commented Oct 18, 2016

@vizowl #2137 and #2182 are now resolved. Want to look into this further? Perhaps we can close this issue?

@vizowl
Copy link
Author

vizowl commented Nov 8, 2016

@mgsloan I just tried the basic test case from the inital bug report with docker 1.12.3-beta29.2 “Beta29.2”, stack 1.20, and fpco/stack-build:lts7.7 and everything build fine and runs. So I will close the issue.

@vizowl vizowl closed this as completed Nov 8, 2016
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