-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] Cargo workspace breaks mobile bundler #5865
Comments
Same for the |
The iOS usage was fixed by #5807 since we call the target detection used on desktop to move the artifacts to the Xcode project. I'll work on fixing it for Android. |
This is needed for tauri-apps/tauri#5865. The ideal solution would be moving the target dir resolver from the Tauri CLI to a separate crate, but that's overengineering until someone wants to use the tauri-mobile CLI without Tauri.
@lucasfernog I'm getting "ld: library not found for -lapp" when running This is a new project, using vite, following the guide today and with the following versions rust@1.64 yarn add -D @tauri-apps/cli@next @tauri-apps/api@next
yarn tauri init
TAURI_APPLE_DEVELOPMENT_TEAM=XXX yarn tauri ios init
yarn tauri ios dev (yarn tauri dev runs on macOS fine) |
Did you add the [lib] section in Cargo.toml? |
I guess I've missed some setup instructions? I've been following
I have the folllowing in lib, which was generated: [lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"] And this issue was the only result for this error :) |
Full Cargo.toml [package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.64"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.0.0-alpha.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "2.0.0-alpha.3", features = [] }
[features]
default = []
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ] |
using arch x86_64 |
Removing name = "app_lib" Seems to have fixed it |
I can run (...)/Build/Intermediates.noindex/ArchiveIntermediates/myapp_iOS/IntermediateBuildFilesPath/myapp.build/release-iphoneos/myapp_iOS.build/assetcatalog_generated_info.plist
note: Building targets in dependency order
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'myapp_iOS' from project 'myapp')
2023-02-08 18:24:41.876 xcodebuild[87790:4543154] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/.../T/myapp_iOS_2023-02-08_18-24-41.876.xcdistributionlogs".
error: exportArchive: The operation couldn’t be completed. Bad file descriptor
Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor"
** EXPORT FAILED **
Error Command "xcodebuild -quiet -exportArchive -archivePath /.../.../src-tauri/gen/apple/build/myapp_iOS.xcarchive -exportOptionsPlist /.../.../src-tauri/gen/apple/ExportOptions.plist -exportPath /.../.../src-tauri/gen/apple/build" didn't complete successfully, exiting with code 70. I'll keep trying and will try get a repo with a replication up if I can't solve it. |
Rerunning the xcodebuild command myself seems to work... |
Revisiting this today, I'm finding the "Bad file descriptor" happens when using yarn ( I still have beforeBuildCommand and beforeDevCommand using yarn, but initialise the build using cargo. |
Describe the bug
I recently started adding a top-level cargo workspace to all my Tauri apps, so that regular cargo commands work without annoying
cd src-tauri
.This breaks the mobile bundler however as it apparently expects a hard-coded
target
path for the dylib.Reproduction
ppm crate vite
andcargo tauri init
)ld: warning: directory not found for option '-L/Users/jonaskruckenberg/Documents/GitHub/elk-desktop/src-tauri/target/aarch64-apple-ios-sim/debug'
it is looking in the wrong path for the dylibExpected behavior
The mobile bundler should use the cargo apis (
cargo metadata
maybe?) to figure out the correct target directoryPlatform and versions
Stack trace
Additional context
No response
The text was updated successfully, but these errors were encountered: