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] tauri mobile build leaves a .cargo folder #6578

Open
Berrysoft opened this issue Mar 29, 2023 · 8 comments
Open

[bug] tauri mobile build leaves a .cargo folder #6578

Berrysoft opened this issue Mar 29, 2023 · 8 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Berrysoft
Copy link
Contributor

Describe the bug

After I run tauri android dev or tauri android build, or tauri ios dev or tauri ios build, it leaves a .cargo folder with a config in the src-tauri folder. The config confuses cargo. For example, on Windows, the config set the default target to x86_64-pc-windows-msvc, and then simply running cargo build will compile binaries to target/x86_64-pc-windows-msvc/debug but not target/debug. This config is also not cross-platform because different OS uses different host target.

Reproduction

cargo tauri android init
cargo tauri android dev

Expected behavior

I don't understand why it generates such config. It shouldn't do that. We don't need to set host target manually at all.

Platform and versions

Environment
  › OS: Windows 10.0.22621 X64
  › Webview2: 111.0.1661.54
  › MSVC:
      - Visual Studio ???? 2022
  › Node.js: 18.15.0
  › npm: 9.5.0
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.25.2
  › rustc: 1.70.0-nightly
  › cargo: 1.70.0-nightly
  › Rust toolchain: nightly-x86_64-pc-windows-msvc

Packages
  › @tauri-apps/cli [NPM]: 2.0.0-alpha.3
  › @tauri-apps/api [NPM]: 2.0.0-alpha.1
  › tauri [RUST]: 2.0.0-alpha.4 (no manifest),
  › tauri-build [RUST]: 2.0.0-alpha.2 (no manifest),
  › tao [RUST]: 0.18.1 (no manifest),
  › wry [RUST]: 0.27.0 (no manifest),

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

App directory structure
  ├─ dist
  ├─ node_modules
  ├─ public
  ├─ src
  └─ src-tauri

Stack trace

No response

Additional context

No response

@Berrysoft Berrysoft added status: needs triage This issue needs to triage, applied to new issues type: bug labels Mar 29, 2023
@amrbashir
Copy link
Member

It is explained here https://github.com/tauri-apps/tauri/blob/next/tooling/cli/src/mobile/init.rs#L61-L70 but I agree that it is not very cross-platform at all.

@amrbashir
Copy link
Member

A PR is up, but .cargo folder will still be created because we need to create a libgcc.a file there

@Berrysoft
Copy link
Contributor Author

Berrysoft commented Mar 29, 2023

@amrbashir The cargo config is also created for ios projects. Would you consider removing it too?

@amrbashir
Copy link
Member

The PR removes it from both

@Berrysoft
Copy link
Contributor Author

I misunderstood the removal from the commit message🤣Thank you!

By the way, what is libgcc.a for? Is there some documents about that?

@amrbashir
Copy link
Member

I misunderstood the removal from the commit message🤣Thank you!

yeah that's my fault

By the way, what is libgcc.a for? Is there some documents about that?

https://github.com/tauri-apps/tauri-mobile/blob/f9d809519ca1efbbde996b3e906fd85983c8609c/src/android/target.rs#L235-L236

@Berrysoft
Copy link
Contributor Author

However I've found this: rust-lang/rust#85806

It seems that rust is not going to find libgcc.a nowadays.

@amrbashir
Copy link
Member

At the time for using that workaround, rust-lang/rust#85806 wasn't enough but now I have tested and it works without it so I will remove the workaround as well.

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
Status: 📬Proposal
Development

No branches or pull requests

2 participants