OILS / soil / worker.sh View on Github | oils.pub

713 lines, 222 significant
1#!/usr/bin/env bash
2#
3# Run continuous build tasks.
4#
5# Usage:
6# soil/worker.sh <function name>
7
8set -o nounset
9set -o pipefail
10set -o errexit
11
12REPO_ROOT=$(cd "$(dirname $0)/.."; pwd) # tsv-lib.sh uses this
13readonly REPO_ROOT
14
15source soil/common.sh
16source test/tsv-lib.sh
17
18py-all-and-ninja() {
19 ### baseline for most tasks
20
21 build/py.sh all
22 ./NINJA-config.sh
23}
24
25ninja-config() {
26 ./NINJA-config.sh
27}
28
29dummy-tasks() {
30 ### Print tasks that execute quickly
31
32 # (task_name, script, action, result_html)
33 cat <<EOF
34os-info soil/diagnose.sh os-info -
35dump-env soil/diagnose.sh dump-env -
36EOF
37}
38
39raw-vm-tasks() {
40 # The perf tool depends on a specific version of a kernel, so run it outside
41 # a container.
42
43 # (task_name, script, action, result_html)
44 cat <<EOF
45os-info soil/diagnose.sh os-info -
46dump-env soil/diagnose.sh dump-env -
47perf-install benchmarks/perf.sh soil-install -
48wait-for-tarball soil/wait.sh for-cpp-tarball -
49test-install-tar devtools/release-native.sh test-install-tar -
50perf-profiles benchmarks/perf.sh soil-run _tmp/perf/index.html
51EOF
52}
53
54# Oh there is a large list of pre-installed software
55# https://github.com/actions/runner-images#available-images
56# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md
57# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
58#
59# 1. System deps for building wedges - ninja, cmake, libreadline-dev, etc.
60# 2. fetch wedges - re2c, cmark, python2, python3, MyPy, pyflakes
61# - Python 3.10 desired for "pea"
62# 3. build them
63# 4. build Oils with them
64
65dev-setup-for() {
66 local distro=$1
67 local allow_failure=${2:-}
68
69 # (task_name, script, action, result_html)
70
71 cat <<EOF
72os-info soil/diagnose.sh os-info -
73dump-env soil/diagnose.sh dump-env -
74wedge-deps build/deps.sh wedge-deps-$distro -
75fetch build/deps.sh fetch -
76EOF
77
78 if test -n "$allow_failure"; then
79 # variants that allow failure
80 echo "install-wedges build/deps.sh install-wedges-$distro-fail _build/wedge/logs/index.html"
81 else
82 echo 'install-wedges build/deps.sh install-wedges-soil _build/wedge/logs/index.html'
83 fi
84
85 cat <<EOF
86py-all-and-ninja soil/worker.sh py-all-and-ninja -
87smoke-test build/dev-setup-test.sh smoke-test -
88wedge-report deps/wedge-report.sh show -
89EOF
90}
91
92dev-setup-debian-tasks() {
93 dev-setup-for debian
94}
95
96# allow failure
97dev-setup-debian-fail-tasks() {
98 dev-setup-for debian T
99}
100
101dev-setup-fedora-fail-tasks() {
102 dev-setup-for fedora T
103}
104
105dev-setup-alpine-fail-tasks() {
106 dev-setup-for alpine T
107}
108
109pea-tasks() {
110 ### Print tasks for the 'pea' build
111
112 # We need a later version of Python 3 / MyPy both to type check and
113 # to parse
114
115 # Run py-source so we can type check generated code
116 # We need to type check more than we translate
117
118 # (task_name, script, action, result_html)
119 cat <<EOF
120os-info soil/diagnose.sh os-info -
121dump-env soil/diagnose.sh dump-env -
122py-source build/py.sh py-source -
123typecheck pea/TEST.sh check-with-latest-mypy -
124parse-all pea/TEST.sh parse-all -
125EOF
126
127# Moved this to cpp-small, because it depends on py-all-and-ninja
128# run-tests pea/TEST.sh run-tests -
129}
130
131dev-minimal-tasks() {
132 ### Print tasks for the 'dev-minimal' build
133
134 # repo overview is suggested by README.md
135
136 # (task_name, script, action, result_html)
137 cat <<EOF
138os-info soil/diagnose.sh os-info -
139dump-env soil/diagnose.sh dump-env -
140build-minimal build/py.sh minimal -
141repo-overview metrics/source-code.sh overview -
142lint test/lint.sh soil-run -
143oils-types devtools/types.sh soil-run -
144asdl-compiler devtools/types.sh check-asdl-compiler -
145asdl-py-output asdl/TEST.sh check-py-output -
146mycpp-compiler devtools/types.sh assert-mycpp -
147unit test/unit.sh minimal _test/py-unit/
148lossless test/lossless.sh soil-run -
149parse-errors test/parse-errors.sh soil-run-py -
150runtime-errors test/runtime-errors.sh soil-run-py -
151ysh-parse-errors test/ysh-parse-errors.sh soil-run-py -
152ysh-runtime-errors test/ysh-runtime-errors.sh soil-run-py -
153ysh-every-string test/ysh-every-string.sh soil-run-py -
154ysh-large ysh/run.sh soil-run -
155j8-errors data_lang/j8-errors.sh soil-run-py -
156error-catalog doc/error-catalog.sh soil-run-py -
157link-busybox-ash test/spec-bin.sh link-busybox-ash -
158osh-minimal test/spec-py.sh osh-minimal _tmp/spec/osh-minimal/index.html
159headless client/run.sh soil-run-py -
160EOF
161}
162
163interactive-tasks() {
164 ### Print tasks for the 'interactive' build
165
166 # TODO: also run interactive suite with osh-cpp
167
168# TODO: Why does the needs-terminal suite hang in Docker? It doesn't hang in an interactive Docker session.
169#
170# needs-terminal test/spec-py.sh needs-terminal-all _tmp/spec/needs-terminal-py/index.html
171#
172# https://oilshell.zulipchat.com/#narrow/stream/121539-oil-dev/topic/Spec.20Tests.20for.20Interactive.20Parsing
173
174 cat <<EOF
175os-info soil/diagnose.sh os-info -
176dump-env soil/diagnose.sh dump-env -
177py-all-and-ninja soil/worker.sh py-all-and-ninja -
178interactive-osh test/spec-py.sh interactive-osh _tmp/spec/interactive-osh/index.html
179nohup test/nohup.sh soil-run -
180process-table test/process-table.sh soil-run _tmp/process-table/index.html
181stateful test/stateful.sh soil-run _tmp/spec/stateful/index.html
182EOF
183
184}
185
186wild-tasks() {
187 ### Print tasks for the 'wild' build
188
189 # (task_name, script, action, result_html)
190 cat <<EOF
191os-info soil/diagnose.sh os-info -
192dump-env soil/diagnose.sh dump-env -
193wait-for-tarball soil/wait.sh for-cpp-tarball -
194test-tar devtools/release-native.sh test-tar -
195linecount metrics/tarball.sh linecount-oils-cpp -
196wild test/wild.sh soil-run _tmp/wild-www/index.html
197EOF
198}
199
200# TODO:
201# - osh-parser and osh-runtime can build with the tarball, not Ninja?
202# - and then move to benchmarks2 task
203benchmarks-tasks() {
204 # (task_name, script, action, result_html)
205
206 cat <<EOF
207os-info soil/diagnose.sh os-info -
208dump-env soil/diagnose.sh dump-env -
209py-all-and-ninja soil/worker.sh py-all-and-ninja -
210dev-shell-test build/dev-shell-test.sh soil-run -
211vm-baseline benchmarks/vm-baseline.sh soil-run _tmp/vm-baseline/index.html
212compute benchmarks/compute.sh soil-run _tmp/compute/index.html
213gc benchmarks/gc.sh soil-run _tmp/gc/index.html
214mycpp-benchmarks benchmarks/mycpp.sh soil-run _tmp/mycpp-examples/index.html
215id-test benchmarks/id-test.sh soil-run -
216EOF
217}
218
219bloaty-tasks() {
220 cat <<EOF
221os-info soil/diagnose.sh os-info -
222dump-env soil/diagnose.sh dump-env -
223wait-for-tarball soil/wait.sh for-cpp-tarball -
224test-tar devtools/release-native.sh test-tar -
225native-code metrics/native-code.sh oils-for-unix _tmp/metrics/oils-for-unix/
226EOF
227}
228
229benchmarks2-tasks() {
230 # Note: id-test doesn't run in 'other-tests' because 'gawk' isn't in that image
231 cat <<EOF
232os-info soil/diagnose.sh os-info -
233dump-env soil/diagnose.sh dump-env -
234wait-for-tarball soil/wait.sh for-cpp-tarball -
235test-tar devtools/release-native.sh test-tar -
236py-source build/py.sh py-source -
237uftrace benchmarks/uftrace.sh soil-run _tmp/uftrace/index.html
238gc-cachegrind benchmarks/gc-cachegrind.sh soil-run _tmp/gc-cachegrind/index.html
239EOF
240 # 2025-01: added py-source because benchmarks use cmark.py, which uses
241 # htm8_asdl to ExpandLinks() and so forth
242}
243
244# Reuses ovm-tarball container - to compare shells
245
246# TODO:
247# - test/syscall - run with osh-cpp or osh-static
248# - put it back in soil-benchmarks
249# - this builds it in place, with Ninja
250#
251# - benchmarks3 can use soil-benchmarks2 image
252# - and then run wait-for-tarball; osh-parser; osh-runtime
253
254benchmarks3-tasks() {
255 # (task_name, script, action, result_html)
256 # (task_name, script, action, result_html)
257 cat <<EOF
258os-info soil/diagnose.sh os-info -
259dump-env soil/diagnose.sh dump-env -
260py-all-and-ninja soil/worker.sh py-all-and-ninja -
261benchmark-build soil/cpp-tarball.sh benchmark-build -
262osh-parser benchmarks/osh-parser.sh soil-run _tmp/osh-parser/index.html
263osh-runtime benchmarks/osh-runtime.sh soil-run _tmp/osh-runtime/index.html
264EOF
265# TODO: download tarball, like soil-benchmarks2?
266# wait-for-tarball soil/wait.sh for-cpp-tarball -
267
268 return
269 cat <<EOF
270os-info soil/diagnose.sh os-info -
271dump-env soil/diagnose.sh dump-env -
272py-all build/py.sh all -
273EOF
274
275
276# missing curl !
277# wait-for-tarball soil/wait.sh for-cpp-tarball -
278
279# missing ninja !
280# osh-runtime benchmarks/osh-runtime.sh soil-run _tmp/osh-runtime/index.html
281
282# Gah we really need better dependencies
283}
284
285cpp-spec-tasks() {
286 # (task_name, script, action, result_html)
287
288 cat <<EOF
289os-info soil/diagnose.sh os-info -
290dump-env soil/diagnose.sh dump-env -
291py-all-and-ninja soil/worker.sh py-all-and-ninja -
292oils-cpp-smoke build/native.sh soil-run -
293osh-all test/spec-cpp.sh osh-all _tmp/spec/osh-cpp/compare.html
294ysh-all test/spec-cpp.sh ysh-all _tmp/spec/ysh-cpp/compare.html
295ysh-py test/spec-py.sh ysh-all-serial _tmp/spec/ysh-py/index.html
296EOF
297}
298
299cpp-tarball-tasks() {
300 # Note: build-times task requires _build/oils.sh
301 # It's a bit redundant with test-tar
302
303 cat <<EOF
304os-info soil/diagnose.sh os-info -
305dump-env soil/diagnose.sh dump-env -
306py-all-and-ninja soil/worker.sh py-all-and-ninja -
307oils-cpp-smoke build/native.sh soil-run -
308make-tar devtools/release-native.sh make-tar _release/oils-for-unix.tar
309xshar-hello devtools/xshar.sh soil-run-hello _release/hello-xshar.xshar
310xshar-test-oils devtools/xshar.sh soil-run-test-oils _release/test-oils.xshar
311build-times build/native.sh measure-build-times -
312EOF
313
314# build-times is a good enough test
315# test-tar devtools/release-native.sh test-tar -
316#
317# Note: tarball is deployed outside the container
318
319}
320
321cpp-small-tasks() {
322
323 # yaks could be moved to pea/ image once it has python2-dev
324 # Note: stdlib-test depends on 'ninja', so it's in cpp-small (formerly dev-minimal)
325
326 cat <<EOF
327os-info soil/diagnose.sh os-info -
328dump-env soil/diagnose.sh dump-env -
329py-all-and-ninja soil/worker.sh py-all-and-ninja -
330py-unit test/unit.sh all _test/py-unit/
331ltrace test/ltrace.sh soil-run -
332stdlib-test stdlib/TEST.sh soil-run -
333yaks yaks/TEST.sh soil-run -
334pea pea/TEST.sh run-tests -
335oils-cpp-smoke build/native.sh soil-run -
336cpp-unit test/cpp-unit.sh soil-run _test/-wwz-index
337osh-usage test/osh-usage.sh soil-run -
338headless client/run.sh soil-run-cpp -
339asan test/asan.sh soil-run -
340micro-syntax doctools/micro-syntax.sh soil-run -
341src-tree doctools/src-tree.sh soil-run _tmp/src-tree-www/index.html
342line-counts metrics/source-code.sh write-reports _tmp/metrics/line-counts/-wwz-index
343preprocessed metrics/source-code.sh preprocessed _tmp/metrics/preprocessed/-wwz-index
344mycpp-examples mycpp/TEST.sh soil-run _test/-wwz-index
345parse-errors test/parse-errors.sh soil-run-cpp -
346runtime-errors test/runtime-errors.sh soil-run-cpp -
347ysh-parse-errors test/ysh-parse-errors.sh soil-run-cpp -
348ysh-runtime-errors test/ysh-runtime-errors.sh soil-run-cpp -
349ysh-every-string test/ysh-every-string.sh soil-run-cpp -
350ysh-large ysh/run.sh soil-run-cpp -
351j8-errors data_lang/j8-errors.sh soil-run-cpp -
352error-catalog doc/error-catalog.sh soil-run-cpp -
353houston-fp demo/houston-fp/run.sh soil-run -
354souffle-smoke-test test/souffle-smoke.sh soil-run -
355EOF
356}
357
358cpp-coverage-tasks() {
359 # dep notes: hnode_asdl.h required by expr_asdl.h in mycpp/examples
360
361 # TODO: make this work
362#tar-compile benchmarks/ovm-build.sh soil-run -
363 cat <<EOF
364os-info soil/diagnose.sh os-info -
365dump-env soil/diagnose.sh dump-env -
366py-all-and-ninja soil/worker.sh py-all-and-ninja -
367extract-clang deps/from-binary.sh extract-clang-in-container -
368mycpp-unit-coverage mycpp/TEST.sh unit-test-coverage _test/clang-coverage/mycpp/html/index.html
369mycpp-examples-coverage mycpp/TEST.sh examples-coverage _test/clang-coverage/mycpp/examples/html/index.html
370cpp-coverage cpp/TEST.sh coverage _test/clang-coverage/cpp/html/index.html
371unified-coverage test/coverage.sh unified-report _test/clang-coverage/unified/html/index.html
372compare-gcc-clang metrics/native-code.sh compare-gcc-clang _tmp/metrics/compare-gcc-clang.txt
373EOF
374}
375
376ovm-tarball-tasks() {
377 ### Print tasks for the 'ovm-tarball' build
378
379 # notes:
380 # - py-all needed to crawl dependencies to make tarball.
381
382 # (task_name, script, action, result_html)
383 cat <<EOF
384os-info soil/diagnose.sh os-info -
385dump-env soil/diagnose.sh dump-env -
386py-all build/py.sh all -
387configure devtools/release.sh configure-for-release -
388make-tarball devtools/release.sh py-tarball _release/oils-ref.tar
389syscall test/syscall.sh soil-run _tmp/syscall/-wwz-index
390osh-spec test/spec-py.sh osh-all-serial _tmp/spec/osh-py/index.html
391gold test/gold.sh soil-run -
392tools-deps test/tools-deps.sh soil-run -
393ninja-config soil/worker.sh ninja-config -
394docs build/doc.sh soil-run _release/VERSION/index.html
395web-tests web/TEST.sh soil-run -
396doc-metrics echo no-op _release/VERSION/doc/metrics.txt
397check-docs data_lang/htm8-test.sh soil-run -
398EOF
399# Notes:
400# - 'docs' depends on 'ninja-config' to run build/ninja_main.py, which makes
401# _build/oils.sh. Maybe all the docs need to be in Ninja
402# - doc-metrics is a no-op, just for the link. Because soil-run just runs the
403# release, which creates metrics.
404}
405
406app-tests-tasks() {
407
408 cat <<EOF
409os-info soil/diagnose.sh os-info -
410dump-env soil/diagnose.sh dump-env -
411py-all build/py.sh all -
412ble-clone regtest/ble.sh clone -
413ble-build regtest/ble.sh build -
414ble-test-osh-py regtest/ble.sh run-tests-osh-py -
415wait-for-tarball soil/wait.sh for-cpp-tarball -
416test-tar devtools/release-native.sh test-tar -
417ble-test-osh-cpp regtest/ble.sh run-tests-osh-cpp -
418EOF
419
420# 2025-02 - times out after 15 minutes? This is just bash, not OSH?
421# ble-bash-suite regtest/ble.sh bash-suite -
422
423# This doesn't work
424# ble-test-osh-bash regtest/ble.sh run-tests-osh-bash -
425}
426
427# TODO: Most of these should be Ninja tasks.
428# Other tests:
429# find-test, xargs-test, pgen2-test, web/table/csv2html-test.sh
430# Probably should start using a shell test framework too.
431other-tests-tasks() {
432 cat <<EOF
433os-info soil/diagnose.sh os-info -
434dump-env soil/diagnose.sh dump-env -
435build-minimal build/py.sh minimal -
436configure-test ./configure-test.sh soil_run -
437time-test benchmarks/time-test.sh soil-run -
438tsv-lib-test test/tsv-lib-test.sh soil-run -
439ysh-ify tools/ysh-ify-test.sh soil-run -
440tools-smoke-test tools/smoke-test.sh soil-run -
441R-test devtools/R-test.sh soil-run -
442xargs-test test/other.sh xargs-test -
443csv2html-test test/other.sh csv2html-test -
444oil-python-symbols metrics/source-code.sh oil-python-symbols -
445opyc test/opyc.sh soil-run -
446opy-count-lines opy/soil.sh count-lines -
447test-gold opy/soil.sh test-gold -
448build-oils-repo opy/soil.sh build-oils-repo -
449regtest-compile opy/soil.sh regtest-compile -
450EOF
451
452# TODO: add this back after fixing transitive test enumeration problem
453# We shouldn't use
454
455# web-remote-test soil/web-remote-test.sh soil-run -
456}
457
458tests-todo() {
459 ### More tests to add
460 find . -name '_*' -a -prune -o -name '*-test.sh' -a -print
461
462 # pgen2/pgen2-test.sh seems mostly broken
463}
464
465# Redefinition for quicker cloud debugging
466maybe-merge-tasks() {
467 cat <<EOF
468os-info soil/diagnose.sh os-info -
469dump-env soil/diagnose.sh dump-env -
470maybe-merge soil/maybe-merge.sh soil-run -
471EOF
472}
473
474run-tasks() {
475 ### Run the tasks on stdin and write _tmp/soil/INDEX.tsv.
476 local job_name=$1
477 local out_dir=$2 # should already exist
478 local tty=$3
479
480 mkdir -p $out_dir/logs
481
482 # So we can run benchmarks/time_.py.
483 # 2023-02-28: Images like soil-wild based off the new soil-common no longer
484 # have 'cc'. Instead they use a wedge.
485 if command -v cc > /dev/null; then
486 build/py.sh time-helper
487 else
488 echo 'test time-tsv3'
489 time-tsv3 -o /tmp/echo.tsv --append -- echo hi
490
491 echo '/tmp/echo.tsv:'
492 cat /tmp/echo.tsv
493 fi
494
495 # For the later deploy step to pick up
496 date +%s > $out_dir/task-run-start-time.txt
497
498 # This data can go on the dashboard index
499 local tsv=$out_dir/INDEX.tsv
500 rm -f $tsv
501
502 local status
503 local max_status=0
504
505 while read task_name script action result_html; do
506 log "--- task: $task_name ---"
507
508 local log_path=$out_dir/logs/$task_name.txt
509
510 # 15 minutes per task
511 # One of the longest tasks is test/spec-cpp, which takes around 420 seconds
512 # TODO: should have a configurable timeout
513 local -a timeout=(timeout 900)
514 local stdin_tty=''
515
516 case $script in
517 test/process-table.sh)
518 # Workaround for weird interaction, see
519 # $ test/process-table.sh timeout-issue
520 timeout=()
521 ;;
522 test/nohup.sh)
523 # Only run test/nohup.sh with TTY. For some reason build/py.sh all hangs
524 # with $tty?
525 stdin_tty=$tty
526 ;;
527 esac
528
529 local -a argv=(
530 time-tsv3 -o $tsv --append
531 --field $task_name --field $script --field $action
532 --field $result_html --
533 "${timeout[@]}" "$script" "$action"
534 )
535
536 # Run task and save status
537 set +o errexit
538 if test -n "$stdin_tty"; then
539 # explicitly connect TTY, e.g. for soil/interactive
540 "${argv[@]}" > $log_path 2>&1 < $stdin_tty
541 else
542 # Temporary fix: build/doc.sh soil-run reads from stdin!
543 "${argv[@]}" > $log_path 2>&1 < /dev/null
544 fi
545 status=$?
546 set -o errexit
547
548 if test "$status" -gt "$max_status"; then
549 max_status=$status
550 fi
551
552 # Show the last line
553 echo
554 tsv-row status elapsed task script action result_html
555 tail -n 1 $tsv
556 echo
557 log "status=$status max_status=$max_status"
558 done
559
560 log '--- done ---'
561 ls -l $out_dir
562 wc -l $out_dir/logs/*
563
564 # This suppressed the deployment of logs, which we don't want. So all our
565 # Travis builds succeed? But then we can't use their failure notifications
566 # (which might be OK).
567 if false; then
568 # exit with the maximum exit code.
569 awk '
570 BEGIN { max = 0 }
571 { if ($1 > max) { max = $1 } }
572 END { exit(max) }
573 ' $tsv
574 fi
575
576 # To fail later. Important: this dir persists across jobs; it's NOT removed
577 # by 'host-shim.sh job-reset'.
578 mkdir -p _soil-jobs
579
580 # Hack: Assign job_id and write it to the status file. Other jobs can poll
581 # for completion of this job and access its resources.
582
583 local job_id
584 job_id="$(date +%Y-%m-%d__%H-%M-%S)"
585
586 # e.g. _soil-jobs/dummy.status.txt
587 echo "$max_status $job_id" > _soil-jobs/$job_name.status.txt
588}
589
590save-metadata() {
591 ### Write metadata files to be saved as JSON
592
593 # NOTE: host-shim.sh also writes image-pull-time.txt
594
595 local job_name=$1
596 local meta_dir=$2
597
598 echo "$job_name" > $meta_dir/job-name.txt
599
600 # command to show current branch
601 # This does NOT work in detached HEAD! Travis puts the branch in an env
602 # variable, but sr.ht doesn't.
603 # git rev-parse --abbrev-ref HEAD > $meta_dir/git-branch.txt
604
605 git log -n 1 --pretty='format:%H' > $meta_dir/commit-hash.txt
606
607 # ISO 8601 format
608 # Note: this can get confused with rebases. Two different commits can have
609 # the same date.
610 git log -n 1 --pretty='format:%aI' > $meta_dir/commit-date.txt
611
612 git log -n 1 --pretty='format:%s' > $meta_dir/commit-line.txt # "subject"
613}
614
615disable-git-errors() {
616
617 # 2023-02: The build started failing because of the permissions we set in
618 # soil/host-shim.sh mount-perms.
619 #
620 # The issue is that the guest needs to be able to write to the Docker mount
621 # of the repo. I think it may have been related to podman vs. Docker.
622 # Should check if mount-perms is necessary in both places.
623 #
624 # git fails unless we have this workaround.
625
626 # https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor
627
628 # https://github.blog/2022-04-12-git-security-vulnerability-announced/
629
630 #git config --global --add safe.directory '*'
631
632 git config --global --add safe.directory /home/uke/oil
633}
634
635job-main() {
636 local job_name=$1
637
638 local out_dir=_tmp/soil
639
640 # Report for debugging
641 export EXTRA_MYCPP_ARGS='--stack-roots-warn 16'
642
643 log-context 'job-main'
644 mkdir -v -p $out_dir
645 ls -l -d $out_dir
646
647 disable-git-errors
648
649 save-metadata $job_name $out_dir
650
651 local captured
652
653 set +o errexit
654 captured=$(tty)
655 status=$?
656 set -o errexit
657
658 if test $status -eq 0; then
659 echo "TTY = $captured"
660 local tty=$captured
661 else
662 echo "captured = $captured"
663 local tty='' # clear the output
664 fi
665 echo
666
667 # 2025-10: we now ASSUME this state
668 source build/dev-shell.sh
669
670 ${job_name}-tasks | run-tasks $job_name $out_dir "$tty"
671}
672
673JOB-dummy() { job-main 'dummy'; }
674
675# These jobs run directly on VMs, not inside containers
676JOB-raw-vm() { job-main 'raw-vm'; }
677JOB-dev-setup-debian() { job-main 'dev-setup-debian'; }
678JOB-dev-setup-debian-fail() { job-main 'dev-setup-debian-fail'; }
679JOB-dev-setup-fedora-fail() { job-main 'dev-setup-fedora-fail'; }
680JOB-dev-setup-alpine-fail() { job-main 'dev-setup-alpine-fail'; }
681
682JOB-dev-minimal() { job-main 'dev-minimal'; }
683JOB-interactive() { job-main 'interactive'; }
684
685JOB-other-tests() { job-main 'other-tests'; }
686
687JOB-pea() { job-main 'pea'; }
688
689JOB-ovm-tarball() { job-main 'ovm-tarball'; }
690JOB-app-tests() { job-main 'app-tests'; }
691
692JOB-cpp-coverage() { job-main 'cpp-coverage'; }
693JOB-cpp-small() { job-main 'cpp-small'; }
694JOB-cpp-tarball() { job-main 'cpp-tarball'; }
695JOB-cpp-spec() { job-main 'cpp-spec'; }
696
697JOB-bloaty() { job-main 'bloaty'; }
698JOB-benchmarks() { job-main 'benchmarks'; }
699JOB-benchmarks2() { job-main 'benchmarks2'; }
700JOB-benchmarks3() { job-main 'benchmarks3'; }
701
702JOB-wild() { job-main 'wild'; }
703
704JOB-maybe-merge() { job-main 'maybe-merge'; }
705
706list-jobs() {
707 ### invoked by maybe-merge
708
709 # omit sourcehut jobs: dev-setup-*-fail
710 compgen -A function | grep -- '^JOB-' | sed 's/^JOB-//g' | egrep -v 'maybe-merge|dev-setup-.*-fail'
711}
712
713"$@"