Skip to content

fix(engine): always remove write permissions from generated files - #16388

Merged
rgrinberg merged 2 commits into
ocaml:mainfrom
rgrinberg:push-knxlvmvqnwyt
Sep 13, 2026
Merged

rgrinberg merged 2 commits into
ocaml:mainfrom
rgrinberg:push-knxlvmvqnwyt

Conversation

@rgrinberg

@rgrinberg rgrinberg commented Sep 12, 2026

Copy link
Copy Markdown
Member

Remove the pre-2.4 language-version opt-out for generated-file permissions. Older dune-project declarations remain accepted, but generated files are always made read-only, with executable bits preserved. This makes builds consistent with the shared cache in both copy and hardlink modes.

This is a breaking change, but there's no reasonable way to support this mode with the hard link based shared cache, and we'd like projects pre-2.4 to not work differently based on whether the cache is enabled or not.

Record writable legacy outputs without caching and read-only outputs on shared-cache misses and hits in copy and hardlink modes. Check all write bits and preserve executable bits.

Validation: targeted cram test and dune fmt pass. The full @check @fmt @runtest check is blocked by existing bubblewrap uid-map permission errors in sandbox-actions/basic.t and with-bwrap.t.
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg
rgrinberg force-pushed the push-knxlvmvqnwyt branch 2 times, most recently from c8ebc84 to e52dc9c Compare September 13, 2026 08:26
Remove the execution-parameter flag and the pre-2.4 language-version opt-out. Older dune-project declarations remain accepted, but no longer leave generated files writable. Preserve executable permissions and existing symlink handling.

Bump the rule digest version to rebuild previously writable targets. Update the legacy dependency-mutation tests and document the unconditional behavior.

Validation: @check, @fmt, and focused engine, cache, directory-target, sandbox, and dependency-mutation tests pass. The full @check @fmt @runtest check has only the same baseline bubblewrap uid-map permission failures in sandbox-actions/basic.t and with-bwrap.t.
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg
rgrinberg merged commit 06f48c8 into ocaml:main Sep 13, 2026
35 of 37 checks passed
@Alizter Alizter added this to the 3.25.0 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants