Commit 5da56b4
committed
Use CIRCLRCI environment variable
When `__FILE__` macro is in code, this produces different paths in
different environments, making the builds not reproducible. We use
`-ffile-prefix-map` to avoid this problem but only when
`deterministic_paths` is True:
https://github.com/emscripten-core/emscripten/blob/d5c419f8aa428bc3d1d071d23227dd13a00b463c/tools/system_libs.py#L495-L501
which is set to True when embuilder is used in non-`USE_NINJA` mode:
https://github.com/emscripten-core/emscripten/blob/1171adaa21048ba8dc82169b9d79952e8754b201/embuilder.py#L296
The rationale for this seems to be that we sometimes want correct
absolute paths when we debug and test programs locally.
But CircleCI runs several code size tests and if the those tests contain
objects with `__FILE__` macro, the code sizes in those tests can be
different in different CircleCI bots.
This uses the environment variable `CIRCLECI`, which is True when we are
in CircleCI bots, to decide whether we need to set
`deterministic_paths`.
This was prompted due to a recent change in libc++abi:
https://github.com/llvm/llvm-project/blob/aadaa00de76ed0c4987b97450dd638f63a385bed/libcxxabi/src/abort_message.h#L22
This `__FILE__` ends up being used from
`other.test_minimal_runtime_code_size_hello_embind`, making the test's
result different in different bots. But this can happen in other places
and it is generally better to produce reproducible builds in CirclrCI
bots anyway.1 parent 978ac9b commit 5da56b4
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | | - | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| |||
0 commit comments