Skip to content

Fix the false-positive mismatch debug warning during "opam update" when faced with nested extra-files on Windows#6715

Merged
rjbou merged 2 commits intoocaml:masterfrom
kit-ty-kate:nested-extra-files
Oct 3, 2025
Merged

Fix the false-positive mismatch debug warning during "opam update" when faced with nested extra-files on Windows#6715
rjbou merged 2 commits intoocaml:masterfrom
kit-ty-kate:nested-extra-files

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate commented Oct 2, 2025

Discovered in the tests of #6614

The extra-files loader on Windows breaks when the file is contained in a directory and thinks there is a mismatch between the files listed in the field and the files detected on disk. The faulty behaviour can't be seen in the tests as i'm running them on Unix but it can be seen in the tests results of #6614 on Windows.

diff --git a/_build/default/tests/reftests/update.test b/_build/default/tests/reftests/update.out
index 8f52cdb..cd9a0db 100644
--- a/_build/default/tests/reftests/update.test
+++ b/_build/default/tests/reftests/update.out
@@ -415,6 +415,8 @@ EOF
 
 <><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
 [git-test] synchronised from git+file://${BASEDIR}/GITREPO
+opam-file                       Mismatching extra-files at ${BASEDIR}/OPAM/repo/git-test/packages/pkg-a/pkg-a.1: missing from 'files' directory (1) and missing from opam file (1)
+opam-file                       Mismatching extra-files at ${BASEDIR}/OPAM/repo/git-test/packages/prefix-pkg-b/pkg-b.1: missing from 'files' directory (1) and missing from opam file (1)
 Now run 'opam upgrade' to apply any package updates.
 ### opam list --all --repo=git-test -s
 new-pkg

cp p.patch $pkgpath/files/dir/
### sh add-nested-files.sh good-nested-md5.1
### sh update-hashes.sh
### opam update default
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no change in the tests in the last commit (as said because the tests was run on windows). It worth adding a comment that at least describes the windows behaviour that is removed in the second commit, to know what is the diff.

Copy link
Copy Markdown
Member Author

@kit-ty-kate kit-ty-kate Oct 2, 2025

Choose a reason for hiding this comment

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

I regenerated the test on Windows and the commit now shows the diff

@kit-ty-kate kit-ty-kate changed the title Fix the handling of nested extra-files on Windows Fix the false-positive mismatch debug warning during "opam update" when faced with nested extra-files on Windows Oct 2, 2025
@kit-ty-kate kit-ty-kate requested a review from rjbou October 2, 2025 21:46
@rjbou rjbou merged commit f370351 into ocaml:master Oct 3, 2025
45 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