Skip to content

Commit 0fb028a

Browse files
committed
[temp] probe: termux-docker pass with /bin -> /system/bin, stage timings
1 parent 9bda238 commit 0fb028a

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎.github/probe/termux_docker.sh‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,27 @@ start=$(date +%s)
2525
docker run --rm --privileged \
2626
-v "$DL:/mnt/dl:ro" -v "$LOGS:/mnt/logs" \
2727
termux/termux-docker:aarch64 bash /mnt/dl/termux_inner.sh 2>&1 | tee "$LOGS/container.log"
28-
say "- container exit: ${PIPESTATUS[0]}, wall: $(( $(date +%s) - start )) s"
28+
say "- pass 1 (image as published) exit: ${PIPESTATUS[0]}, wall: $(( $(date +%s) - start )) s"
29+
say "- /bin/sh in the image: $(docker run --rm --entrypoint /system/bin/sh termux/termux-docker:aarch64 -c 'ls -ld /bin /bin/sh 2>&1' | tr '\n' ' ')"
30+
31+
# Pass 2: Android 10+ devices have /bin -> /system/bin; the image does not.
32+
mkdir -p "$LOGS/pass2"; chmod 777 "$LOGS/pass2"
33+
start=$(date +%s)
34+
docker run --rm --privileged --entrypoint /system/bin/sh \
35+
-v "$DL:/mnt/dl:ro" -v "$LOGS/pass2:/mnt/logs" \
36+
termux/termux-docker:aarch64 -c 'ln -s /system/bin /bin; ls -ld /bin; exec /entrypoint.sh bash /mnt/dl/termux_inner.sh' \
37+
2>&1 | tee "$LOGS/pass2/container.log"
38+
say "- pass 2 (/bin -> /system/bin) exit: ${PIPESTATUS[0]}, wall: $(( $(date +%s) - start )) s"
2939

3040
say '### environment'
3141
say '```'
32-
grep -E "^(ENV|UNAME|ID|HARDLINK|XLINGS|MCPP)" "$LOGS/container.log" | head -40 >> "$S"
33-
say '```'
34-
say '### first run: key lines'
35-
say '```'
36-
grep -E 'First run|Resolving|Installing|Downloading|Planning|error|warning|hint|Finished|TIMING|glibc|llvm|musl' \
37-
"$LOGS/container.log" | grep -v '^\s*$' | head -60 >> "$S"
42+
for f in "$LOGS/container.log" "$LOGS/pass2/container.log"; do echo "-- $f" >> "$S"; grep -E "^(ENV|UNAME|ID|HARDLINK|XLINGS|MCPP|STAGE|TIMING)" "$f" | head -60 >> "$S"; done
3843
say '```'
39-
say '### plan stage timings'
44+
for pass in . pass2; do
45+
say "### first run ($pass): key lines"
4046
say '```'
41-
grep -h 'build/stage' "$LOGS"/mcpp-log/*.log 2>/dev/null | tail -40 >> "$S"
47+
grep -E 'First run|Resolving|Resolved|Installing|Downloading|Planning|error|warning|hint|Finished|TIMING|glibc|llvm|musl|Can.t create' \
48+
"$LOGS/$pass/container.log" | grep -v '^\s*$' | head -70 >> "$S"
4249
say '```'
50+
done
4351
exit 0

‎.github/probe/termux_inner.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ echo "TIMING run: $(( $(date +%s) - t0 )) s"
5959

6060
mkdir -p "$OUT/mcpp-log"
6161
cp -r "$HOME"/.mcpp/log/. "$OUT/mcpp-log/" 2>/dev/null
62+
cp -r "$(dirname "$(dirname "$MCPP")")"/log/. "$OUT/mcpp-log/" 2>/dev/null
63+
grep -h 'build/stage' "$OUT"/mcpp-log/*.log 2>/dev/null | tail -30 | sed 's/^/STAGE /'
6264
cp "$TMPDIR"/mcpp-xlings-*.stderr "$OUT/" 2>/dev/null
6365
ls "$HOME"/.mcpp/registry/logs/hooks/ 2>/dev/null | head
6466
cp -r "$HOME"/.mcpp/registry/logs "$OUT/registry-logs" 2>/dev/null

0 commit comments

Comments
 (0)