opam icon indicating copy to clipboard operation
opam copied to clipboard

opam reinstall without --with-test does not realize one of the installed package has been modified

Open kit-ty-kate opened this issue 1 year ago • 0 comments

To reproduce:

git clone --recursive "https://github.com/ocaml/opam-repository.git" && cd "opam-repository" && git fetch origin "refs/pull/21924/head" && git reset --hard f90ed7d6
git fetch origin master
git merge --no-edit aed2a8dda4d902b44915b75e82af9cd3c6ba2cd9
cat > ../Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:debian-11-ocaml-4.14@sha256:690df1105e4b20e976fbf62795c9e3642e6635f40ade5d3577ca361c4850a8cc
USER 1000:1000
WORKDIR /home/opam
RUN sudo ln -f /usr/bin/opam-dev /usr/bin/opam
RUN opam init --reinit -ni
ENV OPAMDOWNLOADJOBS="1"
ENV OPAMERRLOGLEN="0"
ENV OPAMSOLVERTIMEOUT="500"
ENV OPAMPRECISETRACKING="1"
RUN rm -rf opam-repository/
COPY --chown=1000:1000 . opam-repository/
RUN opam repository set-url --strict default opam-repository/
ENV OPAMCRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
ENV OPAMFIXUPCRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
ENV OPAMUPGRADECRITERIA="-removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed"
RUN opam pin add -k version -yn tezos-client-commands.14.0 14.0
RUN opam update --depexts
RUN opam reinstall tezos-client-commands.14.0
RUN opam reinstall tezos-baking-014-PtKathma-commands.14.0
RUN opam reinstall --with-test tezos-baking-014-PtKathma-commands.14.0

END-OF-DOCKERFILE
docker build -f ../Dockerfile .

Full log: https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/f90ed7d6718b594b938f65a3ddf3a777c0599973/variant/compilers,4.14,tezos-client-commands.14.0,revdeps,tezos-baking-014-PtKathma-commands.14.0

In this example, the compiler installed is ocaml-base-compiler.4.14.0 in the state before https://github.com/ocaml/opam-repository/commit/0543b741931ab6e9caa764ec8d525f8b0b80ae92. However the two first opam reinstall commands do not trigger the reinstallation of opam-base-compiler, but the last one (with --with-test) does, for some reason.

In my opinion, the first command should have done that as the package depends on ocaml-base-compiler through the ocaml package, thus the switch state after the first reinstall command is out-of-sync compared to the repository state (which should not happen, from what I understand)

kit-ty-kate avatar Aug 10 '22 16:08 kit-ty-kate