History

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`.

Eliah Kagan committed 1 year ago

Commit 59e343b1 parent 90a59f91 file · +3 −3Browse files

Unified · Split

.github/workflows/ci.yml+3−3
@@ -67,10 +67,10 @@ jobs: · 66 unmodified lines
67 - name: Wrap cc1 (and cc1plus if present) to record calls67 - name: Wrap cc1 (and cc1plus if present) to record calls
68 run: |68 run: |
69 cat >/usr/local/bin/wrapper1 <<'EOF'69 cat >/usr/local/bin/wrapper1 <<'EOF'
70 #!/bin/sh70 #!/bin/sh -e
71 printf '%s %s\n' "$0" "$*" |71 printf '%s\n' "$0 $*" |
72 flock /run/lock/wrapper1.fbd136bd-9b1b-448d-84a9-e18be53ae63c.lock \72 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
74 exec "$0.orig" "$@"74 exec "$0.orig" "$@"
75 EOF75 EOF
76 76

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t