-
Notifications
You must be signed in to change notification settings - Fork 84
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
Feature request: support esy within docker #264
Comments
Hmm yeah that's a tricky one. reason-language-server needs to be able to communicate with esy to determine the location of ocamlc & other binaries used for on-the-fly compilation, and to read the compiler artifacts for analysis. To try out this proof of concept, you could have something like the following:
And I think that might work? Let me know how it goes :) |
Unfortunately, that didn't work. I'm getting this error:
I used the linux.zip file from the releases page and placed the exe at [/reason-language-server/rls.exe] in the container. The bash script used (rls.exe): #!/bin/bash
export $(grep -v ^# /Users/donut/RTM/OVPSync/.env | xargs -0)
docker-compose --file="/Users/donut/RTM/OVPSync/docker-compose.yml" exec dev \
/reason-language-server/rls.exe "$@" Then I set The Dockerfile: ARG ESY_IMAGE
FROM $ESY_IMAGE as esy
# Niceties
RUN apk add --no-cache fish vim
# Timezone
# See https://serverfault.com/q/683605/54523
ARG TZ
RUN apk add --no-cache tzdata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Needed for @esy-ocaml/[email protected]
RUN apk add --no-cache texinfo
# Needed for @opam/tls
RUN apk add --no-cache gmp-dev
# Need for @opam/caqti-driver-mariadb
RUN apk add --no-cache mariadb-dev
# Reason language server
# Used by VSCode through `docker-compose exec` to get the right environment.
RUN apk add --no-cache unzip
RUN mkdir /reason-language-server
WORKDIR /reason-language-server
RUN curl -LO https://github.com/jaredly/reason-language-server/releases/download/1.5.2/linux.zip
RUN unzip linux.zip
RUN rm linux.zip
RUN mv reason-language-server/reason-language-server.exe rls.exe
RUN rmdir reason-language-server
RUN apk del --no-cache unzip
RUN mkdir /app
WORKDIR /app
ENTRYPOINT ["tail", "-f", "/dev/null"] On the host, in the project's directory, running using the bash script:
|
Looks like the |
Progress, I think. With just adding
If I include Here's the updated shell script: #!/bin/bash
export $(grep -v '^#' /Users/donut/RTM/OVPSync/.env | xargs -0)
docker-compose --file="/Users/donut/RTM/OVPSync/docker-compose.yml" \
exec -T --workdir=/app app /reason-language-server/rls.exe $@ The Dockerfile hasn't changed in any ways relevant to this. |
Very cool. Ok yeah so the next issue is helping rls translate between the directory paths that vscode is sending (which are in the host fs) and the ones that it can access (in the docker image). I imagine this would want to be done as an argument to rls in the bash script. I don't have a ton of bandwidth to implement this at the moment, but if you're interested I could give you pointers! |
Yeah, I'm interested! If you can point me in the right direction, I'll take a look on Monday. |
I have my
esy
environment setup in a docker container. I do not have it installed on the host machine. I usedocker-compose exec <container name> esy
. But I keep getting this error: "Couldn't get esy version".The solution I found is to install
esy
on the host machine and build there and on the docker container. This isn't ideal, but it's working for now..Unfortunately, this basically blocks all useful functionality.
debug log
The text was updated successfully, but these errors were encountered: