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] Build with x86_64-pc-windows-gnu #4319

Closed
ZodiacWind opened this issue Jun 11, 2022 · 7 comments
Closed

[bug] Build with x86_64-pc-windows-gnu #4319

ZodiacWind opened this issue Jun 11, 2022 · 7 comments

Comments

@ZodiacWind
Copy link

Describe the bug

As my app denpends on some gnu library, I have to use gnu toolchain to build the app. I found two bugs during the process:

  1. The app built with gnu toolchain in size is much larger than the one built with msvc toolchain, 58.8MB vs 18.5MB;
  2. The app built with gnu toolchain cannot work due to WebView2Loader.dll not found error,and as a workround, I have to copy the dll from the crate to the app side;
  3. The app doesn't have a logo, while the msvc one has.

Could anyone help? Or what's the future plan about tauri with gnu toolchain on windows?

Thanks.

Reproduction

No response

Expected behavior

No response

Platform and versions

Environment
  › OS: Windows 10.0.25131 X64
  › Webview2: 101.0.1210.53
  › MSVC:
      - Visual Studio Enterprise 2022
  › Node.js: 16.14.2
  › npm: 8.5.0
  › pnpm: Not installed!
  › yarn: 1.22.17
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.13
  › @tauri-apps/api [NPM]: 1.0.0-rc.5
  › tauri [RUST]: 1.0.0-rc.14,
  › tauri-build [RUST]: 1.0.0-rc.12,
  › tao [RUST]: 0.9.1,
  › wry [RUST]: 0.17.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http://localhost:3000/
  › framework: Svelte
  › bundler: Rollup

Stack trace

No response

Additional context

No response

@lucasfernog
Copy link
Member

We don't really support the gnu toolchain on Windows, we don't really test it, so there's some stuff that you need to do manually. If you copy the DLL to the target/release folder Tauri will automatically add it to your app installer, but i'm not sure about the logo.

@ZodiacWind
Copy link
Author

ZodiacWind commented Jun 11, 2022

We don't really support the gnu toolchain on Windows, we don't really test it, so there's some stuff that you need to do manually. If you copy the DLL to the target/release folder Tauri will automatically add it to your app installer, but i'm not sure about the logo.

Thank you. Got it. About the logo, I guess that maybe it's related to different ico format requirements of Windows and Linu, but I don't know how to test it.

@ZodiacWind
Copy link
Author

We don't really support the gnu toolchain on Windows, we don't really test it, so there's some stuff that you need to do manually. If you copy the DLL to the target/release folder Tauri will automatically add it to your app installer, but i'm not sure about the logo.

Is there anyway that I can specify the logo file by myself?

@lucasfernog
Copy link
Member

lucasfernog commented Jun 12, 2022

@ZodiacWind I found the issue for the logo, we need mxre/winres#41

For now you can add this to your Cargo.toml:

[patch.crates-io]
winres = { git = "https://github.com/Nilstrieb/winres", branch = "linking-flags" }

@ZodiacWind
Copy link
Author

ZodiacWind commented Jun 12, 2022

@lucasfernog Thank you so much. I will have a try.

Update:

I added

[patch.crates-io]
winres = { git = "https://github.com/Nilstrieb/winres", branch = "linking-flags" }

in my Cargo.toml. But my Cargo.lock told me that path unused:

[[patch.unused]]
name = "winres"
version = "0.1.11"
source = "git+https://github.com/Nilstrieb/winres?branch=linking-flags#c839134b5f78d7dd0f5c8211ec6c7b675b0026fc"

Should I build tauri with the patch by myself instead of using the released version?

Further update:

I run cargo update again, the [[patch.unused]] in Cargo.lock disappearedm and the winres is replaced by the patched one but with version "0.1.11". Then I build again, it works.

[[package]]
name = "winres"
version = "0.1.11"
source = "git+https://github.com/Nilstrieb/winres?branch=linking-flags#c839134b5f78d7dd0f5c8211ec6c7b675b0026fc"
dependencies = [
 "toml",
 "version_check",
]

It's my first time to use patch. All works like a mystery. Could you tell me why? I really appreciate it.

@lucasfernog
Copy link
Member

The patch is a way to override a dependency, changing winres to use the git repo instead of the published crate. It was unused before running cargo update probably because you were using an outdated winres, so Cargo was blocking the patch from applying. You can read more about it here: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html

@ZodiacWind
Copy link
Author

The patch is a way to override a dependency, changing winres to use the git repo instead of the published crate. It was unused before running cargo update probably because you were using an outdated winres, so Cargo was blocking the patch from applying. You can read more about it here: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html

Got it. Thank you very much. 😄

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

No branches or pull requests

2 participants