Skip to content

Commit 45db4ae

Browse files
authored
Merge pull request #19018 from github/redsun82/rust-ql-test-log-fix
Rust: fix `qltest.sh` for some versions of macOS
2 parents d23c8fd + 8cc39af commit 45db4ae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

rust/tools/qltest.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ set -eu
44
set -o pipefail
55

66
export RUST_BACKTRACE=full
7-
QLTEST_LOG="$CODEQL_EXTRACTOR_RUST_LOG_DIR"/qltest.log
8-
mkdir -p "$CODEQL_EXTRACTOR_RUST_SCRATCH_DIR"
9-
TMP_OUT="$(mktemp --tmpdir="$CODEQL_EXTRACTOR_RUST_SCRATCH_DIR" qltest-XXXXXX.log))"
10-
trap 'rm -f "$TMP_OUT"' EXIT
7+
QLTEST_LOG="$CODEQL_EXTRACTOR_RUST_LOG_DIR/qltest.log"
8+
QLTEST_COLORED_LOG="$CODEQL_EXTRACTOR_RUST_SCRATCH_DIR/qltest.log"
9+
dirname "$QLTEST_LOG" "$QLTEST_COLORED_LOG" | xargs mkdir -p
1110
# put full-color output on the side, but remove the color codes from the log file
1211
# also, print (colored) output only in case of failure
1312
if ! "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" \
1413
--qltest \
1514
--logging-verbosity=progress+ \
1615
2>&1 \
17-
| tee "$TMP_OUT" \
16+
| tee "$QLTEST_COLORED_LOG" \
1817
| sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' \
1918
> "$QLTEST_LOG"; then
20-
cat "$TMP_OUT"
19+
cat "$QLTEST_COLORED_LOG"
2120
exit 1
2221
fi

0 commit comments

Comments
 (0)