Repository navigation
fix(pkg): isolate source overlays in package builds - #17219
Merged
Merged
Conversation
Alizter
marked this pull request as ready for review
November 24, 2026 12:44
Package build rules without any build or install instrutions may still use .files or extra_sources and these may mutate the sources. Therefore we should always be sandboxing these particular rules. Without sandboxing we may mutate _build in an untracked way and cause consumers of source/ to miss invalidation. The current pkg digests mask this rebuild by creating a new rule. In ocaml#16292 we remove the pkg digests which exposed this particular bug. The bug can be observed directly on main in the cram test, but basically has no ill-effect at the moment. Signed-off-by: Ali Caglayan <[email protected]>
Alizter
force-pushed
the
pkg-isolate-source-overlays
branch
from
November 24, 2026 13:14
20ccf72 to
f34382b
Compare
Alizter
added a commit
that referenced
this pull request
Nov 24, 2026
Key package targets by owner and name instead of lock digest. Remove `dune pkg print-digest`. Dev tools no longer share compiler or helper targets ([`dev-tool-merlin-stale-compiler.t`](https://github.com/ocaml/dune/pull/16292/files#diff-3bced8e7c75548e5c7813d167832fca98394cd6756b40327ea1157bf12ba8088)). No longer triggers a package rebuild: - Editing the macOS recipe or adding Windows to the lock while building on Linux ([`package-platform-rebuild.t`](https://github.com/ocaml/dune/pull/16292/files#diff-f74a927967af9a8a4830c34ae5888247144254f82c124ecbb1c19110c0e19de8)). - Switching to an equivalent non-portable lock or writing `(depends)` instead of omitting it ([`package-platform-rebuild.t`](https://github.com/ocaml/dune/pull/16292/files#diff-f74a927967af9a8a4830c34ae5888247144254f82c124ecbb1c19110c0e19de8)). - Changing only `(avoid)` or a `depexts` hint ([`package-build-metadata.t`](https://github.com/ocaml/dune/pull/16292/files#diff-8fd74690f9797c0b1433efe61be270ddc61e6760647f85f564f1ceba2aa98dcc)). The source-overlay regression was fixed on `main` in #17219. Known regressions: - Change a transitive export from `FOO=bar` to `FOO=baz`: incremental installs `bar/1.2.3`; fresh installs `baz/1.2.3` ([`exported-env.t`](https://github.com/ocaml/dune/pull/16292/files#diff-c7c70fe8b69ea61216920e8b569a9389e6f59c809dec1001acbb27604d3073c5)). - Reorder two providers of `foo`: incremental keeps the old provider; fresh picks the other ([`installed-binary.t`](https://github.com/ocaml/dune/pull/16292/files#diff-930a79378895a539df0daa9cf288207bb9997ca5329eb14dec767561898b52e3)). Part of #8652.
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.
Package build rules without any build or install instrutions may still
use .files or extra_sources and these may mutate the sources. Therefore
we should always be sandboxing these particular rules.
Without sandboxing we may mutate _build in an untracked way and cause
consumers of source/ to miss invalidation. The current pkg digests mask
this rebuild by creating a new rule. In #16292 we remove the pkg digests
which exposed this particular bug.
The bug can be observed directly on main in the cram test, but basically
has no ill-effect at the moment.
Reproduced in #17213. Related to #16292.