Hi, I've an e-mail (from the Guix distribution) with some information on avoiding double-compilation of Rust dependencies at <https://lists.gnu.org/archive/html/guix-devel/2022-04/msg00236.html>, making building Rust things faster. To avoid cross-posting, please respond to guix-devel@gnu.org if you want to reply (and maybe temporarily subscribe -- traffic seems to be relatively low lately). -- Start of copy of that e-mail -- Hi various distributions packaging rust things, Currently, most (all?) distributions seem to package ‘source-only crates’, which when ‘compiled’, just copy some source code to a location. This works, but the downside is that if both a package X and a package Y depends on rust-Z, then rust-Z will effectively be compiled twice: when building X, but also when building Y. This seems a waste of compilation time to me, so I've been writing a build tool ‘antioxidant’ (*) for the distribution Guix that avoids double compilation, at <https://notabug.org/maximed/cargoless-rust-experiments>). To avoid the double compilation things, antioxidant calls the underlying rustc by itself instead of cargo, and it reads and interprets Cargo.toml by itself instead of letting cargo do that. Currently, it's rather Guix-specific, but in principle it should be possible to turn it in some binary 'antioxidant' that could be used on other distributions as well if someone is interested in that, e.g. something like $ # (not implemented yet!) $ antioxidant configure --prefix=$HOME/extra-software - Lcrate=/usr/lib/crates -L/usr/lib -Lcrate=$HOME/extra- software/lib/crates --features=x,y,z $ antioxidant make $ antioxidant make check $ antioxidant make install DESTDIR=... # this does not install source code, only the compiled crates (*) A ‘build system’, in Guix terminology. Currently, it can succesfully compile 'hexyl', 'sniffglue' and all their dependencies. I'm working on addressing limitations that prevent antioxidant from compiling other binaries (currently trying to make 'agate' and all its dependencies compile). Greetings, Maxime.
Attachment:
signature.asc
Description: This is a digitally signed message part