Skip to content
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

Cannot run the DEVELOPMENT-SNAPSHOT-2023-04-25-a toolchain on macOS #5387

Closed
kkebo opened this issue Apr 26, 2023 · 1 comment
Closed

Cannot run the DEVELOPMENT-SNAPSHOT-2023-04-25-a toolchain on macOS #5387

kkebo opened this issue Apr 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kkebo
Copy link

kkebo commented Apr 26, 2023

Description

The DEVELOPMENT-SNAPSHOT-2023-04-25-a toolchain doesn't seem to be run on macOS because /Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib is dynamically linked into some executables in the toolchain (e.g. swift, swiftc, and swift-frontend).

$ /Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a.xctoolchain/usr/bin/swift --version
dyld[40892]: Library not loaded: /Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib
  Referenced from: <E44B79AD-7502-3CFD-B9D7-53FB42BFC212> /Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a.xctoolchain/usr/bin/swift-frontend
  Reason: tried: '/Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib' (no such file), '/Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib' (no such file), '/usr/lib/libzstd.1.dylib' (no such file, not in dyld cache)
fish: Job 1, '/Library/Developer/Toolchains/s…' terminated by signal SIGABRT (Abort)

As far as I know, previous toolchains didn't have such a problem. For instance, the 5.8-SNAPSHOT-2023-02-25-a toolchain can be run on the same environment.

$ /Library/Developer/Toolchains/swift-wasm-5.8-SNAPSHOT-2023-02-25-a.xctoolchain/usr/bin/swift --version
SwiftWasm Swift version 5.8-dev (LLVM 44d4f9d4b49845f, Swift c49fe19cd42cb0c)
Target: arm64-apple-darwin22.5.0

The difference between the two is whether /Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib is dynamically linked or not.

$ otool -L /Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a.xctoolchain/usr/bin/swift-frontend
/Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a.xctoolchain/usr/bin/swift-frontend:
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /Users/gha-runner/homebrew/opt/zstd/lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.2)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 5.7.1)
        @rpath/libSwiftOperators.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftSyntaxMacros.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftSyntaxBuilder.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftParserDiagnostics.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftBasicFormat.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftParser.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftDiagnostics.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftSyntax.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
        /usr/lib/swift/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0, weak)
$ otool -L /Library/Developer/Toolchains/swift-wasm-5.8-SNAPSHOT-2023-02-25-a.xctoolchain/usr/bin/swift-frontend
/Library/Developer/Toolchains/swift-wasm-5.8-SNAPSHOT-2023-02-25-a.xctoolchain/usr/bin/swift-frontend:
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/swift/libswiftCore.dylib (compatibility version 1.0.0, current version 1300.0.46)
        @rpath/libSwiftOperators.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/lib_SwiftSyntaxMacros.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftSyntaxBuilder.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftParserDiagnostics.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftBasicFormat.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftParser.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftDiagnostics.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libSwiftSyntax.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
        /usr/lib/swift/libswiftDarwin.dylib (compatibility version 1.0.0, current version 0.0.0, weak)

Steps to reproduce

  1. swiftenv install https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a-macos_arm64.pkg
  2. swiftenv local wasm-DEVELOPMENT-SNAPSHOT-2023-04-25-a
  3. swift --version

Expected behavior

The last command prints its version number.

Environment

  • swiftenv 1.4.0 (installed via Homebrew)
  • swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100), Target: arm64-apple-macosx13.0
  • Xcode 14.3 (14E222b)
  • macOS 13.4 (22F5037d) (aarch64)
@kkebo kkebo added the bug Something isn't working label Apr 26, 2023
@kkebo
Copy link
Author

kkebo commented Apr 30, 2023

This issue has been fixed in DEVELOPMENT-SNAPSHOT-2023-04-29-a. Thank you so much!

@kkebo kkebo closed this as completed Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant