Skip to content

Commit 10a7aa0

Browse files
Don't let command run by Dune observe INSIDE_EMACS (#4680)
To improve reproducibility
1 parent 934cf04 commit 10a7aa0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ Unreleased
147147
- Do not log `live_words` and `free_words` in trace file. This allows using
148148
`Gc.quick_stat` which does not scan the heap. (#4643, @emillon)
149149

150+
- Don't let command run by Dune observe the environment variable
151+
`INSIDE_EMACS` in order to improve reproducibility (#4680,
152+
@jeremiedimino)
153+
150154
2.9.0 (unreleased)
151155
------------------
152156

src/dune_rules/global.ml

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ let init ~capture_outputs =
1414
else
1515
Colors.setup_env_for_colors Env.initial
1616
in
17-
Env.add env ~var:"INSIDE_DUNE" ~value:"1")
17+
let env = Env.add env ~var:"INSIDE_DUNE" ~value:"1" in
18+
(* To improve reproducibility, we don't let command executed by Dune
19+
observe whether Dune is run inside emacs or not. One such program that
20+
behave differently when run inside emacs is Dune itself and we sometimes
21+
run Dune from inside Dune, for instnace in cram tests, so it is
22+
important to do this. *)
23+
Env.remove env ~var:"INSIDE_EMACS")
1824

1925
let env () = Fdecl.get env

0 commit comments

Comments
 (0)