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

Closed
dra27 opened this issue Jan 28, 2024 · 2 comments · Fixed by #6221
Closed

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

dra27 opened this issue Jan 28, 2024 · 2 comments · Fixed by #6221
Assignees
Milestone

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

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Sep 2, 2024

it's actually a big issue for local projects that have git submodules that have been pulled as this issue makes them fail completely since #6132. However anecdotally (i need to test a bit more), that setup seem to have worked with opam 2.1 but not 2.2

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

Successfully merging a pull request may close this issue.

3 participants