0xSim,
@0xSim@hachyderm.io avatar

Love , 8GB of dependencies to build a 2.8MB executable :|

0xSim,
@0xSim@hachyderm.io avatar
rodhlann,
@rodhlann@hachyderm.io avatar

@0xSim I just had to go through a similar exercise with my node_modules! Though I wasn't so clever... Thanks for the tip :apusheencomputer:

0xSim,
@0xSim@hachyderm.io avatar

@rodhlann If you can, I recommend pnpm (instead of npm) to manage Node dependencies. It creates symlinks to deduplicate packages
https://pnpm.io/

rodhlann,
@rodhlann@hachyderm.io avatar

@0xSim I've been meaning to try this out! Haven't prioritized it yet, due to laziness, though I've heard it's specifically useful for people with limited storage.

mo8it,
@mo8it@fosstodon.org avatar

@0xSim The code of dependencies is in ~/.cargo/registry/src

You probably mean the target directory. This is the build directory where things are cached and so on. Its size is irrelevant.

0xSim,
@0xSim@hachyderm.io avatar

@mo8it oh I know the size of the target dir is unrelated to the final build size, but still. 8GB of cache is absolutely massive, especially when this cache isn't even shared among projects.

cecton,
@cecton@hachyderm.io avatar

@0xSim @mo8it tbf disk space isn't really an issue nowadays. Only the duration of the build really matters to me

I remember in the past I had JS projects that were probably smaller in size but the build time was atrocious, making development a real pain. And even back then disk space isn't just really an issue (unless it impacts the final distributable of course)

0xSim,
@0xSim@hachyderm.io avatar

@cecton For JS I now use pnpm and esbuild when possible, those 2 tools solved the disk space and compilation time issues. Before that, the node_modules folder was a source of jokes and memes, but it's nothing compared to rust's target folder 😅

cecton,
@cecton@hachyderm.io avatar

@0xSim good to know in case I need it!

cobratbq,

@0xSim is that with full debug builds?

0xSim,
@0xSim@hachyderm.io avatar

@cobratbq Yup. Actually, the debug takes 7GB, and the release "only" 1GB

cobratbq,

@0xSim still seems rather a lot to me. (Not an expert, just surprised.) Is there excessive caching? I get that more dependencies require relatively more overhead, especially if only a small part of a dependency is actually used. But still.

0xSim,
@0xSim@hachyderm.io avatar

@cobratbq it's a small Tauri project, and I cloned it yesterday. So it's not like there is a lot of leftovers after months of work and rebuilds 🤷‍♂️

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • PowerRangers
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • tacticalgear
  • everett
  • slotface
  • khanakhh
  • mdbf
  • rosin
  • kavyap
  • GTA5RPClips
  • ngwrru68w68
  • InstantRegret
  • provamag3
  • Durango
  • thenastyranch
  • cubers
  • osvaldo12
  • ethstaker
  • modclub
  • normalnudes
  • vwfavf
  • cisconetworking
  • tester
  • Leos
  • anitta
  • megavids
  • All magazines