-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
129 lines (126 loc) · 4.93 KB
/
Copy pathtermux_ci.yml
File metadata and controls
129 lines (126 loc) · 4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI Termux
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '!**/termux_ci.yml'
- 'cmd/tools/**'
- '!cmd/tools/builders/**.v'
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
- '!**/termux_ci.yml'
- 'cmd/tools/**'
- '!cmd/tools/builders/**.v'
jobs:
termux-build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Build and test in Termux
run: |
set -o xtrace
echo "$PWD"
whoami
touch outside_docker.txt
git log -n4
echo "running docker ..."
docker run --rm --mount type=bind,source=/home/runner/work/v/v,destination=/src -w /src termux/termux-docker:latest bash -c '
set -o xtrace
echo "running inside docker"
whoami
cp -r /src ~/vproject; cd ~/vproject
touch inside_docker.txt
ls -la
echo "previous TERMUX_VERSION: $TERMUX_VERSION"
export TERMUX_VERSION=0.118.3
echo "explicit TERMUX_VERSION: $TERMUX_VERSION"
bash .github/workflows/retry.sh pkg update -y
bash .github/workflows/retry.sh pkg install -y clang libexecinfo libgc libgc-static make git
git log -n4
VFLAGS="-cc cc" make
./v symlink
export PATH="$HOME/.local/bin:/usr/local/bin:$PATH"
v run examples/hello_world.v
v run examples/primes.v
v -e "import os; dump( os.user_os() )"
'
termux-build-arm64-tcc:
# Diagnostic job for vlang/v#27207: reproduces the Termux/AArch64 tcc
# bootstrap failure on a real arm64 runner so we can collect logs without
# local hardware. Allowed to fail until the upstream tcc AArch64 bug is
# resolved.
runs-on: ubuntu-24.04-arm
continue-on-error: true
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- name: Build in Termux (arm64, default tcc)
run: |
set -o xtrace
uname -a
docker run --rm --platform=linux/arm64 --mount type=bind,source=/home/runner/work/v/v,destination=/src -w /src termux/termux-docker:aarch64 bash -c '
set -o xtrace
uname -a
cp -r /src ~/vproject; cd ~/vproject
export TERMUX_VERSION=0.118.3
bash .github/workflows/retry.sh pkg update -y
bash .github/workflows/retry.sh pkg install -y clang libexecinfo libgc libgc-static make git gdb file
git log -n4
ulimit -c unlimited || true
# Explicit `-cc tcc` is required: on Linux arm64 the Makefile
# otherwise injects `-cc "$(CC)"` (see GNUmakefile:149-155) and
# the bundled tcc path would never run — defeating the purpose
# of this diagnostic job for #27207. Capture every invocation
# via -showcc and the full build output to build.log.
set +e
VFLAGS="-cc tcc -showcc -stats" make 2>&1 | tee build.log
rc=${PIPESTATUS[0]}
set -e
echo "make exit code: $rc"
# Always copy the log back to the bind-mounted dir so the runner
# step that uploads the artifact can find it.
cp build.log /src/build.log || true
if [ "$rc" -ne 0 ] || [ ! -x ./v ]; then
echo "===== bootstrap failed; collecting diagnostics ====="
echo "--- tcc binary ---"
ls -la thirdparty/tcc/ 2>/dev/null || true
for t in thirdparty/tcc/tcc.exe thirdparty/tcc/tcc; do
if [ -x "$t" ]; then "$t" -v || true; fi
done
echo "--- last 120 lines of build.log ---"
tail -n 120 build.log || true
echo "--- v1/v2/v file info ---"
file v1 v2 v 2>/dev/null || true
echo "--- last tcc invocations from build.log ---"
grep -E "tcc(\.exe)? " build.log | tail -n10 || true
echo "--- core files (if any) ---"
ls -la core* 2>/dev/null || true
for c in core core.*; do
if [ -f "$c" ] && [ -x ./v2 ]; then
echo "--- gdb backtrace from $c against v2 ---"
gdb --batch --ex bt --ex "info registers" ./v2 "$c" || true
fi
done
# If make exited 0 but ./v is missing, force a nonzero exit so
# the diagnostic job does not go green without a usable compiler.
if [ "$rc" -eq 0 ]; then rc=1; fi
exit "$rc"
fi
echo "===== bootstrap succeeded ====="
./v -version
./v run examples/hello_world.v
'
- name: Upload build log
if: always()
uses: actions/upload-artifact@v7
with:
name: termux-arm64-build-log
path: build.log
if-no-files-found: ignore