This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [ci] Check that Windows static libraries don't contain dllexports
ClosedPublic

Authored by mstorsjo on Mar 7 2022, 2:13 PM.

Diff Detail

Event Timeline

mstorsjo created this revision.Mar 7 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 2:13 PM
Herald added a subscriber: arichardson. · View Herald Transcript
mstorsjo requested review of this revision.Mar 7 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 2:13 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Mar 16 2022, 2:09 PM
ldionne added inline comments.
libcxx/utils/ci/run-buildbot
146 ↗(On Diff #413632)

I would like to implement these checks using a test like libcxx/test/libcxx/vendor/apple/system-install-properties.sh.cpp instead. I want to avoid bloating run-buildbot and adding logic to it. Also, we should be performing those checks when we run ninja check-cxx, not only when we run on the CI.

The infrastructure for these kinds of checks is still rather immature, but the idea is that I'd like upstream libc++ to have a place to perform vendor or platform specific checks as part of libc++'s own tests. For example, making sure that the install_name is the right one, that we re-export the right symbols, etc. And this would also extend to check-cxx-abilist -- I have a local patch that tries to move the abilist tests to that infrastructure, but it's not complete enough to publish.

In summary: I'd like to make libcxx/test/libcxx/vendor (we can bikeshed on a different directory name) the canonical place for these kinds of tests.

This revision now requires changes to proceed.Mar 16 2022, 2:09 PM
mstorsjo updated this revision to Diff 416301.Mar 17 2022, 1:25 PM

Converted to a regular test as suggested. Unfortunately, the filename differs between clang-cl and mingw configs, so I duplicated the test (under vendor/mingw and vendor/clangcl) - not sure if there's any better way to have conditionals in this kind of test.

I really like this direction!

libcxx/test/libcxx/vendor/clangcl/static-lib-exports.sh.cpp
11–12 ↗(On Diff #416301)
14 ↗(On Diff #416301)

Is llvm-readobj always available? If not, it would be nice to avoid the creation of a different lit feature for each utility that we need to use. I wonder whether it would be a reasonable requirement to make sure llvm-readobj is built in order to run the libc++ test suite. Maybe not?

libcxx/test/libcxx/vendor/mingw/static-lib-exports.sh.cpp
12–13
mstorsjo added inline comments.Mar 17 2022, 2:02 PM
libcxx/test/libcxx/vendor/clangcl/static-lib-exports.sh.cpp
11–12 ↗(On Diff #416301)

MinGW is also Windows, but maybe "in clang-cl builds"?

14 ↗(On Diff #416301)

Technically I guess it could be possible to not have it, but it's available in the CI environment and it's available in the LLVM installer on Windows, so I don't think we'd have anyone come complaining about running the libcxx tests and having this test failing due to the tool missing.

mstorsjo updated this revision to Diff 416312.Mar 17 2022, 2:04 PM

Clarified the comments roughly as suggested.

ldionne accepted this revision.Mar 18 2022, 6:52 AM
This revision is now accepted and ready to land.Mar 18 2022, 6:52 AM