It is shipped on Windows: https://github.com/swiftlang/swift-installer-scripts/blob/main/platforms/Windows/cli/cli.wxs#L128-L132
@compnerd, OK, but given it isn't actually used on Unix, are you using it on Windows either?
And does anyone know the situation on macOS?
> link -dump -imports SwiftDriverExecution.dll | findstr llbuildSwift
llbuildSwift.dll
0 $s12llbuildSwift11BuildEngineC8delegateAcA0cD8Delegate_p_tcfc
0 $s12llbuildSwift11BuildEngineCMa
0 $s12llbuildSwift11BuildEngineCMn
0 $s12llbuildSwift15TaskBuildEngineMp
0 $s12llbuildSwift19BuildEngineDelegateMp
0 $s12llbuildSwift3KeyVyACSays5UInt8VGcfC
0 $s12llbuildSwift4RuleMp
0 $s12llbuildSwift4TaskMp
0 $s12llbuildSwift5ValueVyACSays5UInt8VGcfC
I would assume that other Unicies should have a similar dependency OR they might be statically linking.
I downloaded and checked the latest OSS trunk Nov. 14 snapshot toolchain for macOS, looks like it currently ships two copies of this dylib:
> find . -name libllbuildSwift.dylib
./usr/lib/swift/pm/llbuild/libllbuildSwift.dylib
./usr/lib/swift/macosx/libllbuildSwift.dylib
Only one library uses it, just like on Windows, and it only appears to use the one in usr/lib/swift/macosx/
:
> find . -name "*.dylib" | xargs llvm-objdump --dylibs-used --macho | ag "dylib:$|libllbuildSwift.dylib" |ag -B1 "llbuildSwift.dylib "
./usr/lib/swift/pm/llbuild/libllbuildSwift.dylib:
@rpath/libllbuildSwift.dylib (compatibility version 0.0.0, current version 0.0.0)
./usr/lib/swift/macosx/libllbuildSwift.dylib:
@rpath/libllbuildSwift.dylib (compatibility version 0.0.0, current version 0.0.0)
./usr/lib/swift/macosx/libSwiftDriverExecution.dylib:
@rpath/libllbuildSwift.dylib (compatibility version 0.0.0, current version 0.0.0)
> llvm-objdump --rpaths --macho usr/lib/swift/macosx/libSwiftDriverExecution.dylib
usr/lib/swift/macosx/libSwiftDriverExecution.dylib:
/usr/lib/swift
> find . -name "*.dylib" | xargs llvm-objdump --dylibs-used --macho | ag "dylib:$|libSwiftDriverExecution.dylib" | ag -B1 "libSwiftDriverExecution.dylib "
./usr/lib/swift/macosx/libSwiftDriverExecution.dylib:
@rpath/libSwiftDriverExecution.dylib (compatibility version 0.0.0, current version 0.0.0)
> find usr/bin -type f | xargs llvm-objdump --dylibs-used --macho | ag llbuildSwift.dylib
> find usr/bin -type f | xargs llvm-objdump --dylibs-used --macho | ag ":$|libSwiftDriverExecution.dylib" | ag -B1 "libSwiftDriverExecution.dylib "
usr/bin/swift-build-sdk-interfaces:
@rpath/libSwiftDriverExecution.dylib (compatibility version 0.0.0, current version 0.0.0)
usr/bin/swift-driver:
@rpath/libSwiftDriverExecution.dylib (compatibility version 0.0.0, current version 0.0.0)
> llvm-objdump --rpaths --macho usr/bin/swift-build-sdk-interfaces
usr/bin/swift-build-sdk-interfaces:
/usr/lib/swift
@executable_path/../lib/swift/macosx
> llvm-objdump --rpaths --macho usr/bin/swift-driver
usr/bin/swift-driver:
/usr/lib/swift
@executable_path/../lib/swift/macosx
Since the one in usr/lib/swift/pm/llbuild/
installed by this command is unused in both the linux and macOS toolchains, should be fine to remove it in this pull, as Windows doesn't use this build-script
.
@marcprux, first time I'm looking at macOS dylib dependencies and rpaths, let me know if I missed anything.
@artemcm, I see you tried to statically link on macOS and remove the copy in usr/lib/swift/macosx/
also in swiftlang/swift-driver#965 a couple years ago, but ended up having to revert it: let me know what you think of this cleanup.
This is ready for a CI run, if someone would kick one off.
@jakepetroules, would you kick off a CI run here?
@swift-ci please test
@swift-ci please test
OK, passed CI again after break, @dschaefer2, perhaps you could review, because this was originally added for SwiftPM but is now unused?
@swift-ci please build toolchain
Let's make sure the toolchain jobs pass, but as far as I can see this is not used 🤔. There's a --llbuild-link-framework
in swiftpm/Utilities/bootstrap
but it isn't set from build-script at all (maybe we should remove it too?).
There's a --llbuild-link-framework in swiftpm/Utilities/bootstrap but it isn't set from build-script at all (maybe we should remove it too?).
Looks like that was added a long time ago and build-script
sets it to build against the fresh llbuild in the build_root
, not this installed llbuild in the toolchain. It does however add a backup rpath to this directory on macOS, so those two lines can definitely be removed after this pull, even if you don't want to remove all the logic for that now seemingly unused --llbuild-link-framework
flag.
Alright, toolchain builds should work now.
@swift-ci please build toolchain
Toolchains built fine, @bnbarham, ready for review and merge.
CC @dschaefer2 for your info. Seems fine to me though, it doesn't appear to be used and toolchain builds passed.
Thanks, I'll submit for 6.1 next.
Login to write a write a comment.
I'm cross-compiling the trunk Swift 6.1 toolchain for Android and was surprised to find that this library hasn't been used by the linux toolchain in years, as the following shows no other binary links to it:
I tried building SwiftPM natively on Android as part of the toolchain with this change and had no problem. The CMake-built
swift-bootstrap
uses this library but directly from the build directory, not from the install directory, so this pull has no effect on that.The Windows trunk build uses the new
swift-toolchain-sqlite
package from @jakepetroules and doesn't appear to install this library already.I don't know if macOS still needs this library installed, as I don't use that OS, but I can limit this change to non-Darwin if needed.
Jake and @ahoppen, let me know what you think.