In some Swift Server libraries, we're trying to minimize which individual Foundation sub-modules we link, and it'd be useful to have a CI check to avoid a PR accidentally regressing it.
Roughly could work like this:
- a script temporarily adds an extra executable product to the package that imports the library in the package that we want to test for not linking full Foundation on Linux
swift build that product
- run
ldd on that product in the .build directory
- ensure that
libFoundation.so is not present in there, otherwise fail the CI job