| Issue |
53167
|
| Summary |
Running tests (check-llvm etc) litters /tmp with leftover files
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mstorsjo
|
This is a regression since 3c7d8792f12d6598ead6c3fb5f10d5a4be90ed4c (cc @yln).
While the code in 3c7d8792f12d6598ead6c3fb5f10d5a4be90ed4c seems straightforward, there's a subtle interaction that makes this not work as intended at all:
When test processes are executed, they only are passed the environment variables set in `config.environment`. In most suites, `lit.cfg.py` copies environment variables from `os.environ` into `config.environment`; most of them bring `TMP` and `TEMP` along, e.g. https://github.com/llvm/llvm-project/blob/3c7d8792f12d6598ead6c3fb5f10d5a4be90ed4c/llvm/test/lit.cfg.py#L41-L43 and https://github.com/llvm/llvm-project/blob/3c7d8792f12d6598ead6c3fb5f10d5a4be90ed4c/llvm/test/Unit/lit.cfg.py#L27-L32.
Before this change, the `lit_tmp_` directory was set in `os.environ['TMP']` before parsing the test suites `lit.cfg.py`, and thus it got picked up properly. But after this change, the new `lit_tmp_` directory does get created, but it doesn't get propagated into `config.environment`, so the tests don't actully get this variable.
I guess we'd either have to make the `run_tests_in_tmp_dir` function inject these fields into `config.environment` if possible somehow - or just revert this change and unconditionally create the temp dir before lit tries to do anything at all.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs