-
Notifications
You must be signed in to change notification settings - Fork 608
SwiftPM commands broken with swift-tensorflow-DEVELOPMENT-2019-12-19-a
#347
Comments
Here's the macOS toolchain directory structure diff between diff --git a/Users/danielzheng/12.txt b/Users/danielzheng/19.txt
index f94b1dc..d7b5cc9 100644
--- a/Users/danielzheng/12.txt
+++ b/Users/danielzheng/19.txt
@@ -1,4 +1,4 @@
-swift-tensorflow-DEVELOPMENT-2019-12-12-a.xctoolchain
+swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain
├── Info.plist
├── System
│ └── Library
@@ -1029,7 +1029,6 @@ swift-tensorflow-DEVELOPMENT-2019-12-12-a.xctoolchain
│ ├── CodeRequirements-1
│ ├── CodeResources
│ └── CodeSignature
-├── swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain -> /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain
└── usr
├── bin
│ ├── clang -> clang-7
@@ -1832,4 +1831,4 @@ swift-tensorflow-DEVELOPMENT-2019-12-12-a.xctoolchain
└── swift
└── LICENSE.txt
-287 directories, 1545 files
+286 directories, 1545 files There's no significant difference in the toolchain structure - the single-line symlink diff isn't significant. Perhaps RPATHs have changed for the |
This appears to be an RPATH issue. RPATHs for SwiftPM tools like
$ otool -l /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain/usr/bin/swift-build
...
Load command 30
cmd LC_RPATH
cmdsize 168
path /Users/swiftninjas/s4tf/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain/usr/lib/swift/macosx (offset 12)
Load command 31
cmd LC_RPATH
cmdsize 128
path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift (offset 12)
Load command 32
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
Load command 33
cmd LC_RPATH
cmdsize 168
path /Users/swiftninjas/s4tf/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-19-a.xctoolchain/usr/lib/swift/macosx (offset 12)
$ otool -l /Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-12-a.xctoolchain/usr/bin/swift-build
...
Load command 28
cmd LC_RPATH
cmdsize 128
path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift (offset 12)
Load command 29
cmd LC_RPATH
cmdsize 32
path @loader_path (offset 12)
Load command 30
cmd LC_RPATH
cmdsize 168
path /Users/swiftninjas/s4tf/swift/swift-nightly-install/Library/Developer/Toolchains/swift-tensorflow-DEVELOPMENT-2019-12-12-a.xctoolchain/usr/lib/swift/macosx (offset 12)
Load command 31
cmd LC_RPATH
cmdsize 56
path @executable_path/../lib/swift/macosx (offset 12)
Load command 32
cmd LC_RPATH
cmdsize 56
path @executable_path/../lib/swift/pm/llbuild (offset 12) The I wonder what logic adds the |
Temporary fix: re-add the
I'll ask on swiftlang/swift-package-manager#2462 to see if anyone's encountered these RPATH issues before. Comparing RPATHs with recent swift.org/download toolchains seems productive for debugging. |
The 2019-12-19 trunk development snapshot from swift.org/download has the following
I think the
To support toolchains built with |
Still reproduces with swift-tensorflow-DEVELOPMENT-2020-01-30-a.xctoolchain |
…arwin. Add `@executable_path/../lib/swift/<platform>` RPATH on Darwin platforms. This is necessary for experimental toolchains that include libraries not part of the OS (e.g. `PythonKit` or `TensorFlow`). Verified to fix SwiftPM command linker issues for Swift for TensorFlow toolchains: tensorflow/swift#347. Effectively reverts swiftlang#2548: an unverified fix for the same issue that did not work.
Add `@executable_path/../lib/swift/<platform>` RPATH on Darwin platforms. This is necessary for experimental toolchains that include libraries not part of the OS (e.g. `PythonKit` or `TensorFlow`). Verified to fix SwiftPM command linker issues for Swift for TensorFlow toolchains: tensorflow/swift#347. Effectively reverts swiftlang#2548: an unverified fix for the same issue that did not work.
Add `@executable_path/../lib/swift/<platform>` RPATH on Darwin platforms. This is necessary for experimental toolchains that include libraries not part of the OS (e.g. `PythonKit` or `TensorFlow`). Verified to fix SwiftPM command linker issues for Swift for TensorFlow toolchains: tensorflow/swift#347. Effectively reverts swiftlang#2548: an unverified fix for the same issue that did not work.
Fixed in swiftlang/swift-package-manager#2553. |
Uh oh!
There was an error while loading. Please reload this page.
SwiftPM commands are broken with the
swift-tensorflow-DEVELOPMENT-2019-12-19-a
macOS toolchain:This error likely surfaced in the
swift-DEVELOPMENT-SNAPSHOT-2019-12-16-a -> tensorflow
merge: swiftlang/swift#28847.Temporary fix: re-add the
@executable_path/../lib/swift/macosx
RPATH for SwiftPM tool binaries.The text was updated successfully, but these errors were encountered: