Commit 689ce38
committed
Reuse dependencies between project and tools
This allows the dependencies of the project to be shared with dev tools,
preventing unnecessarily rebuilding dependencies while building a tool
if an identical version of the package has already been built or vice
versa.
This requires storing build artifacts of dependencies of dev tools and
the project (when built in the "default" context) in a single directory,
since their relative path within the _build directory is part of the key
used to cache build artifacts. Previously the build artifacts of a
package were placed in a directory named after that package, however
since dev tools and the project may depend on different versions of the
same package, directories needed to be renamed to avoid collisions. Even
if the project and dev tools rely on the same version of some package,
it may still need to be rebuilt on occasion due to the presence/absence
of depopts, or due to manual modification to lockfiles. For this reason,
the directories containing package build artifacts contain in their
name, a hash of the contents of the lockfile of the metadata in the
package's transitive dependency closure.
This change introduces the concept of a "package digest" which is a
unique directory name for a package comprising its name, version, and
dependency closure hash. The DB type used to store metadata while
building packages has been updated to be keyed based on package digests,
and to store package metadata for dev tools and the project's default
build context in the same table to allow dependencies to be shared.
Signed-off-by: Stephen Sherratt <[email protected]>1 parent 3802d47 commit 689ce38
File tree
33 files changed
+597
-223
lines changed- bin/pkg
- src
- dune_digest
- dune_lang
- dune_pkg
- dune_rules
- test/blackbox-tests/test-cases
- describe
- pkg
33 files changed
+597
-223
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments