Repository navigation
[3.25] Backport sandbox directory-dependency fixes - #16833
Merged
Merged
Conversation
This is a cram test to reproduce a bug where building a rule that runs a binary fails with a symlink error, when the rule also has a `(deps ...)` entry for the package that provides that binary. (cherry picked from commit d7a5e9b) Signed-off-by: Puneeth Chaganti <[email protected]> Signed-off-by: Ali Caglayan <[email protected]>
Compare directory-only and overlapping directory/file dependencies in symlink, copy, and hardlink sandboxes, checking the generated input first. (cherry picked from commit 828322b) Signed-off-by: Ali Caglayan <[email protected]>
Check the build exit status independently of output filtering. Normalize only the known Linux unlink/EISDIR and macOS link/EPERM diagnostics, retaining the destination path and dependency context so unexpected failures remain visible. (cherry picked from commit cf99e35) Signed-off-by: Ali Caglayan <[email protected]>
Exercise directory copies with ordinary file dependencies in symlink, copy, and hardlink sandbox modes. Record the symlink-mode rejection of sandbox file links before the action-copy fix. Also compare original input symlinks and an action-created link with the sandbox target text at another path across all three modes. (cherry picked from commit f7a22eb) Signed-off-by: Ali Caglayan <[email protected]>
Allow Io.copy_file to choose if files are able to overwritten. (cherry picked from commit 14b36d3) Signed-off-by: Ali Caglayan <[email protected]>
…l#16685) Extend the recursive-copy tests from ocaml#16653 with two action-created directory symlinks: an acyclic link pointing outside the copied tree, and a directory-link cycle. Record their current rejection ahead of relaxing symlink handling. The acyclic case should eventually copy successfully; the cyclic case must continue to terminate with an error. Tests only; no implementation changes. Related to ocaml#16675. (cherry picked from commit c5d4f33) Signed-off-by: Rudi Grinberg <[email protected]> Signed-off-by: Ali Caglayan <[email protected]>
Make recursive copy actions follow symlinks, matching ordinary file copies and the existing root-path handling. Linked files and directories are materialized at the destination rather than rejected. This fixes recursive copies of file dependencies in symlink sandboxes and supports the traversal change in ocaml#16675. Update the regressions from ocaml#16653 and ocaml#16685; directory-link cycles still fail with ELOOP. (cherry picked from commit f1a8aba) Signed-off-by: Ali Caglayan <[email protected]>
Exercise a directory copy action with a generated directory dependency, without Melange or package management. Record the current behavior in symlink, copy, and hardlink sandbox modes before changing input traversal. (cherry picked from commit 04f4c03) Signed-off-by: Ali Caglayan <[email protected]>
Extend Puneeth’s reproducer from ocaml#16546 to cover ocaml#16547 under copy sandboxing too. Record the overlapping-input failure and verify that removing the explicit package dependency lets both modes succeed. Tests only; this precedes ocaml#16675. (cherry picked from commit ffed146) Signed-off-by: Ali Caglayan <[email protected]>
Create real directories for copy, symlink, and hardlink sandbox inputs. Use Tree_copy for traversal and apply the selected mode only to files. Keep patch-back directory handling and overlap deduplication unchanged. Copy mode continues to reject overlapping files. Directory copy actions work under symlink sandboxing with the recursive symlink handling from ocaml#16686. (cherry picked from commit 42895b1) Signed-off-by: Ali Caglayan <[email protected]>
Record the copy-mode failure with dependencies on a directory, one of its subdirectories, and a file inside both. Include a similarly named sibling that sorts between the directory and its descendants, and check that empty directories are preserved. Symlink and hardlink modes expose the expected inputs, but copy mode reports File exists before the action starts. (cherry picked from commit a221aee) Signed-off-by: Ali Caglayan <[email protected]>
(cherry picked from commit d4046e7) Signed-off-by: Ali Caglayan <[email protected]>
(cherry picked from commit 2d02f36) Signed-off-by: Ali Caglayan <[email protected]>
Skip sandbox inputs that have an ancestor in the same dependency set. Populating a directory already includes its descendants, so processing those paths again duplicates work and fails in copy mode with File exists. Reuse the ancestor check from dynamic dependency population. Keep the full dependency set for subsequent requests and correction handling, and retain the existing protection for action-modified files. Turn the package dependency reproducer (ocaml#16733, issue ocaml#16547) and the simple and nested directory-overlap tests from recorded failures into success. This follows the shared-traversal change in ocaml#16675. (cherry picked from commit 0883b73) Signed-off-by: Ali Caglayan <[email protected]>
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.
Backport #16632, #16686, #16675, #16813, #16814 and #16806 with their original regression tests.
All 14 upstream source patches are preserved, with original authorship and cherry-pick references. Replaces #16832.
Build/format and regression checks pass at every commit. Full-suite checks hit local jq-helper and bubblewrap permission failures.