fix(pkg): .files handling in lock rules #13403
Draft
Alizter wants to merge 5 commits intoocaml:mainfrom
Draft
Conversation
3b9c1c3 to
5707c44
Compare
punchagan
reviewed
Jan 22, 2026
src/dune_rules/pkg_rules.ml
Outdated
| let+ file_set = Build_system.files_of ~dir:files_dir_path in | ||
| Some build_path, Filename_set.filenames file_set | ||
| | _ -> | ||
| let files_dir_path_no_version = Pkg.files_dir info.name None ~lock_dir in |
Collaborator
There was a problem hiding this comment.
I pushed a fix to allow files to live in un-versioned directory. This fixes some of the failing tests.
src/dune_rules/pkg_rules.ml
Outdated
| let* exists = Build_system.file_exists files_dir_path in | ||
| match exists, Path.as_in_build_dir files_dir_path with | ||
| | true, Some build_path -> | ||
| let+ file_set = Build_system.files_of ~dir:files_dir_path in |
Collaborator
There was a problem hiding this comment.
Build_system.files_of ignores any sub-directories and files in them. Only the top-level files are returned, which is a problem.
Collaborator
Author
There was a problem hiding this comment.
This is the wrong thing to be using here unfortunately. I didn't have time to think about the correct way. Do you have examples of extra files with subdirectories?
Collaborator
There was a problem hiding this comment.
The failing test in CI is an example.
test/blackbox-tests/test-cases/pkg/opam-package-with-patch-multiple.t
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Puneeth Chaganti <punchagan@muse-amuse.in>
4cd22ec to
4caeaec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pkg enabledfails to build an oxcaml project without a lock #12851The rules we have for working with
.filesinpkg_rules.mlare incorrectly accessing the "source" location of the lock files rather than the common internal lock directory that gets either copied or generated. This means that dev tools and autolocking cannot work with extra files.This PR is a rough attempt at making the rules inspect the correct place, but it is still drafty due to lack of time. @punchagan will instead take over and try to fix it up.