Skip to content

Commit

Permalink
chore: a separate target directory for runtimetest
Browse files Browse the repository at this point in the history
building static-linked runtimetest requires additional RUSTFLAGS env
var. Unfortunately, the additional env var invalids the build cache,
leading cargo rebuilding everytime.

See rust-lang/cargo#8716

A temporary solution is to build runtimetest in a seperate
`runtimetest-target` directory.

Signed-off-by: Tony Duan <tony84727@gmail.com>
  • Loading branch information
tony84727 committed Jun 14, 2022
1 parent 75d9053 commit b7447a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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=${ROOT}/runtimetest-target RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest

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

Expand Down

0 comments on commit b7447a9

Please sign in to comment.