Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-fast: Use target/ if available #3610

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/cmd-build-fast
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional:

Suggested change
if test -d target; then
if test -f Cargo.toml && test -d target; then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but will roll this into a followup to avoid a whole CI cycle just for this

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")"
Expand Down
Loading