diff --git a/doc/hacking.rst b/doc/hacking.rst index ed604a3edace..eb0ebba7114b 100644 --- a/doc/hacking.rst +++ b/doc/hacking.rst @@ -98,6 +98,19 @@ For integration tests, we use a system similar to `Cram tests .. _ppx_expect: https://github.com/janestreet/ppx_expect +When running dune inside tests, the ``INSIDE_DUNE`` environment variable is set. +This has the following effects: + +* Change the default root detection behaviour to use the current directory + rather than the top most ``dune-project`` / ``dune-workspace`` file. +* Be less verbose when Dune outputs a user message. +* Error reporting is deterministic by default. +* Prefer not to use a diff program for displaying diffs. + +This list is not exhaustive and may change in the future. In order to find the +exact behaviour, it is recommended to search for ``INSIDE_DUNE`` in the +codebase. + Guidelines ---------- diff --git a/test/blackbox-tests/test-cases/github8041.t b/test/blackbox-tests/test-cases/github8041.t index 1276dd4dc122..8c5a39835f43 100644 --- a/test/blackbox-tests/test-cases/github8041.t +++ b/test/blackbox-tests/test-cases/github8041.t @@ -1,12 +1,14 @@ $ cat > dune-project << EOF - > (lang dune 1.0) + > (lang dune 2.4) > (package > (name p)) > EOF $ cat > dune << EOF + > (rule (copy data.txt data2.txt)) + > > (install - > (files data.txt) + > (files data.txt data2.txt) > (section share)) > EOF @@ -15,3 +17,12 @@ If sendfile fails, we should fallback to the portable implementation. $ strace -e inject=sendfile:error=EINVAL -o /dev/null dune build @install + Error: _build/default/data2.txt: Permission denied + -> required by _build/default/data2.txt + -> required by _build/install/default/share/p/data2.txt + -> required by _build/default/p.install + -> required by alias install + [1] + +#8210: data2.txt is copied from readonly-file data.txt (#3092), so it needs to +be adequately unlinked before starting the fallback.