I am trying to use the new package plugins feature in the latest swift-DEVELOPMENT-SNAPSHOT-2021-04-18-a-ubuntu20.04 toolchain, and i am running into the following issue whenever i try to set up a minimal example package with a package plugin:
$ SWIFTPM_ENABLE_PLUGINS=1 swift build
.build/plugins/cache/compiled-plugin:
error while loading shared libraries: libFoundation.so: cannot
open shared object file: No such file or directory
this issue didn’t happen with the older 2021-03-07-a snapshot, and packages that import Foundation with no package plugins build successfully with 2021-04-18-a. anyone know how to fix this?
I don't think so, because at test time in the build root, libXCTest.so is not adjacent to libFoundation.so , so $ORIGIN won't work.
If, however, we move to a toolchain based development model where XCTest is built against a synthesized toolchain, and it also installs libXCTest.so into that so that the built toolchain looks like an installed one, then I think we can get rid of it.