# rustc/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. "rustc" is needed to build itself. In general, to build "rustc" 1.N.X, "rustc" "1.[N minus one].X" or "1.N.X" itself should work. For example, to build "rustc" 1.90.0, "rustc" 1.89.0 or "rustc" 1.90.0 should work. If possible, the copy of "rustc" used to build or rebuild "rustc" should be this distro's existing copy of "rustc". In theory, a prebuilt external copy can be installed and might work. In practice, the odds are that it will not work. #--------------------------------------------------------------------- 2. One take-away is that, to update this distro's copy of "rustc" to a particular release, one must update the package from the current re- elease through all intermediate releases. #--------------------------------------------------------------------- 3. "rustc" is presently hidden, to some extent, from the rest of the distro. If a package needs "rustc" to build, the associated "cfg" file should include "rustc" in a "setpaths" line. For example: setpaths = rustc zlib Alternatively, "bash" scripts that need "rustc" for arbitrary opera- tions, not limited to Laclin package builds, can do the following to set things up: . srcpkgpaths rustc zlib #--------------------------------------------------------------------- 4. "rustc" is a heavy package. Additionally, "rustc" updates may be complicated or impossible. Further, the package doesn't support 32-bit distros. "rustc" was added regardless because the package might be needed in the future to build Linux kernels. Additionally, there are numerous CLI tools that are written in Rust. "uv" is one example. #--------------------------------------------------------------------- 5. One "rustc" build issue is that a "rustc" build will only work if a compatible release of "libgit2" is installed. So, this distro's copy of "libgit2" needs to be kept in sync with this distro's copy of "rustc". #--------------------------------------------------------------------- 6. Another "rustc" build issue is that, to build a particular release of "rustc", a particular release of "clang" may be required. For example: "rustc" 1.90.0 seemed to require "clang" 20.X. "rustc" 1.91.0 was buildable using "clang" 21.X. 1.91.0 may or may not have been buildable using "clang" 20.X. #--------------------------------------------------------------------- 7. It's possible to build "rustc" offline. Note: In this distro, most Rust packages [excluding "rustc"] need to be built online initially, but they can then be built offline. #--------------------------------------------------------------------- [buildtimes] 01.47 hours (or 087.93 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - rustc 1.87.0 using clang 20.1. 5 in a build from scratch without existing rustc - 250524 01.55 hours (or 092.93 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - rustc 1.85.0 using existing rustc 1.84.0 - 250112 01.56 hours (or 093.65 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - rustc 1.84.0 using existing rustc 1.83.0 - 250112 01.69 hours (or 101.22 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM - rustc 1.89.0 using clang 20.1. 8 in a build from scratch without existing rustc - 251019 02.03 hours (or 121.62 minutes) - ThinkPad W530 i7 4x2 32GB RAM Obsolete times: 00.89 hours (or 053.42 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM 00.90 hours (or 054.05 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 01.62 hours (or 097.50 minutes) - OpenVZ 1x4 CPU 4GB RAM 01.83 hours (or 109.85 minutes) - ThinkPad W530 i7 4x2 32GB RAM #--------------------------------------------------------------------- [settings] altpkg = yes compiler = clang configure = none defer = glibc64 nosyslinks = yes purge = no tmpsize = 9217M setpaths = libxml2 llvmgcc zlib zstd #--------------------------------------------------------------------- [depends] brotli curl git libgit2 libidn2 libpcap libpsl librtmp libsasl libssh2 libunistring libxml2 nghttp2 openldap openssl python sqlite3 zlib zstd #--------------------------------------------------------------------- [build] clang --version if [ -d $PRODTREE/rustc ]; then . srcpkgpaths rustc else exit 1 fi RUSTHOME=/var/tmp/rusthome rm -fr $RUSTHOME export HOME=$RUSTHOME export CARGO_HOME=$RUSTHOME/.cargo mkdir -p $RUSTHOME $CARGO_HOME unset RUSTHOME SPCLIB=$PKGDIR_PROD/spclib mkdir -p $SPCLIB export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPCLIB sed -e "s@__META_PREFIX__@$PKGDIR_PROD@" \ < $PKGDIR_SPECIAL/config-bootstrap.toml \ > config.toml if [ -f $PKGDIR_PROD/bin/rustc ]; then sed -e 's@^ *# *stage *2 *@@' -i config.toml fi PT="$PRODTREE" LT="-L$PT" # export RUSTFLAGS="-C link-arg=$LT/libffi/lib \ -C link-arg=$LT/glibc/lib \ $LT/libffi/lib \ $LT/glibc/lib \ -C link-arg=-lffi" python3 ./x.py check python3 ./x.py build library --exclude src/tools/miri export LIBSSH2_SYS_USE_PKG_CONFIG=1 DESTDIR=${PWD}/install python3 ./x.py install unset LIBSSH2_SYS_USE_PKG_CONFIG cd install chown -R 0.0 . settreedate . rm -fr $PKGDIR_PROD mkdir -p $PKGDIR_PROD cp -a */pkg/rustc/* $PKGDIR_PROD/ mkdir -p /opt cd /opt rm -fr rustc ln -s $PKGDIR_PROD rustc rm -fr $SPCLIB mkdir -p $SPCLIB cp -a $PRODTREE/libgit2/lib/* $SPCLIB/ #--------------------------------------------------------------------- # 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 = https://static.rust-lang.org/dist/\ rustc-1.91.0-src.tar.xz #--------------------------------------------------------------------- [history] 220902 Added package 220902 Started with 1.60.0 220906 Updated to 1.62.1 230218 Updated to 1.66.1 240331 Updated to 1.76.0 240727 Updated to 1.80.0 241124 Updated to 1.82.0 250111 Updated to 1.83.0 250512 Updated to 1.84.0 250512 Updated to 1.85.0 250524 Updated to 1.87.0 251019 Updated to 1.89.0 260201 Updated to 1.90.0 260201 Updated to 1.91.0