Make the project build using the committed lock dir#185
Make the project build using the committed lock dir#185Leonidas-from-XIV merged 5 commits intoocaml-dune:mainfrom
Conversation
0abb6ad to
841b303
Compare
|
While working on this I ran into a bit of a painful situation where the dependencies on my machine don't match the dependencies in the Docker container, so I've revived this PR. This should make sure that the dependencies match. This will allow us to drop the usage of OPAM from this repo. |
|
Why can't we download the binary directly? Building dune here seems like a waste of time? |
|
@Alizter The issue is that this is the project that creates the binaries, thus downloading the binary would create a circular dependency. I could install a Dune from the system (Alpine 3.23 ships with 3.20.2 which is not too old), which would avoid this issue? |
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
|
I suppose the better solution would be to have dedicated docker images with the released version of dune in them, but that seems more trouble than its worth. I think using an older system version of dune seems fine. |
853762e to
1aa06af
Compare
Signed-off-by: Marek Kubica <marek@tarides.com>
|
As discussed with @Alizter and @Sudha247 the issue at the moment is that Alpine ships 3.20.1 but This is a problem in general that the Dune solver might pick versions of packages that don't work with the Dune version at hand, I will create a ticket in Dune about this. I've worked around this for now by forcing the lock dir to use dune-configurator < 3.21. |
We have a docker container with dune build thanks to earlier work from Sudha: https://github.com/ocaml/dune/pkgs/container/dune Would using this, with the |
| apk add curl git musl-dev linux-headers make dune gcc | ||
| WORKDIR /home/sandworm | ||
| COPY . . | ||
| RUN sed -i /dependency_hash/d dune.lock/lock.dune |
There was a problem hiding this comment.
Could you add a comment noting why this is necessary?
There was a problem hiding this comment.
@Leonidas-from-XIV mentioned that the dependency hash was being out of sync in the docker container and he had yet to determine the cause. I believe this line was an attempt at removing it. I'm not particularly sure what caused this issue yet.
There was a problem hiding this comment.
That's exactly right. If I leave it out I get the error that's mentioned in the opening message of the PR.
I plan to create a repro case for this issue (which seems like a Dune bug) which should help debug this issue in a separate repo.
There was a problem hiding this comment.
Ok! Sounds like this is still under investigation. If ends up needing to be in the final state of the PR, I just request it be with a comment explaining why it is needed.
There was a problem hiding this comment.
That makes it clear! Linking to the issue tracking this bug will make it easier to know when this workaround can be removed.
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
| apk add curl git musl-dev linux-headers make dune gcc | ||
| WORKDIR /home/sandworm | ||
| COPY . . | ||
| RUN sed -i /dependency_hash/d dune.lock/lock.dune |
There was a problem hiding this comment.
That makes it clear! Linking to the issue tracking this bug will make it easier to know when this workaround can be removed.
Since there is a
lock.dirin the project and Dune can build the project with package management, this changes the Dockerfile to usedune pkgfor building it.Currently it is experiencing some kind of issue:
I do not experience the issue outside the Docker container and it works when using autolocking so there seems to be some kind of issue with the lock directory.