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

How to use stack-ide-sublime on docker enabled projects ? #41

Open
Globidev opened this issue Dec 23, 2015 · 0 comments
Open

How to use stack-ide-sublime on docker enabled projects ? #41

Globidev opened this issue Dec 23, 2015 · 0 comments

Comments

@Globidev
Copy link

Stack has support for building projects inside docker containers

I was wondering how I could use this plugin on projects where the docker integration is enabled because it does not seem to work out of the box.

I:

  • bootstraped a new project with stack new

  • added

    docker:
        enable: true

    to the generated stack.yaml

  • ran stack docker pull and stack setup

And I got the following error when opening my sublime-text:

[SublimeStackIDE][WARN]: Stack-IDE error:  Executable named stack-ide not found on path: [...]

This is not surprising as stack-ide-sublime calls stack as a subprocess. stack ide subcommands are run inside docker containers when docker integration is enabled. Those containers are instantiated from fpco/stack-build images which do not contain stack-ide.

I then tried to add a custom docker argument to mount stack-ide related binaries inside the containers:

docker:
    enable: true
    run-args: ["--volume=/usr/local/bin:/usr/local/bin"]

but then I get a dlopen error:

[SublimeStackIDE][WARN]: Stack-IDE error:  /usr/local/bin/ide-backend-server: error while loading shared libraries: libHSide-backend-common-0.10.1-4GFay7LkYLkBlq1EZZjmSI-ghc7.10.2.so: cannot open shared object file: No such file or directory

Indeed, a lot of the shared library dependencies are missing in the fpco/stack-build images as shown by:

docker run --rm \
    -v /usr/local/bin:/usr/local/bin \
    fpco/stack-build:lts-3.19 \
    ldd /usr/local/bin/ide-backend-server \
    | grep "not found" \
    | wc -l

53

edit:

I overlooked the fact that stack was also sharing the /home/user/.stack directory with docker containers. So if we retry the command above:

docker run --rm \
    -v /usr/local/bin:/usr/local/bin \
    -v $HOME/.stack:$HOME/.stack \
    fpco/stack-build:lts-3.19 \
    ldd /usr/local/bin/ide-backend-server \
    | grep "not found" 

libHSide-backend-common-0.10.1-4GFay7LkYLkBlq1EZZjmSI-ghc7.10.2.so => not found

there is only one missing dependency left (the one I mentioned earlier):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant