Giter VIP home page Giter VIP logo

Comments (8)

BenjaminRi avatar BenjaminRi commented on August 27, 2024 9

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.

petrochenkov avatar petrochenkov commented on August 27, 2024

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.

koriwi avatar koriwi commented on August 27, 2024

i just downgraded to 1.60 because i wasted 2.5 days with this cross compilation problem

from winres.

getreu avatar getreu commented on August 27, 2024

I probably run into the same problem with my tp-note/build.rs.
Could you please publish a (minor) version upgrade?

from winres.

tay64 avatar tay64 commented on August 27, 2024

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.

BenjaminRi avatar BenjaminRi commented on August 27, 2024

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.

 avatar commented on August 27, 2024

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.

BenjaminRi avatar BenjaminRi commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.