This is an archive of the discontinued LLVM Phabricator instance.

[libc++][dsl] Run checks for locale names aliases using a single %exec
ClosedPublic

Authored by arichardson on Oct 6 2020, 3:11 AM.

Details

Summary

This changes the checking for available locales to use one program that
iterates over argv to test multiple locale names instead of checking each
name with a separate executable.

This massively speeds up running individual tests using an SSH executor
(it can take up to 10 seconds to compile and run a single test in some
emulated environments) in case no locales are installed since then all
fallback names are tested idividually. But even on a native machine
this reduces the libc++ lit startup time by ~1-2 second for me on a machine
that does not have locale data installed.

Diff Detail

Event Timeline

arichardson created this revision.Oct 6 2020, 3:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2020, 3:11 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
arichardson requested review of this revision.Oct 6 2020, 3:11 AM
ldionne requested changes to this revision.Oct 7 2020, 12:43 PM

Generally looks good to me, with suggestion. I agree it's more clever to check things this way.

libcxx/utils/libcxx/test/dsl.py
156

Could we simply change this to hasAnyLocale(config, locales), and then you pass a list of all the alts below?

This revision now requires changes to proceed.Oct 7 2020, 12:43 PM
arichardson added inline comments.Oct 9 2020, 1:11 AM
libcxx/utils/libcxx/test/dsl.py
156

Yes definitely, I only had the name included for debugging and didn't remove it.

drop unnecessary argument

ldionne accepted this revision.Oct 9 2020, 8:50 AM

Thanks! This is going to be a lot better on SSH executors.

This revision is now accepted and ready to land.Oct 9 2020, 8:50 AM
ldionne requested changes to this revision.Oct 9 2020, 8:51 AM

Hmm, actually, did you run the tests? I would assume at least the libcxx/test/libcxx/selftest/dsl needs updating?

This revision now requires changes to proceed.Oct 9 2020, 8:51 AM

Hmm, actually, did you run the tests? I would assume at least the libcxx/test/libcxx/selftest/dsl needs updating?

Sorry, I only ran the std/ tests. Will fix asap.

ldionne requested changes to this revision.Oct 9 2020, 9:37 AM
ldionne added inline comments.
libcxx/test/libcxx/selftest/dsl/dsl.sh.py
218 ↗(On Diff #297253)

['en_US.UTF-8']

This revision now requires changes to proceed.Oct 9 2020, 9:37 AM
ldionne accepted this revision.Oct 9 2020, 9:37 AM

LGTM with that fix. Please fix and commit.

This revision is now accepted and ready to land.Oct 9 2020, 9:37 AM