Skip to content

reftest: add test for opam repo ci reinstall workflow#6539

Merged
kit-ty-kate merged 1 commit intoocaml:masterfrom
rjbou:reftest-opam-repo-ci
Jun 18, 2025
Merged

reftest: add test for opam repo ci reinstall workflow#6539
kit-ty-kate merged 1 commit intoocaml:masterfrom
rjbou:reftest-opam-repo-ci

Conversation

@rjbou
Copy link
Copy Markdown
Collaborator

@rjbou rjbou commented Jun 10, 2025

-
Processing 1/7: [main.1: extract]
+ tar "xfz" "${OPAMTMP}/archive.tgz" "-C" "${OPAMTMP}"
-> retrieved main.1 (file://${BASEDIR}/archive.tgz)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is absent from the original reported issue, which might mean that the archive/directory was retrieved from a different location

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to reproduce the issue with the following dockerfile:

FROM ocaml/opam
RUN sudo ln -f /usr/bin/opam-dev /usr/bin/opam
RUN opam init --reinit -ni
RUN opam pin add -k version -yn dune.3.18.0 3.18.0
RUN opam install dune.3.18.0
RUN rm -rf /home/opam/.opam/download-cache/sha512
RUN rm -rf /home/opam/.opam/download-cache/sha256/b7
RUN opam reinstall --with-test dune.3.18.0

@kit-ty-kate
Copy link
Copy Markdown
Member

I was able to reproduce the original issue:

FROM ocaml/opam
RUN git clone https://github.com/ocaml/opam
RUN cd opam && make cold
RUN sudo install ./opam/opam /usr/bin/opam
RUN opam --version
RUN opam init --reinit -ni
RUN opam pin add -k version -yn dune.3.18.0 3.18.0
RUN opam install dune.3.18.0
RUN rm -r /home/opam/.opam/download-cache
RUN ls /home/opam/.opam/5.3/.opam-switch/sources/dune
RUN opam reinstall --with-test dune.3.18.0
RUN ls /home/opam/.opam/5.3/.opam-switch/sources/dune
RUN opam reinstall --with-test dune.3.18.0

The first ls succeeds but by the second one, the directory has been removed somehow.

@kit-ty-kate
Copy link
Copy Markdown
Member

After some bisecting i found the culprit: #6436

The issue is that reinstalls are decoupled into remove and install actions. In the case of a real reinstall we of course want to remove all the artefacts, but if it's a reinstall we actually want to keep them.
Previously this issue was there but partially hidden by the fact that that behaviour was only there for non-packages and in opam-repo-ci the packages that are being tested are pinned.

@rjbou rjbou force-pushed the reftest-opam-repo-ci branch from 2b4e369 to f3af917 Compare June 16, 2025 11:17
@rjbou rjbou force-pushed the reftest-opam-repo-ci branch from f3af917 to 3c4d188 Compare June 16, 2025 20:32
@rjbou rjbou added PR: QUEUED Pending pull request, waiting for other work to be merged or closed PR: WAITING FOR REVIEW labels Jun 16, 2025
@rjbou rjbou force-pushed the reftest-opam-repo-ci branch from 3c4d188 to 67cf68c Compare June 17, 2025 10:57
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kit-ty-kate kit-ty-kate mentioned this pull request Jun 17, 2025
@rjbou rjbou force-pushed the reftest-opam-repo-ci branch 2 times, most recently from 64279c1 to 9bc9629 Compare June 17, 2025 16:57
@kit-ty-kate kit-ty-kate removed the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label Jun 17, 2025
@kit-ty-kate kit-ty-kate force-pushed the reftest-opam-repo-ci branch from 9bc9629 to 06c543e Compare June 17, 2025 19:19
@kit-ty-kate kit-ty-kate force-pushed the reftest-opam-repo-ci branch from 06c543e to 068452f Compare June 17, 2025 23:17
@kit-ty-kate kit-ty-kate merged commit 08d4f79 into ocaml:master Jun 18, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants