This is an archive of the discontinued LLVM Phabricator instance.

Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'
ClosedPublic

Authored by rnk on Aug 12 2015, 10:03 AM.

Details

Summary

The lit internal shell is used by default on Windows, and it does not support
bash variable expansion. Because bash variable expansion interacts with
tokenization, it is prohibitively difficult to make the existing lit shell do
general shell variable expansion.

The most common use of shell variables in the asan tests is to add options to
the default set of options set by lit.cfg. We can avoid the need for variable
expansion with a substitution that expands to 'env ASAN_OPTIONS=<defaults:>'.

This has the side benefit of shortening the RUN lines, so it seemed better than
implementing limited variable expansion in lit.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 31954.Aug 12 2015, 10:03 AM
rnk updated this revision to Diff 31955.
rnk retitled this revision from to Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'.
rnk updated this object.
rnk added reviewers: samsonov, filcab.
rnk added a subscriber: llvm-commits.
  • Revert lsan change
samsonov accepted this revision.Aug 12 2015, 4:21 PM
samsonov edited edge metadata.

LGTM with an important note.

test/asan/lit.cfg
38 ↗(On Diff #31955)

Please make sure ASAN_OPTIONS environment variable is only set on Darwin. On Linux we still want to test the "default configuration", i.e. when there are no extra env variables set at all.

This revision is now accepted and ready to land.Aug 12 2015, 4:21 PM
filcab accepted this revision.Aug 12 2015, 4:31 PM
filcab edited edge metadata.

Thanks! Are you planning on doing this for the other sanitizers?

rnk added a comment.Aug 12 2015, 4:35 PM

Thanks! Are you planning on doing this for the other sanitizers?

For every sanitizer that we port to Windows, yes, eventually. It's going to take a while to port tsan and msan, though, so I don't see any reason to make this change now.

This revision was automatically updated to reflect the committed changes.