This is an archive of the discontinued LLVM Phabricator instance.

[lit] Set __COMPAT_LAYER=RunAsInvoker when running tests on Windows
ClosedPublic

Authored by alvinhochun on Apr 24 2023, 7:23 AM.

Details

Summary

Windows heuristics try to detect old installer programs and run them as
elevated. These heuristics include checking for certain substrings in
file names, e.g. "patch", "update", "setup". When lit tries to run
affected executables, it produces "[WinError 740] The requested
operation requires elevation" instead. Several tests have been affected
by this issue (see https://reviews.llvm.org/D137772,
https://reviews.llvm.org/D148988, https://reviews.llvm.org/D149004).

We should set this environment variable to disable this heuristic once
and for all, instead of setting it in inidividual test suites. There
should be no lit tests that legitimately want to run as elevated.

Diff Detail

Event Timeline

alvinhochun created this revision.Apr 24 2023, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 7:23 AM
Herald added a subscriber: delcypher. · View Herald Transcript
alvinhochun requested review of this revision.Apr 24 2023, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 7:23 AM

This looks good to me. If nobody wants to object to it, I’m ok with approving it myself after a couple days.

Seems reasonable to me, but I'm not a windows person. Will the duplicate line be removed from the other test suites whose reviews are linked from the summary?

Seems reasonable to me, but I'm not a windows person. Will the duplicate line be removed from the other test suites whose reviews are linked from the summary?

Yes, we’ll take care to remove the duplicate lines from individual testsuites afterwards.

mstorsjo accepted this revision.Apr 26 2023, 1:46 PM

There doesn't seem to be any objections to this, so I think we could go ahead and land it.

This revision is now accepted and ready to land.Apr 26 2023, 1:46 PM