This is an archive of the discontinued LLVM Phabricator instance.

[asan][test][win] Set __COMPAT_LAYER=RunAsInvoker when running tests
AbandonedPublic

Authored by alvinhochun on Apr 22 2023, 6:23 AM.

Details

Summary

The TestCases/asan_update_allocation.cpp test on i686 MinGW target
happens to trigger a heuristic on Windows which makes it want to run as
elevated, probably because its name contains "update". This makes the
test fail when not running with elevated privileges.

Setting this environment variable tells Windows to ignore the
requirement to run as elevated, allowing the test to pass. This is the
same approach taken in https://reviews.llvm.org/D137772.

Diff Detail

Event Timeline

alvinhochun created this revision.Apr 22 2023, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2023, 6:23 AM
Herald added a subscriber: Enna1. · View Herald Transcript
alvinhochun requested review of this revision.Apr 22 2023, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2023, 6:23 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
mstorsjo accepted this revision.Apr 22 2023, 7:49 AM

LGTM, thanks!

I’ve got a similar change in queue for builtins tests too, for trampoline_setup_test.c (triggered on aarch64), I guess I should post that patch too.

This revision is now accepted and ready to land.Apr 22 2023, 7:49 AM
alvinhochun added a comment.EditedApr 24 2023, 2:30 AM

So we have three places that need this now, I wonder if it makes more sense to make this a builtin feature of lit?

So we have three places that need this now, I wonder if it makes more sense to make this a builtin feature of lit?

I guess that could make sense at this point! I'm fairly sure that no tests under lit would want the setup/installer heuristic to fire.

alvinhochun abandoned this revision.Apr 27 2023, 1:26 AM

Superseded by D149064.