Skip to content
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

Initial pin of VCS directory includes untracked and ignored files [2.1 regression] #5809

Open
dra27 opened this issue Jan 28, 2024 · 1 comment

Comments

@dra27
Copy link
Member

dra27 commented Jan 28, 2024

FROM ocaml/opam:debian-12-opam
RUN git clone https://github.com/ocaml/stdlib-shims.git
RUN sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam
RUN rm -rf ~/.opam && opam init --bare -a ~/opam-repository
RUN touch stdlib-shims/stdlib-shims.install stdlib-shims/untracked
RUN opam switch create --empty stdlib-shims
RUN opam pin add stdlib-shims git+file:///home/opam/stdlib-shims -yn
RUN ls -a /home/opam/.opam/stdlib-shims/.opam-switch/sources/stdlib-shims > before
RUN opam update stdlib-shims
RUN ls -a /home/opam/.opam/stdlib-shims/.opam-switch/sources/stdlib-shims > after
RUN grep '\.git\|untracked\|install' before
RUN diff -u before after

Since opam 2.1, the initial copy of the pin directory incorrectly:

  • Has no .git folder
  • Has copies of stdlib.shims.install (which is in .gitignore) and untracked (which should be an untracked file)

Replacing the opam-2.2 with opam-2.1 tests 2.1 and and removing that and the following line completely tests 2.0.

The first opam update of the VCS sources causes the .git directory to be added and the untracked/ignored files to be removed.

@kit-ty-kate
Copy link
Member

I've just hit the same bug when pinning opam itself locally with my local directory containing vendored dependencies in src_ext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants