From c1aa145ec1602f4156aa9bcaacd425668b8a6c42 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 13 Sep 2023 13:14:48 -0400 Subject: [PATCH] build-fast: Use target/ if available This avoids my IDE from transiently seeing a ton of newly added files. Same motivation as e.g. https://github.com/coreos/cargo-vendor-filterer/pull/48/commits/aa4a3669704cf491c92158a354ed87156011d493 --- src/cmd-build-fast | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cmd-build-fast b/src/cmd-build-fast index 05f1595b3a..e2e914ea17 100755 --- a/src/cmd-build-fast +++ b/src/cmd-build-fast @@ -90,16 +90,22 @@ echo "Basing on previous build: ${previous_build:-none}" if [ -n "${projectdir}" ]; then cd "${projectdir}" - rm _install -rf + instroot=_install + # Rust projects will already have a handy directory for build artifacts + if test -d target; then + instroot=target/cosa-build-fast + fi + instroot=$(pwd)/${instroot} # Must be absolute for `make` + rm "${instroot}" -rf make - make install DESTDIR="$(pwd)/_install" + make install DESTDIR="${instroot}" fastref=cosa/fastbuild/"$(basename "${projectdir}")" version="$(git describe --tags --abbrev=10)" if ! git diff --quiet; then version="${version}+dirty" fi outdir=${projectdir}/.cosa - rootfsoverrides="${projectdir}/_install" + rootfsoverrides="${instroot}" else fastref=cosa/fastbuild/${name} version="$(date +"%s")"