Skip to content

Commit 77b26c7

Browse files
committed
Update autolock test to allow rebuilds
Rebuilds happen because the internal package solution generated when autolocking is specialized to the current platform. This allows building on platforms which portable lockdirs don't support by default, however it means that packages built from a pre-existing portable lockdir need to be rebuilt with the new build plan. Signed-off-by: Stephen Sherratt <[email protected]>
1 parent 9fc6cd6 commit 77b26c7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/blackbox-tests/test-cases/pkg/pkg-lock-then-autolock.t

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Test that explicit locking followed by auto-locking produces equivalent results
2-
and does not trigger unnecessary rebuilds.
1+
Test that explicit locking followed by auto-locking produces equivalent results.
32

43
$ . ./helpers.sh
54
$ mkrepo
@@ -55,7 +54,7 @@ Create a project that depends on foo:
5554
> EOF
5655

5756
Lock and build with explicit dune pkg lock:
58-
$ dune pkg lock
57+
$ dune_pkg_lock_normalized
5958
Solution for dune.lock:
6059
- foo.0.0.1
6160

@@ -71,9 +70,12 @@ Remove the lock directory:
7170
Enable auto-locking:
7271
$ enable_pkg
7372

74-
Build again - should auto-lock internally and NOT rebuild foo:
75-
$ dune exec --display short bar 2>&1 | grep "Building" || echo "no rebuilds"
76-
no rebuilds
73+
Build again - should auto-lock internally. Since the package solution is now
74+
private, it can be specialied to the current platform. This means that the
75+
build plan for the package has changed from the original portable solution
76+
generated by 'dune pkg lock', and so the dependencies must be rebuilt.
77+
$ dune exec --display short bar 2>&1 | grep "Building"
78+
Building foo.0.0.1
7779

7880
$ dune exec bar
7981
Hello from foo 0.0.1!

0 commit comments

Comments
 (0)