-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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] Failed to build Tauri application library on GNU toolchain (Windows) #6724
Comments
Just a small heads-up: The gnu toolchain is not officially support in Tauri on Windows, so this may take a little while until it's fixed. And fwiw, here's a relevant issue in a sister-fork of winres: BenjaminRi/winresource#7 And maybe this PR can resolve this issue too: tauri-apps/winres#8, but i didn't have time to look at that pr yet so i'm not sure. Edit: Thanks for the extensive report btw!! |
Oh I get it. I would stick to the MSVC toolchain as of now. And thank you for your contributions and works on Tauri too :) |
Downgrading |
@AlexTMjugador Any particular reason you're using the gnu toolchain on a windows host? Like is there a rust dependency that only works with it for example? I'm asking because we're mostly going with "Only the msvc toolchain is supported" so i'm collecting data to see how far we'll get with that approach :) I'll look into the regression either way, just a bit weird that it worked fine for me locally before i published it so it may take some time. Thanks for reporting the issue btw. |
I'd like to keep using the GNU toolchain to generate Windows executables in my project for several reasons:
My experience using Tauri with the GNU toolchain on Windows has been relatively painless so far compared to the problems I had with MSVC, so I consider this a win, even if Tauri doesn't officially support it yet 😉 Also, Tauri is so close to having perfect GNU toolchain support on Windows that it seems worthwhile from the Tauri project's point of view to support it a bit more, but of course I'm not the right person to decide that.
No problem! ❤️ Thanks to you and your team for providing such an awesome framework for GUI applications. I hope that my reply was insightful, even though it's a bit long-winded 😅 |
Thanks for the throughout response!! In the meantime i figured out why i wasn't able to reproduce it. This line made me think i'd have to do This means that a) i think v0.1.0 of our winres fork only worked because of a bug in my rushed implementation and that b) this may be out of scope for the embed-resource resource crate if i interpret this right: nabijaczleweli/rust-embed-resource#48 (comment). Genuine question: Do you think msvc->gnu is something worth to fix or should we just require the gnu toolchain for the gnu target? Genuine question as i'm not sure if msvc->gnu has many actual use-cases. Your description sounded more like your actual intention is to use the gnu toolchain, and probably use it locally too, not just the target. |
Oh, sure! I didn't want to cross-compile from MSVC to GNU here, that was a mistake from my part. As you can see my CI workflow is pretty complex and it could benefit from some simplification/refactoring, but that's on me. I don't think I'll ever need MSVC -> GNU cross-compiling support. |
Describe the bug
As of a structure of the rust side project in Tauri application changed from single
main.rs
to the separatedlib.rs
andmain.rs
(e.g.tauri/examples/api
), experiencing issues when building application on GNU toolchain (MSVC is fine).Reproduction
examples/api/src-tauri
cargo build
Expected behavior
Build Tauri application library (
src-tauri/src/lib.rs
) without any of errors that related to the library linking modifiers.Platform and versions
Stack trace
Additional context
Here are some tries to build application:
resource
) link modifiersRust native-link-modifiers RFC says,
+bundle
is default for linking static libraries. And this would be lead to set link modifiers on linkresource
library to+bundle
and+whole-archive
.So I tried to set
-bundle
link modiers explicitly on winres/ilb.rs withcargo:rustc-link-lib=static:-bundle,+whole-archive=resource
.And it seems to build without library link issues, enroll resources (icon and metadata) to the app and run without errors .
If
resource
static library have to be linked with+bundle
and+whole-archive
link modifiers, append#![feature(packed_bundled_libs)]
to the top ofsrc-tauri/lib.rs
.This seems to work, but it requires nightly rust toolchain to build.
Related topcis:
The text was updated successfully, but these errors were encountered: