diff --git a/test/blackbox-tests/test-cases/pkg/ignored-dune-lock.t b/test/blackbox-tests/test-cases/pkg/ignored-dune-lock.t new file mode 100644 index 00000000000..70bc5bbad7a --- /dev/null +++ b/test/blackbox-tests/test-cases/pkg/ignored-dune-lock.t @@ -0,0 +1,55 @@ +Test that shows what happens when dune.lock is ignored. + + $ . ./helpers.sh + + $ make_lockdir + $ cat >dune.lock/test.pkg < (version 0.0.1) + > (build + > (progn + > (run touch foo.ml) + > (patch foo.patch))) + > EOF + $ mkdir dune.lock/test.files + $ cat > dune.lock/test.files/foo.patch < diff --git a/foo.ml b/foo.ml + > index b69a69a5a..ea988f6bd 100644 + > --- a/foo.ml + > +++ b/foo.ml + > EOF + + $ mkdir src + $ cat > src/dune < (executable + > (name foo)) + > EOF + $ cat > src/foo.ml < let () = () + > EOF + > cat > dune-project < (lang dune 3.16) + > EOF + +Building test works when the dune.lock is visible to dune. + + $ build_pkg test + +Now the project is changed to only include src (which effectively ignores +dune.lock): + + $ cat > dune < (dirs src) + > EOF + +Building fails as the patch cannot be found anymore + + $ build_pkg test 2>&1 | sed 's|\.sandbox/[a-f0-9]*/|.sandbox//|' + Error: + _build/.sandbox//_private/default/.pkg/test/source/foo.patch: + No such file or directory + -> required by _build/_private/default/.pkg/test/target + +And the backage cannot be shown: + + $ show_pkg test +