Comments (11)
cargo-bloat
simply parses the resulting binary. And not by itself, but using the goblin crate. So if goblin
supports binary format of the desired platform - it should work.
But currently cargo-bloat
is limited to Linux and macOS.
Also, there are no limitations on no_std
.
from cargo-bloat.
I see, then it might be a different issue? I'm on macOS. Asking bc cargo install cargo-bloat
failed with:
Updating registry `https://github.com/rust-lang/crates.io-index`
Installing cargo-bloat v0.2.2
Compiling semver-parser v0.7.0
Compiling percent-encoding v1.0.1
Compiling pkg-config v0.3.9
Compiling fs2 v0.4.3
Compiling utf8-ranges v1.0.0
Compiling winapi v0.2.8
Compiling unicode-normalization v0.1.5
Compiling hex v0.3.1
error[E0463]: can't find crate for `std`
error[E0463]: can't find crate for `std`
|
|
= note: the `thumbv7m-none-eabi` target may not be installed
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0463"
If you want more information on this error, try using "rustc --explain E0463"
error[E0463]: can't find crate for `std`
|
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0463"
error[E0463]: can't find crate for `std`
|
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0463"
error: Could not compile `hex`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `percent-encoding`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
error: Could not compile `fs2`.
warning: build failed, waiting for other jobs to finish...
If you want more information on this error, try using "rustc --explain E0463"
error: Could not compile `utf8-ranges`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `semver-parser`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0463"
error: Could not compile `unicode-normalization`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `thumbv7m-none-eabi` target may not be installed
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0463"
error: Could not compile `winapi`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-bloat v0.2.2`, intermediate artifacts can be found at `/var/folders/gy/m7gsskyn30vc5qshtz0glx140000gn/T/cargo-install.MYvWgKstqNkL`
Caused by:
build failed
from cargo-bloat.
Just tested, it works for regular macOS builds. I suspect its due to xargo?
from cargo-bloat.
cargo-bloat
depends on cargo
. So the target also should support cargo
. And cargo
works only on desktop.
from cargo-bloat.
Technically, I can make cargo-bloat
core as a stand-alone application with an optional cargo
integration, so you can use it in any way you want. At least as long as goblin
supports desired executable format.
from cargo-bloat.
I wasn't suggesting that it works on an embedded device. IMHO xargo functionality will some day be available in cargo itself, so supporting xargo as a special use case is probably not worth it.
If there was a binary independent of cargo that would probably solve my issue. Btw., very nice tool!
from cargo-bloat.
Uhm, not sure what I'm missing here; until recently it worked just fine with xargo
:
File .text Size Name
0.1% 8.4% 362B [40 Others]
0.2% 20.4% 884B RTC0
0.2% 16.7% 724B core::fmt::Formatter::pad_integral
0.2% 13.5% 584B main
0.1% 8.7% 376B core::fmt::write
0.1% 5.5% 236B compiler_builtins::int::udiv::__udivsi3
0.1% 5.0% 216B core::fmt::num::<impl core::fmt::Display for usize>::fmt
0.1% 5.0% 216B core::fmt::num::<impl core::fmt::Display for u32>::fmt
0.1% 4.7% 202B core::fmt::Formatter::pad_integral::{{closure}}
0.0% 3.4% 148B <core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_char
0.0% 2.3% 100B core::fmt::Formatter::getcount
0.0% 1.5% 64B __aeabi_memset4
0.0% 1.5% 64B cortex_m_rt::reset_handler
0.0% 1.0% 44B <nrf51_hal::serial::Tx<UART> as core::fmt::Write>::write_str
0.0% 0.9% 40B <core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_fmt
0.0% 0.3% 14B __aeabi_memset
0.0% 0.3% 14B <core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_str
0.0% 0.3% 12B __aeabi_memclr4
0.0% 0.2% 10B __aeabi_uidiv
0.0% 0.2% 10B core::result::unwrap_failed
0.0% 0.2% 10B core::result::unwrap_failed
1.2% 100.0% 4.2KiB .text section size, the file size is 357.4KiB
The latest nightlies seem to have broken it, though:
# xargo bloat -v --release --example i2c_haldriver_printmagserial
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ RUSTFLAGS="-C link-arg=-Tlink.x -C linker=arm-none-eabi-ld -Z linker-flavor=ld --sysroot /Users/egger/.xargo"
+ "cargo" "bloat" "-v" "--release" "--example" "i2c_haldriver_printmagserial"
error: Invalid arguments.
Usage: cargo bloat [options]
from cargo-bloat.
@therealprof Cool. Thanks. I never used xargo
by myself.
from cargo-bloat.
@RazrFalcon I've to thank you for creating such an incredible and for me indispensable tool!
from cargo-bloat.
@therealprof Thanks! But all the glory goes to the goblin crate.
from cargo-bloat.
Closing in favor to #18
from cargo-bloat.
Related Issues (20)
- Doesn't work with custom registries HOT 2
- Default test binary HOT 3
- --release flag fails HOT 4
- Add an option to sort output by crate/fn name instead of size HOT 1
- Discrepancy in reported `.text` size: `cargo bloat` vs GNU Binuils `size` HOT 3
- Cargo bloat doesn't forward compiler errors on build failure HOT 5
- don't suggest -n if all data is shown HOT 1
- Support custom profiles HOT 2
- How do I use cargo bloat with `-Zbuild-std`? HOT 7
- Incorrect target resolving
- Cargo bloaty reports only a tiny portion of the whole binary HOT 5
- How to examine other sections in the `.so` file? HOT 4
- Error: parsing failed cause 'section .symtab is missing'. HOT 10
- Detect `strip = true` in Cargo.toml HOT 3
- It "hangs" sometimes HOT 18
- Total time using cargo bloat --time? HOT 2
- missing releases on github HOT 2
- Info on the Size Calculation HOT 5
- FR: Cargo bloat should allow multiple `--features=foo` flags and merge them HOT 1
- [Q&A] Is there a tool or plugin that uses `cargo bloat` information to point at duplication due to monomorphization? HOT 2
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 cargo-bloat.