This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Fix the _supportsVerify check on Windows by using hasCompileFlag
AbandonedPublic

Authored by mstorsjo on May 28 2021, 4:26 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

The %{cxx} substitution can be quoted with single quotes, which is
fine with unix shells and when executing commands with the lit
internal shell, but breaks when executed directly with subprocess.call()
on Windows.

(The alternative would be to fix the quoting of the subsitution, but
that turns out to be a deeper rabbit hole than expected.)

This also has the side effect of reducing the number of calls to
the compiler, as the hasCompileFlag method is cached.

This unlocks 114 tests that previously were skipped on Windows.

This is a much more straightforward alternative to D103310; it doesn't
address the issue of the way those strings are quoted though, but
avoids that being an issue.

Diff Detail

Event Timeline

mstorsjo created this revision.May 28 2021, 4:26 AM
mstorsjo requested review of this revision.May 28 2021, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2021, 4:26 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added inline comments.May 28 2021, 5:23 AM
libcxx/utils/libcxx/test/format.py
18

So this is a little bit tricky. The thing is that the test format is used inside the DSL, and I'd like to avoid a chicken-and-egg problem. IOW, I see this as a layering violation - the testing format is intended to be the base most thing that doesn't have any other dependencies except Lit proper.

ldionne requested changes to this revision.May 28 2021, 5:23 AM
This revision now requires changes to proceed.May 28 2021, 5:23 AM
mstorsjo added inline comments.May 28 2021, 6:24 AM
libcxx/utils/libcxx/test/format.py
18

Hmm, ok, I see...

FWIW, would it make sense to memoize this function to get it cached? When I had a printout here, I saw quite a number of calls during a regular test run.

mstorsjo abandoned this revision.May 31 2021, 11:53 PM

Went with D103310 after all, thus this one isn't needed.