Git Product home page Git Product logo

Comments (6)

sdroege avatar sdroege commented on September 18, 2024 1

Thanks for the update!

from pkg-config-rs.

sdroege avatar sdroege commented on September 18, 2024

Wouldn't the more correct way to deal with this be to add these linker flags to the pkg-config file for these object files?

from pkg-config-rs.

estherlurie avatar estherlurie commented on September 18, 2024

Wouldn't the more correct way to deal with this be to add these linker flags to the pkg-config file for these object files?

That's one solution. My problem is within a large enterprise codebase where I do not have access to modify the many packages and dependencies that I need now and will need over time. With rustc defaulting to +whole-archive for every single library - not just the problematic ones - this leads to a lot of unnecessary code getting linked in.

from pkg-config-rs.

estherlurie avatar estherlurie commented on September 18, 2024

We've also discovered a related issue with rustc that would make this change unusable for now. This section of the compiler ends the link step if any two packages with the same names have modifiers; not if they have different modifiers, but if they have any at all. So if we were able to add linking modifiers in this crate, it would error if any explicit dependencies share a dependency.

from pkg-config-rs.

sdroege avatar sdroege commented on September 18, 2024

How would you like this to work btw? Having API to specify per package, or even per library, linking modifiers? This seems like the wrong place for doing that to me. No other language I'm aware of needs this when consuming pkg-config files :)

from pkg-config-rs.

estherlurie avatar estherlurie commented on September 18, 2024

So actually I think we can close this. It is not an issue with pkg-config but an issue with rustc where cargo test defaults to whole-archive. Thanks for chatting :)

from pkg-config-rs.

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.