Giter VIP home page Giter VIP logo

Comments (6)

RazrFalcon avatar RazrFalcon commented on July 22, 2024 2

I just have to support -Z flags. That's it.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

cargo-bloat simply doesn't support -Z options. Not sure how hard it would be to implement them.

As a workaround, you can simply use RUSTFLAGS env.

from cargo-bloat.

drmikehenry avatar drmikehenry commented on July 22, 2024

Yes, I was hoping cargo-bloat could be extended to support passing along nightly cargo options directly. That would fix this case, as well as any future cases of nightly options.

I don't see how to use RUSTFLAGS as a work-around. The -Z build-std flags are for Cargo; they cause Cargo to compile the Rust standard library from source. Isn't RUSTFLAGS for rustc options? I'd looked for a similar environment variable for Cargo, but couldn't find it. I could see a hypothetical CARGOFLAGS being a work-around, though. Am I missing something?

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

I'll see what I can do.

No idea. I haven't used build-std yet.

from cargo-bloat.

drmikehenry avatar drmikehenry commented on July 22, 2024

Thanks :-) Yeah, build-std is pretty new, but it's already very usable. I do have the cargo shim work-around mentioned earlier, so with some awkwardness I can still use cargo-bloat with build-std (which is good, since cargo-bloat has been a very helpful tool in the pursuit of smaller executables).

from cargo-bloat.

tnballo avatar tnballo commented on July 22, 2024

Ran into the same issue, wanted to share my workaround in case it helps. You can add some variation of the following to your .cargo/config.toml (can be project-specific or a global setting):

[unstable]
build-std=["core","std","alloc","proc_macro","panic_abort"]
build-std-features=["panic_immediate_abort"]

Then you can run cargo bloat as normal, and std will be built from source.

More generally, maybe a blurb on using cargo's config.toml should be added to this project's README.md? There's potentially several usecases for which this would be easier to support than additional command line flags.

from cargo-bloat.

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.