Skip to content

Commit 59e343b

Browse files
committed
Try to also log to terminal, interleaved with cargo output
So the `cc1` calls can also be seen in context. `/dev/tty` is used instead of writing to standard output because standard output is expectd to be redirected and may in some cases even be consulted by code in a build script, whereas we really do want to write to the terminal. This also: - Has the `wrap1` script use `-e` so that it will stop at the first error. No command before the last one should fail. If the `flock` command fails, either due to a lock-related error or due to an error in `tee`, we want to know about it. I should've done this before, but it's more important now that I'm also tee-ing to `/dev/tty`: it's not obvious that this would work on CI. - Tweaks the code style of the `printf` command, to make the command slightly more readable, and make clearer that this is really just being used as a portable alternative to `echo`.
1 parent 90a59f9 commit 59e343b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
- name: Wrap cc1 (and cc1plus if present) to record calls
6868
run: |
6969
cat >/usr/local/bin/wrapper1 <<'EOF'
70-
#!/bin/sh
71-
printf '%s %s\n' "$0" "$*" |
70+
#!/bin/sh -e
71+
printf '%s\n' "$0 $*" |
7272
flock /run/lock/wrapper1.fbd136bd-9b1b-448d-84a9-e18be53ae63c.lock \
73-
tee -a /var/log/wrapper1.log >/dev/null # TODO: Also log to terminal device?
73+
tee -a /var/log/wrapper1.log /dev/tty >/dev/null
7474
exec "$0.orig" "$@"
7575
EOF
7676

0 commit comments

Comments
 (0)