Comments (8)
In early November 2022, I wrote an email to @mxre with the question whether he could accept PR #41 or give a short feedback on how to proceed. I did not receive an answer.
Hence, with utmost respect for the original work, I forked the repository and created a new crate that is maintained again.
https://github.com/BenjaminRi/winresource
https://crates.io/crates/winresource
Everything is identical, except that this bug is fixed and the name is winresource
. I will also continue to maintain the crate to the best of my ability and available time. Whether you switch to the new crate or use a workaround for the time being is up to you, of course.
from winres.
The drawback is that I think it will not be backwards compatible, it will require Rust 1.61.
You can use https://crates.io/crates/version_check to do it conditionally.
That's better than hacks, at least.
from winres.
i just downgraded to 1.60 because i wasted 2.5 days with this cross compilation problem
from winres.
I probably run into the same problem with my tp-note/build.rs.
Could you please publish a (minor) version upgrade?
from winres.
This also affects Windows/MINGW.
(This issue's title happens to be too narrow, I almost not looked here before submitting a duplicate :) )
[EDIT: deleted some premature conclusions. My attempts to use @rodrigorc's solution 1 as a user-side workaround failed because they conflicted with cargo directives emitted by the unmodified winres
.]
Can confirm that PR #41 (which implements solution 1 on my rust version) fixes the issue for me.
Leaving my ugly user-side workaround here just in case it might work as a stop-gap for someone who cannot use the PR branch:
println!("cargo:rustc-link-arg=-Wl,--whole-archive");
println!("cargo:rustc-link-arg=-Wl,-Bstatic");
println!("cargo:rustc-link-arg=-lresource");
println!("cargo:rustc-link-arg=-Wl,--no-whole-archive");
from winres.
This bug breaks this crate completely for up to date Rust toolchains.
@mxre would it be possible to accept PR #41 and publish the fix on crates.io? The crate silently stops working whenever someone updates their toolchain to Rust 1.61 or higher, leading to unexpected outcomes and troubleshooting for every person who uses it.
from winres.
A temporary solution until the crate gets fixed would be to add @Nilstrieb's repo to Cargo.toml instead:
winres = { git = "https://github.com/Nilstrieb/winres", branch = "linking-flags" }
from winres.
A temporary solution until the crate gets fixed would be to add @Nilstrieb's repo to Cargo.toml instead:
winres = { git = "https://github.com/Nilstrieb/winres", branch = "linking-flags" }
I know. But then you cannot publish it on crates.io. Ultimately, if this bug is not fixed, a fork is required.
from winres.
Related Issues (20)
- Cannot put escaped quotes in resource strings HOT 3
- Be able to set the correct winred.exe name for cross compilation HOT 2
- winres fails to locate correct Windows Kit in my environment
- Changing icon resource doesn't update exe HOT 2
- Null termination of VERSIONINFO strings?
- Adding winres increases binary size HOT 2
- FileDescription is set incorrectly by default
- Default icon id should be 32512 HOT 2
- How about other targets? HOT 1
- gcc error HOT 2
- Newlines in XML attributes cause spaces to be deleted - "side-by-side configuration is incorrect" HOT 1
- Doesn't work for Cargo packages with both a library and binary crate HOT 7
- Adding an icon issues when building from Linux for Windows HOT 10
- cfg may not work in build script HOT 2
- Tests fail, default RC path unknown? HOT 1
- State of Linux->Windows cross compilation HOT 2
- Add a utility for generating a Windows application manifest
- resource.rc file format not recognized HOT 1
- Mangled path arguments passed to cc1.exe and ar.exe by compile_with_toolkit_gnu() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winres.