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

[bug] iOS failed to compile with Xcode15 beta2, unable to load standard library #7339

Closed
pewsheen opened this issue Jul 3, 2023 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@pewsheen
Copy link
Contributor

pewsheen commented Jul 3, 2023

Describe the bug

I'm using macOS14 with Xcode15 Beta2 and trying to run on an iOS simulator.

When I execute pnpm tauri ios dev, it can't compile the Swift package in Tauri and shows error error: unable to load standard library for target 'arm64-apple-ios13.0-simulator'

The code that swift-rs is running:

cd "/Users/jason/Documents/issues/xcode15/dep/tauri/core/tauri/mobile/ios-api" && "swift" "build" "-c" "debug" "--build-path" "/Users/jason/Documents/issues/xcode15/src-tauri/target/aarch64-apple-ios-sim/debug/build/tauri-2743b5cc521eb051/out/swift-rs/Tauri" "-Xswiftc" "-sdk" "-Xswiftc" "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk" "-Xswiftc" "-target" "-Xswiftc" "arm64-apple-ios13.0-simulator"

Workaround

It seems to be an SDK issue, so I switch the Xcode back to 14 and it works:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Reproduction

Expected behavior

No response

Platform and versions

[✔] Environment
    - OS: Mac OS 14.0.0 X64
    ✔ Xcode Command Line Tools: installed.  --> Xcode15 Beta2 (15A5160n)
    ✔ rustc: 1.70.0 (90c541806 2023-05-31)
    ✔ Cargo: 1.70.0 (ec8a8a0ca 2023-04-25)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.0.0
    - pnpm: 8.6.5
    - yarn: 1.22.19
    - npm: 9.6.4

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.9
    - tauri-build [RUST]: 2.0.0-alpha.5
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.20.0
    - @tauri-apps/api [NPM]: 2.0.0-alpha.5
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.10

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite

Stack trace

error: failed to run custom build command for `tauri v2.0.0-alpha.9 (/Users/jason/Documents/issues/xcode15/dep/tauri/core/tauri)`

Caused by:
  process didn't exit successfully: `/Users/jason/Documents/issues/xcode15/src-tauri/target/debug/build/tauri-9c77635a1da19f61/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=dev
  cargo:rustc-cfg=mobile
  cargo:rustc-link-search=native=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
  cargo:rustc-link-search=native=/usr/lib/swift
  cargo:rustc-link-lib=clang_rt.iossim
  cargo:rustc-link-search=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin
  iphonesimulator
  Building for debugging...
  error: emit-module command failed with exit code 1 (use -v to see invocation)
  [1/3] Emitting module SwiftRs
  <unknown>:0: error: unable to load standard library for target 'arm64-apple-ios13.0-simulator'
  [2/3] Compiling SwiftRs lib.swift
  <unknown>:0: error: unable to load standard library for target 'arm64-apple-ios13.0-simulator'
  error: fatalError

  --- stderr
  Fetching https://github.com/Brendonovich/swift-rs from cache
  Fetched https://github.com/Brendonovich/swift-rs (0.94s)
  Computing version for https://github.com/Brendonovich/swift-rs
  Computed https://github.com/Brendonovich/swift-rs at 1.0.5 (0.61s)
  Creating working copy for https://github.com/Brendonovich/swift-rs
  Working copy of https://github.com/Brendonovich/swift-rs resolved at 1.0.5
  thread 'main' panicked at 'Failed to compile swift package Tauri', /Users/jason/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.5/src-rs/build.rs:272:17
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
     1: core::panicking::panic_fmt
               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
     2: swift_rs::build::SwiftLinker::link
               at /Users/jason/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.5/src-rs/build.rs:272:17
     3: tauri_build::mobile::link_swift_library
               at /Users/jason/Documents/issues/xcode15/dep/tauri/core/tauri-build/src/mobile.rs:104:3
     4: build_script_build::main
               at ./build.rs:130:7
     5: core::ops::function::FnOnce::call_once
               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
       Error [tauri_cli_node] Failed to run `cargo build`: command ["cargo", "build", "--package", "xcode15", "--manifest-path", "/Users/jason/Documents/issues/xcode15/src-tauri/Cargo.toml", "--target", "aarch64-apple-ios-sim", "--features", "tauri/rustls-tls", "--lib", "--no-default-features"] exited with code 101
 ELIFECYCLE  Command failed with exit code 1.

** BUILD FAILED **

Additional context

No response

@pewsheen
Copy link
Contributor Author

pewsheen commented Aug 3, 2023

Fixed in Brendonovich/swift-rs#51

@pewsheen pewsheen closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant