Skip to content

Commit

Permalink
Merge pull request #981 from tony84727/chore/build-cache
Browse files Browse the repository at this point in the history
chore: a separate target directory for runtimetest
  • Loading branch information
utam0k authored Jun 15, 2022
2 parents 7fe8f0c + 6e8f869 commit a43ed22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea/

**/target
/runtimetest-target
.vagrant/

tags
Expand Down
6 changes: 4 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ usage_exit() {

VERSION=debug
TARGET=x86_64-unknown-linux-gnu
RUNTIMETEST_TARGET="$ROOT/runtimetest-target"
while getopts ro:h OPT; do
case $OPT in
o) output=${OPTARG}
Expand All @@ -36,8 +37,9 @@ OUTPUT=${output:-$ROOT/bin}

cargo build --target ${TARGET} ${OPTION} --bin youki
cargo build --target ${TARGET} ${OPTION} --bin integration_test
RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest
CARGO_TARGET_DIR=${RUNTIMETEST_TARGET} RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest

mv ${ROOT}/target/${TARGET}/${VERSION}/{youki,integration_test,runtimetest} ${OUTPUT}/
mv ${ROOT}/target/${TARGET}/${VERSION}/{youki,integration_test} ${OUTPUT}/
mv ${RUNTIMETEST_TARGET}/${TARGET}/${VERSION}/runtimetest ${OUTPUT}/

exit 0

0 comments on commit a43ed22

Please sign in to comment.