-
Notifications
You must be signed in to change notification settings - Fork 9
Make the project build using the committed lock dir #185
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
Changes from all commits
8010b15
1aa06af
00ed38e
2bfa66c
4355e5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| * | ||
| !dune | ||
| !dune-project | ||
| !sandworm.opam | ||
| !dune.lock | ||
| !bin/ | ||
| !lib/ | ||
| !static/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,20 @@ | ||
| FROM ocaml/opam:alpine-3.23-ocaml-5.4 AS build | ||
|
|
||
| RUN sudo apk update && \ | ||
| sudo apk add curl git curl-dev libev-dev openssl-dev gmp-dev && \ | ||
| sudo ln -f /usr/bin/opam-2.5 /usr/bin/opam && opam init --reinit -ni && \ | ||
| opam update -y | ||
|
|
||
| WORKDIR /home/opam | ||
| COPY sandworm.opam sandworm.opam | ||
| RUN opam install . --deps-only -y | ||
| COPY --chown=opam:opam . . | ||
| RUN opam exec -- dune build --release | ||
| FROM alpine:3.23 AS build | ||
| RUN apk update && \ | ||
| apk add curl git musl-dev linux-headers make dune gcc | ||
shonfeder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| WORKDIR /home/sandworm | ||
| COPY . . | ||
| # There is a bug that makes Dune believe the lock file is out of date. | ||
| # This is not the case, thus we disable the check by removing the hash from | ||
| # the lock file as a (temporary) workaround | ||
| RUN sed -i /dependency_hash/d dune.lock/lock.dune | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a comment noting why this is necessary?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes it clear! Linking to the issue tracking this bug will make it easier to know when this workaround can be removed. |
||
| RUN apk add $(dune show depexts 2>&1) | ||
| RUN dune build --release | ||
|
|
||
| FROM alpine:3.23 AS run | ||
| RUN apk update && apk add --update libev gmp git | ||
| WORKDIR /app | ||
| COPY --from=build /home/opam/static static | ||
| COPY --from=build /home/opam/metadata.json ./metadata.json | ||
| COPY --from=build /home/opam/_build/install/default/bin/sandworm /bin/sandworm | ||
| COPY --from=build /home/sandworm/static static | ||
| COPY --from=build /home/sandworm/metadata.json ./metadata.json | ||
| COPY --from=build /home/sandworm/_build/install/default/bin/sandworm /bin/sandworm | ||
| EXPOSE 80 | ||
| CMD [ "sandworm", "serve", "--port", "80"] | ||
| CMD ["sandworm", "serve", "--port", "80"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| (lang dune 3.20) | ||
| (pkg enabled) | ||
|
|
||
| (lock_dir | ||
| (path dune.lock) | ||
| (constraints | ||
| (dune-configurator (<= 3.21)) | ||
| (dune-private-libs (<= 3.21)))) |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| (version 3.20.2) | ||
|
|
||
| (build | ||
| (all_platforms | ||
| ((action | ||
| (progn | ||
| (when %{pkg-self:dev} (run dune subst)) | ||
| (run rm -rf vendor/csexp) | ||
| (run rm -rf vendor/pp) | ||
| (run dune build -p %{pkg-self:name} -j %{jobs} @install)))))) | ||
|
|
||
| (depends | ||
| (all_platforms | ||
| (dune ocaml base-unix dyn ordering pp csexp))) | ||
|
|
||
| (source | ||
| (fetch | ||
| (url | ||
| https://github.com/ocaml/dune/releases/download/3.20.2/dune-3.20.2.tbz) | ||
| (checksum | ||
| sha256=b1a86b2d60bdb4a8b9bb6861bdf2f9f28a6e7cb5d833ce81afecceb9ef9ca549))) |
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.