Skip to content

Commit b7447a9

Browse files
committed
chore: a separate target directory for runtimetest
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>
1 parent 75d9053 commit b7447a9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.idea/
33

44
**/target
5+
/runtimetest-target
56
.vagrant/
67

78
tags

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ OUTPUT=${output:-$ROOT/bin}
3636

3737
cargo build --target ${TARGET} ${OPTION} --bin youki
3838
cargo build --target ${TARGET} ${OPTION} --bin integration_test
39-
RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest
39+
CARGO_TARGET_DIR=${ROOT}/runtimetest-target RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest
4040

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

0 commit comments

Comments
 (0)