Package plugins cannot open

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:


    error while loading shared libraries: 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?

found the problem, in the usr/lib/swift/pm/ binary, the RUNPATH is set to

$ readelf -d usr/lib/swift/pm/

 0x0000000000000001 (NEEDED)     Shared library: []
 0x000000000000001d (RUNPATH)    Library runpath: [$ORIGIN/../../linux]

but the correct runpath for the folder structure of the nightly toolchains should be one directory lower, so changing it to

 0x0000000000000001 (NEEDED)     Shared library: []
 0x000000000000001d (RUNPATH)    Library runpath: [$ORIGIN/../linux]

makes the package plugins work.

bug filed here:

I don't think so, because at test time in the build root, is not adjacent to , 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 into that so that the built toolchain looks like an installed one, then I think we can get rid of it.

Terms of Service

Privacy Policy

Cookie Policy