[llvm] [lit] Export env vars in script to avoid pruning (PR #105759)

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 15:13:43 PDT 2024


keith wrote:

> Just to make sure I understand the problem correctly: on macOS rtld clears these environment variables when we invoking sh/bash to execute the test script?

Correct, the first process that is executed, dyld captures the variables and wipes them from the process pre `main`.

> So my assumption would be that this is not needed for the internal shell, is that correct?

Correct!

> I would like to see this in a comment in the code explaining why we have to export all environment variables. And I'd also prefer if we could just export the ones starting with DYLD_ to avoid adding extra statements to each test script, slowing down overall execution.

Updated to scope to only variables that start with `DYLD_*`


https://github.com/llvm/llvm-project/pull/105759


More information about the llvm-commits mailing list