# rustlocal/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. By default, if this package is built, it: (a) doesn't delete the "rustlocal" package tree (b) doesn't delete previously cached build objects (c) downloads sources for some Rust libraries and programs un- less they're already present (d) builds some Rust libraries and programs in the "rustlocal" package tree To force actual as opposed to cached compiles, delete the following cache directory tree first: $PRODTREE/rustlocal/rusthome/sccache/ To force a full rebuild from scratch, delete the following package directory tree instead: $PRODTREE/rustlocal/ This will both download updated sources, in most but not all cases, and rebuild from scratch. If you do this, you'll need to rebuild the following packages in the order shown here: rustlocal rustmore maturin py-polars polars-cli For a rebuild from scratch, Internet access is required. The results of this type of build are unpredictable. This type of build may very well fail. #--------------------------------------------------------------------- 2. The following procedure: export RUSTOFFLINE=true makelac rustlocal --force rebuilds the same libraries and programs using the same sources. It shouldn't access the Internet. This mode requires that a full build from scratch have been done previously. Cached build objects may be used unless the following cache tree is deleted first: $PRODTREE/rustlocal/rusthome/sccache/ #--------------------------------------------------------------------- 3. In the default mode, this package requires Internet access to bui- ld. Builds are also non-repeatable; i.e., the results may be differ- ent each time and builds may not work at all. This is one of relatively few packages of this type that Laclin sup- ports. #--------------------------------------------------------------------- 4. This package doesn't modify the Rust compiler directory tree at: $PRODTREE/rustc/ #--------------------------------------------------------------------- [buildtimes] 01.33 hours (or 080.07 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - using "sscache" with a fully populated cache 01.37 hours (or 082.13 minutes) - ThinkPad W530 i7 4x2 32GB RAM - us- ing "sscache" with a fully populated cache 01.97 hours (or 117.93 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - using "sscache" from scratch without population 02.59 hours (or 155.15 minutes) - ThinkPad W530 i7 4x2 32GB RAM - us- ing "sccache" from scratch without population 03.01 hours (or 180.82 minutes) - ThinkPad W530 i7 4x2 32GB RAM - w/o "sccache" Obsolete times: (no longer applicable) 00.10 hours (or 006.18 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 00.16 hours (or 009.87 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM 00.18 hours (or 011.00 minutes) - OpenVZ 1x4 CPU 4GB RAM 00.19 hours (or 011.60 minutes) - ThinkPad W530 i7 4x2 32GB RAM ---------------------------------------------------------------------- [settings] altpkg = yes defer = glibc64 configure = none purge = no strip = no unpack = none setpaths = rustc #--------------------------------------------------------------------- [depends] rustc #--------------------------------------------------------------------- [build] HERE=`pwd` BINDIR=$PKGDIR_PROD/bin TGTDIR=$HERE/target RUSTOFFLINE=$RUSTOFFLINE rm -fr $TGTDIR mkdir -p $BINDIR $TGTDIR cd $PKGDIR_PROD pkill --full /bin/sccache || true OFFLINESW="" if [ "@$RUSTOFFLINE" == "@1" ]; then RUSTOFFLINE=true ; fi if [ "@$RUSTOFFLINE" == "@yes" ]; then RUSTOFFLINE=true ; fi if [ "@$RUSTOFFLINE" == "@true" ]; then OFFLINESW=--offline ; fi mkdir -p rusthome cd rusthome export HOME=`pwd` export CARGO_TARGET_DIR=$TGTDIR #--------------------------------------------------------------------- # This part took about 12 minutes in one test of a build from scratch. SC1=$HOME/.cargo/bin/sccache SC2=$BINDIR/sccache if [ \! -f $SC2 ]; then if [ -f $SC1 ]; then rm -fr $SC2 cp -p $SC1 $SC2 fi fi if [ -f $SC2 ]; then echo `date` ==== sccache already exists export RUSTC_WRAPPER=$SC2 echo `date` ==== RUSTC_WRAPPER is $RUSTC_WRAPPER fi export SCCACHE_DIR=$HOME/sccache mkdir -p $SCCACHE_DIR echo SCCACHE_DIR is $SCCACHE_DIR export SCCACHE_CACHE_SIZE="10G" echo ==== `date` build of sccache started cd $HOME rm -fr sccache-git* deco $PKGDIR_SPECIAL/sccache-git*.tar* cd sccache-git* if [ "@$RUSTOFFLINE" \!= "@true" ]; then echo ==== `date` \ git fetch git fetch fi echo ==== `date` \ cargo build $OFFLINESW --release cargo build $OFFLINESW --release pkill --full bin/sccache || true mv $CARGO_TARGET_DIR/release/sccache $BINDIR/ cd $HOME rm -fr sccache-git* export RUSTC_WRAPPER=$BINDIR/sccache echo `date` ==== RUSTC_WRAPPER is $RUSTC_WRAPPER strip $RUSTC_WRAPPER ls -l $RUSTC_WRAPPER echo ==== `date` build of sccache done #--------------------------------------------------------------------- PKGLIST=" aardvark-dns alacritty atuin bandwhich bartib bat blades choose cpc crabz csvlens difftastic diskonaut dtool dua exa fd-find fend fselect git-absorb gitoxide grex hexyl hyperfine hurl jaq jless jql just legdur lemmeknow lfs lurk melody miniserve monolith mprocs netavark netscanner onefetch pastel procs qsv rav1e resvg ripgrep rmesg ruplacer rustscan sd skim starship systeroid tealdeer tokei trippy xcp xh xsv ytop zellij zoxide " for pkg in $PKGLIST; do if [ \! -f $RUSTC_WRAPPER ]; then echo ==== `date` Error-0266: Disappeared: $RUSTC_WRAPPER exit 1 fi echo ==== `date` \ cargo install $OFFLINESW --force $pkg cargo install $OFFLINESW --force $pkg \ || echo $pkg failed done if [ \! -f $RUSTC_WRAPPER ]; then echo ==== `date` Error-0277: Disappeared: $RUSTC_WRAPPER exit 1 fi badlinks -d $HOME/.cargo/bin/ || true rm -fr $HOME/.cargo/bin/sccache strip $HOME/.cargo/bin/* || true upx --lzma $HOME/.cargo/bin/* || true ln -nsf $HOME/.cargo/bin/* $BINDIR/ badlinks -d $BINDIR/ || true if [ \! -f $RUSTC_WRAPPER ]; then echo ==== `date` Error-0287: Disappeared: $RUSTC_WRAPPER exit 1 fi echo ==== `date` instreplinks -d $BINDIR/ /usr/bin/ instreplinks -d $BINDIR/ /usr/bin/ rm -fr $CARGO_TARGET_DIR #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = tbd url_lfs = tbd url_tarball = n/a # See "technotes" in "cfg" file #--------------------------------------------------------------------- [history] 220911 Added package. Started with 220911. 230218 Updated to 230218 240331 Updated to 240331 240728 Reworked package 240728 Added a number of programs 241125 Updated to latest sources 241125 Added a number of programs