Repository navigation
refactor(pkg): remove pkg digests - #16292
Conversation
5a05e73 to
65134db
Compare
65134db to
fa48aa5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Stable paths currently permit stale environment-dependent builds and case-insensitive package-root collisions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Removes digest-qualified package identities, using package names within isolated project and dev-tool universes instead.
Changes:
- Reworks package databases, resolution, and build paths.
- Removes
Pkg_digestanddune pkg print-digest. - Updates package cram tests for the new layout.
File summaries
| File | Description |
|---|---|
test/blackbox-tests/test-cases/pkg/withenv-path.t |
Updates package paths. |
test/blackbox-tests/test-cases/pkg/variables.t |
Updates paths and diagnostics. |
test/blackbox-tests/test-cases/pkg/unknown-package.t |
Updates unknown-package error. |
test/blackbox-tests/test-cases/pkg/unavailable-package-source.t |
Updates source failure paths. |
test/blackbox-tests/test-cases/pkg/toolchain-variables.t |
Updates toolchain path. |
test/blackbox-tests/test-cases/pkg/substitute.t |
Updates dependency substitutions. |
test/blackbox-tests/test-cases/pkg/source-with-directory-symlink.t |
Updates source paths. |
test/blackbox-tests/test-cases/pkg/set-ocamlfind-destdir.t |
Updates install destination paths. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-platform-dependant-dependencies.t |
Updates portable package roots. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-platform-alternative-selection.t |
Updates selected package roots. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-older-common-version.t |
Removes digest lookup. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-custom-solver-env.t |
Uses name-based package path. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-custom-platforms.t |
Uses name-based package path. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-build-context-solver-env.t |
Uses name-based package path. |
test/blackbox-tests/test-cases/pkg/portable-lockdirs/portable-lockdirs-basic.t |
Updates portable build paths. |
test/blackbox-tests/test-cases/pkg/pkg-deps.t |
Updates package dependency paths. |
test/blackbox-tests/test-cases/pkg/pkg-deps-lock.t |
Updates rule dependencies. |
test/blackbox-tests/test-cases/pkg/patch.t |
Updates patch diagnostics. |
test/blackbox-tests/test-cases/pkg/opam-var/opam-var-switch.t |
Updates opam variable paths. |
test/blackbox-tests/test-cases/pkg/odoc/dev-tool-odoc-dune-tools-install.t |
Updates isolated odoc path. |
test/blackbox-tests/test-cases/pkg/ocamllsp/dev-tool-ocamllsp-env-path-var.t |
Updates dev-tool environments. |
test/blackbox-tests/test-cases/pkg/ocamllsp/dev-tool-ocamllsp-basic.t |
Updates ocamllsp path. |
test/blackbox-tests/test-cases/pkg/ocamlformat/ocamlformat-which.t |
Updates ocamlformat lookup. |
test/blackbox-tests/test-cases/pkg/ocamlformat/ocamlformat-install.t |
Updates ocamlformat install path. |
test/blackbox-tests/test-cases/pkg/ocamlformat/dune |
Adds curl dependencies. |
test/blackbox-tests/test-cases/pkg/ocaml-compiler.t |
Updates compiler package path. |
test/blackbox-tests/test-cases/pkg/merlin/dev-tool-merlin-env.t |
Updates Merlin environment path. |
test/blackbox-tests/test-cases/pkg/lock-directory-selection.t |
Updates package errors. |
test/blackbox-tests/test-cases/pkg/installed-binary.t |
Updates install-cookie paths. |
test/blackbox-tests/test-cases/pkg/install-symlinks/link-permission-error.t |
Updates symlink failure paths. |
test/blackbox-tests/test-cases/pkg/install-symlinks/dir-symlink.t |
Updates directory-symlink paths. |
test/blackbox-tests/test-cases/pkg/install-symlinks/broken-symlink.t |
Updates broken-symlink paths. |
test/blackbox-tests/test-cases/pkg/install-missing-entry.t |
Updates missing-entry paths. |
test/blackbox-tests/test-cases/pkg/install-action.t |
Updates install action output. |
test/blackbox-tests/test-cases/pkg/ignored-dune-lock.t |
Updates inactive-lock error. |
test/blackbox-tests/test-cases/pkg/helpers.sh |
Simplifies package path helper. |
test/blackbox-tests/test-cases/pkg/findlib-meta-optional-directory.t |
Updates findlib diagnostic. |
test/blackbox-tests/test-cases/pkg/fetch-symlinks/valid-links.t |
Updates fetched source paths. |
test/blackbox-tests/test-cases/pkg/fetch-symlinks/link-to-parent.t |
Updates cycle diagnostics. |
test/blackbox-tests/test-cases/pkg/fetch-symlinks/escaping-link.t |
Updates escaping-link diagnostics. |
test/blackbox-tests/test-cases/pkg/fetch-symlinks/basic-cycle.t |
Updates cycle path. |
test/blackbox-tests/test-cases/pkg/fetch-local-source.t |
Removes digest lookup. |
test/blackbox-tests/test-cases/pkg/fetch-cache-symlink.t |
Updates cache expectations. |
test/blackbox-tests/test-cases/pkg/extra-source-overlap-with-source.t |
Uses name-based source path. |
test/blackbox-tests/test-cases/pkg/dune |
Updates cram dependencies. |
test/blackbox-tests/test-cases/pkg/different-dune-in-path.t |
Uses direct package paths. |
test/blackbox-tests/test-cases/pkg/dep-section-variables.t |
Updates section paths. |
test/blackbox-tests/test-cases/pkg/default-exported-env.t |
Updates exported environment paths. |
test/blackbox-tests/test-cases/pkg/build-with-executable-script-on-windows.t |
Updates Windows diagnostics. |
test/blackbox-tests/test-cases/pkg/broken-symlink-in-dependency.t |
Updates dependency source paths. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/workspace-shadows-lockdir.t |
Updates narrowed PATH entries. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/transitive-deps.t |
Updates transitive PATH entries. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/resolve-program.t |
Updates resolved program paths. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/multi-package.t |
Updates multi-package paths. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/lockdir-deps.t |
Updates lock-directory paths. |
test/blackbox-tests/test-cases/pkg/bin-narrowing/ambient-path-fallback.t |
Updates fallback PATH. |
test/blackbox-tests/test-cases/pkg/absolute-paths-in-sections.t |
Updates absolute package paths. |
test/blackbox-tests/test-cases/describe/describe_location.t |
Updates described executable path. |
src/dune_rules/pkg_rules.mli |
Removes digest API. |
src/dune_rules/pkg_rules.ml |
Implements name-keyed package universes. |
src/dune_rules/pkg_dev_tool.ml |
Adds per-package dev-tool root. |
src/dune_rules/lock_dir.mli |
Removes optional dev-tool loader. |
src/dune_rules/lock_dir.ml |
Removes optional dev-tool loading. |
src/dune_rules/dune_rules.ml |
Removes exported digest API. |
bin/pkg/print_digest.mli |
Deletes command interface. |
bin/pkg/print_digest.ml |
Deletes digest command. |
bin/pkg/group.ml |
Unregisters digest command. |
Review details
- Files reviewed: 64/67 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fa48aa5 to
e2f29ac
Compare
a3d1eb7 to
26aa8ac
Compare
26aa8ac to
26a3592
Compare
Demonstrate that the compiler isn't currently shared between the main build and a dev tool. This needs to be fixed before #16292.
7d47cde to
74ee0aa
Compare
74ee0aa to
c3453ec
Compare
edbee21 to
816f089
Compare
816f089 to
bb815c0
Compare
bb815c0 to
239ae53
Compare
|
There were various missing environment dependencies in the package rules that weren't apparent before because the package digests invalidated the directory in which the rules were loaded and therefore avoided stale builds. Removing the digests has made these missing deps apparent. My plan is to reproduce and observe these in some test coverage and then fix the missing deps sperately before continuing with this PR> |
7bf6e96 to
eb82ae5
Compare
Match cache misses against the exact package target rather than looking for a digest in its path. This distinguishes the effect of reordering extra sources from editing their contents. Refs #16292.
85a44a6 to
9bad555
Compare
Have mock Merlin record a marker from the compiler during installation. Changing only the project’s locked compiler recipe, without bumping its version, distinguishes using the project compiler from re-solving for the same version. With no explicit OCaml dependency, mock Merlin currently reports `no-compiler` both times. Refs #16292.
65e7351 to
85815ab
Compare
85815ab to
9160da0
Compare
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]>
9160da0 to
7d83d0c
Compare
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.
cfb8a79 to
5a569d8
Compare
Resolve each tool and its dependencies from its own lock directory and generate their targets under that tool. Compiler packages follow the same rule; tool locks keep the existing compiler version and pin policy. Signed-off-by: Ali Caglayan <[email protected]>
5a569d8 to
e272fa0
Compare
This patch removes pkg digests. It exposes a few inconsistencies in the pkg rules which are fixed as a result. It does however mean that enviornment exports are not tracked, and the order of package deps can affect binary lookup for conflicting binaries. Both of these issues are not important enough to fix for the time being. Signed-off-by: Ali Caglayan <[email protected]>
e272fa0 to
6991dc1
Compare
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).No longer triggers a package rebuild:
package-platform-rebuild.t).(depends)instead of omitting it (package-platform-rebuild.t).(avoid)or adepextshint (package-build-metadata.t).The source-overlay regression was fixed on
mainin #17219.Known regressions:
FOO=bartoFOO=baz: incremental installsbar/1.2.3; fresh installsbaz/1.2.3(exported-env.t).foo: incremental keeps the old provider; fresh picks the other (installed-binary.t).Part of #8652.