Skip to content

Remove deleting toolchain rpath step #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kateinoigakukun
Copy link
Member

the install script has been broken since swiftlang/swift-package-manager@8876f87
which stops adding toolchain rpath for older OSes without system
swift libraries.

[647/648] Linking sourcekit-lsp
[648/648] Linking lib_SourceKitLSP.dylib
Build complete! (104.94s)
error: /Applications/Xcode-13.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: no LC_RPATH load command with path: /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/lib/swift/macosx found in: /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin/sourcekit-lsp (for architecture arm64), required for specified option "-delete_rpath /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/lib/swift/macosx"
Traceback (most recent call last):
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 218, in <module>
Cleaning /Users/gha-runner/actions-runner/_work/swift/swift/host-build/Ninja-Release/sourcekitlsp-macosx-arm64
/Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin/swift build --show-bin-path --package-path /Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp --build-path /Users/gha-runner/actions-runner/_work/swift/swift/host-build/Ninja-Release/sourcekitlsp-macosx-arm64 --configuration release -Xlinker -rpath -Xlinker @executable_path/../lib/swift/macosx
/Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin/swift build --package-path /Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp --build-path /Users/gha-runner/actions-runner/_work/swift/swift/host-build/Ninja-Release/sourcekitlsp-macosx-arm64 --configuration release -Xlinker -rpath -Xlinker @executable_path/../lib/swift/macosx -Xswiftc -no-toolchain-stdlib-rpath
rsync -a /Users/gha-runner/actions-runner/_work/swift/swift/host-build/Ninja-Release/sourcekitlsp-macosx-arm64/arm64-apple-macosx/release/sourcekit-lsp /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin
install_name_tool -delete_rpath /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/lib/swift/macosx /Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin/sourcekit-lsp
    main()
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 195, in main
    handle_invocation(swift_exec, args)
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 143, in handle_invocation
    install(bin_path, args.install_prefixes, args.toolchain)
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 75, in install
    install_binary('sourcekit-lsp', swiftpm_bin_path, os.path.join(prefix, 'bin'), toolchain)
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 85, in install_binary
    delete_rpath(stdlib_rpath, result_path)
  File "/Users/gha-runner/actions-runner/_work/swift/swift/sourcekit-lsp/Utilities/build-script-helper.py", line 90, in delete_rpath
    subprocess.check_call(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['install_name_tool', '-delete_rpath', '/Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/lib/swift/macosx', '/Users/gha-runner/actions-runner/_work/swift/swift/host-toolchain-sdk/usr/bin/sourcekit-lsp']' returned non-zero exit status 1
ERROR: command terminated with a non-zero exit status 1, aborting

@kateinoigakukun

This comment was marked as off-topic.

@kateinoigakukun

This comment was marked as duplicate.

@kateinoigakukun kateinoigakukun changed the title Allow to fail to delete rpath when not found Allow failing to delete rpath when not found Mar 18, 2022
@kateinoigakukun kateinoigakukun force-pushed the katei/skip-removing-toolchain-rpath branch from 31644aa to 7d5db6d Compare March 18, 2022 16:06
@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

@benlangmuir
Copy link
Contributor

I'm fine with this, but maybe we should consider just removing this step if it's no longer needed with the latest swiftpm. Is anyone running build_script_helper.py to install sourcekit-lsp manually without building the rest of the toolchain?

the install script has been broken since swiftlang/swift-package-manager@8876f87
which stops adding toolchain rpath for older OSes without system
swift libraries.
@kateinoigakukun kateinoigakukun force-pushed the katei/skip-removing-toolchain-rpath branch from 7d5db6d to 707608c Compare March 18, 2022 16:29
@kateinoigakukun
Copy link
Member Author

@benlangmuir It seems reasonable to just remove the step 👍

@benlangmuir
Copy link
Contributor

@swift-ci please build toolchain

@benlangmuir
Copy link
Contributor

@swift-ci please test

@kateinoigakukun kateinoigakukun changed the title Allow failing to delete rpath when not found Remove deleting toolchain rpath step Mar 18, 2022
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for fixing it. I just triggered a toolchain build in swiftlang/swift#37710 and would like to see that pass before merging it.

@benlangmuir
Copy link
Contributor

benlangmuir commented Mar 21, 2022

I'm still seeing the stdlib rpath (via the toolchain built at swiftlang/swift#41888):

$ otool -l sourcekit-lsp
<snip>
          cmd LC_RPATH
      cmdsize 216
         path /Users/ec2-user/jenkins/workspace/swift-PR-toolchain-macos/branch-main/buildbot_osx/intermediate-install/macosx-x86_64/Library/Developer/Toolchains/swift-PR-41888-75.xctoolchain/usr/lib/swift-5.5/macosx (offset 12)
Load command 38

@ahoppen
Copy link
Member

ahoppen commented Mar 21, 2022

I'm still seeing the stdlib rpath (via the toolchain built at apple/swift#41888):

$ otool -l sourcekit-lsp
<snip>
          cmd LC_RPATH
      cmdsize 216
         path /Users/ec2-user/jenkins/workspace/swift-PR-toolchain-macos/branch-main/buildbot_osx/intermediate-install/macosx-x86_64/Library/Developer/Toolchains/swift-PR-41888-75.xctoolchain/usr/lib/swift-5.5/macosx (offset 12)
Load command 38

This is the swift-5.5 back deploy rpath, which has always been in there (at least it’s also in there for swift-5.6-DEVELOPMENT-SNAPSHOT-2022-01-11-a). We should probably revisit this in a separate PR.

@ahoppen ahoppen merged commit 27956e6 into swiftlang:main Mar 21, 2022
@benlangmuir
Copy link
Contributor

Ah, good catch. I guess for 5.5 we would want to keep it but fix it to be relative to @executable_path. That would let us start adopting Concurrency IIUC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants