This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] [test] Use the parent process env as base env in tests
ClosedPublic

Authored by broadwaylamb on Jul 9 2020, 8:50 AM.

Details

Summary

Right now the lit config builds up an environment that the tests will be run in. However, it does it from scratch instead of adding new variables to the parent process environment. This may (and does) result in strange behavior when running tests with an executor (i. e. with the COMPILER_RT_EMULATOR CMake variable set to something).

For example, I'm using the [ssh.py script from libc++](https://github.com/llvm/llvm-project/blob/master/libcxx/utils/ssh.py) as COMPILER_RT_EMULATOR to copy a test file to the remote machine and execute it there. Under the hood, that script executes the ssh command, which needs some environment variables set properly. Before this patch, the ssh command always returned the 255 exit code with no output whatsoever.

Here this is fixed.

Diff Detail

Event Timeline

broadwaylamb created this revision.Jul 9 2020, 8:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2020, 8:50 AM
Herald added subscribers: Restricted Project, dberris. · View Herald Transcript
compnerd accepted this revision.Jul 9 2020, 9:25 AM
This revision is now accepted and ready to land.Jul 9 2020, 9:25 AM
This revision was automatically updated to reflect the committed changes.

Hi, your git commit contains extra Phabricator tags. You can drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (--date=now is my personal preference (author dates are usually not useful. Using committer dates can make log almost monotonic in time))

llvm/utils/git/pre-push.py can validate the message does not include unneeded tags.