Giter VIP home page Giter VIP logo

Comments (11)

RazrFalcon avatar RazrFalcon commented on July 22, 2024

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.

MrBuddyCasino avatar MrBuddyCasino commented on July 22, 2024

I see, then it might be a different issue? I'm on macOS. Asking bc cargo install cargo-bloatfailed 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.

MrBuddyCasino avatar MrBuddyCasino commented on July 22, 2024

Just tested, it works for regular macOS builds. I suspect its due to xargo?

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

cargo-bloat depends on cargo. So the target also should support cargo. And cargo works only on desktop.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

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.

MrBuddyCasino avatar MrBuddyCasino commented on July 22, 2024

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.

therealprof avatar therealprof commented on July 22, 2024

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.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

@therealprof Cool. Thanks. I never used xargo by myself.

from cargo-bloat.

therealprof avatar therealprof commented on July 22, 2024

@RazrFalcon I've to thank you for creating such an incredible and for me indispensable tool!

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

@therealprof Thanks! But all the glory goes to the goblin crate.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 22, 2024

Closing in favor to #18

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.