File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414set -euo pipefail
1515
1616SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
17- WORKSPACE_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
17+ WORKSPACE_ROOT=" ${WORKSPACE_ROOT :- $ (cd " $SCRIPT_DIR /.." && pwd)} "
1818
1919ARCH=" $( uname -m | sed ' s/arm64/aarch64/' ) "
2020OS=" $( uname -s) "
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ set -euo pipefail
1010
1111SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
1212REPO_ROOT=" $( cd " $SCRIPT_DIR /.." && pwd) "
13+ BUILD_SCRIPT=" $SCRIPT_DIR /build-size-optimized.sh"
1314
1415BASE_REF=" "
1516HEAD_REF=" "
@@ -49,10 +50,13 @@ build_ref() {
4950 git -C " $REPO_ROOT " worktree add --detach " $worktree " " $ref " 2>&1 | sed ' s/^/ /' >&2
5051
5152 # cargo writes to stderr; wc -c is the only stdout line.
53+ # Always use the script from the current checkout (base may not have it).
54+ # Override WORKSPACE_ROOT so the script builds the worktree, not itself.
5255 # Point CARGO_TARGET_DIR at the main worktree so both builds share the cache.
5356 # Redirect build stderr → our stderr so CI logs show progress.
5457 CARGO_TARGET_DIR=" $REPO_ROOT /target" \
55- bash " $worktree /size-benchmark/build-size-optimized.sh" 2>&3
58+ WORKSPACE_ROOT=" $worktree " \
59+ bash " $BUILD_SCRIPT " 2>&3
5660 # (stdout = byte count, captured by the caller via $())
5761
5862 git -C " $REPO_ROOT " worktree remove --force " $worktree " 2> /dev/null || true
You can’t perform that action at this time.
0 commit comments