-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Linux] (--build-system=swiftbuild): swift run fails to run executable #8416
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This issue occurs due to a difference in RUNPATH embedded in the binary. --build-system native
--build-system swiftbuild
The reason for the difference is how the final link occurs.
swiftc adds the rpath to the swift runtime within the SDK.
|
Running XCTests also run into this problem now that the missing main symbol has been fixed: swiftlang/swift-build#390 |
A potential solution to this is to use See swiftlang/swift-build#395 for the error that occurs when swiftc is used as the linker driver. |
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
On Linux when running a binary using 'swift run' if the environment does not have a the swift runtime libraries in the LD_LIBRARY_PATH, the executable will fail to run.
Expected behavior
built binary executes and prints greeting
Actual behavior
error while loading shared libraries: libswiftCore.so: cannot open shared object file: No such file or directory
Steps to reproduce
Remove any swift runtime libraries from LD_LIBRARY_PATH and /usr/lib/swift/
The text was updated successfully, but these errors were encountered: