OILS / regtest / aports-run.sh View on Github | oils.pub

769 lines, 360 significant
1#!/usr/bin/env bash
2#
3# Build Alpine Linux packages: baseline, OSH as /bin/sh, OSH as /bin/bash
4# See regtest/aports.md
5#
6# Usage:
7# regtest/aports-run.sh <function name>
8#
9# Common usage:
10#
11# export APORTS_EPOCH=2025-08-04-foo # optional override
12# $0 build-many-shards-overlayfs shard{0..16} # build all 17 shards in 2 configs
13#
14# Also useful:
15#
16# $0 fetch-packages fetch $pkg_filter $a_repo # alpine repo is 'main' or 'community'
17#
18# $0 fetch-packages fetch 100,300p # packages 100-300
19# $0 fetch-packages fetch '.*' # all packages
20#
21# Look for results in _tmp/aports-build/
22#
23# Build many packages:
24#
25# $0 build-packages-overlayfs osh-as-sh shard9 community
26# $0 build-packages-overlayfs osh-as-sh shardA # main is default $a_repo
27#
28# Build a single package:
29#
30# $0 build-package-overlayfs osh-as-sh userspace-rcu
31# $0 build-package-overlayfs osh-as-sh xterm community # community repo
32#
33# Drop into a shell:
34# INTERACTIVE=1 $0 build-package-overlayfs osh-as-sh userspace-rcu
35#
36# PKG_FILTER
37# shard[0-9]+ - shard3 is packages 301 to 400
38# [0-9]+ - 42 means build the first 42 packages
39# [0-9]+,[0-9]+p - 100,300p packages 100 to 300 (sed syntax)
40# ALL - all packages
41# .* - egrep pattern matching all packages
42# curl - egrep pattern matching 'curl'
43#
44# Preview packages:
45#
46# $0 package-dirs shard9 community
47
48: ${LIB_OSH=stdlib/osh}
49source $LIB_OSH/bash-strict.sh
50source $LIB_OSH/task-five.sh
51
52source regtest/aports-common.sh
53
54#
55# Config
56#
57
58show-config() {
59 enter-rootfs sh -c '
60 ls -l /bin/sh /bin/ash /bin/bash
61 '
62}
63
64set-baseline() {
65 # ensure we have the default config
66 enter-rootfs sh -c '
67 set -x
68 ln -s -f /bin/busybox /bin/sh
69 ln -s -f /bin/busybox /bin/ash
70 cp /bin/bash.ORIG /bin/bash
71 '
72 show-config
73}
74
75set-osh-as-X() {
76 local x=$1
77
78 enter-rootfs sh -c '
79 x=$1
80 set -x
81 if ! test -f /usr/local/bin/oils-for-unix; then
82 echo "Build Oils first"
83 exit
84 fi
85 ln -s -f /usr/local/bin/oils-for-unix /bin/$x
86 ' dummy0 "$x"
87 show-config
88}
89
90set-osh-as-sh() {
91 set-osh-as-X sh
92}
93
94set-osh-as-ash() {
95 set-osh-as-X ash
96}
97
98set-osh-as-bash() {
99 set-osh-as-X bash
100}
101
102#
103# Run
104#
105
106package-dirs() {
107 # lz gives 5 packages: some fail at baseline
108 # lzip: a single fast package
109 # mpfr4: OSH bug, and big log
110 # yash: make sure it doesn't hang
111 local package_filter=${1:-'lz|mpfr|yash'}
112 local a_repo=${2:-main} # or 'community'
113
114 local -a prefix
115
116 if [[ $package_filter = 'ALL' ]]; then
117 prefix=( cat )
118
119 # 100 means 0 to 100
120 elif [[ $package_filter =~ ^[0-9]+$ ]]; then
121 prefix=( head -n $package_filter )
122
123 # 100,300p means lines 100 to 300
124 elif [[ $package_filter =~ ^[0-9]+,[0-9]+p$ ]]; then
125 prefix=( sed -n $package_filter )
126
127 elif [[ $package_filter =~ ^shard([0-9]+)$ ]]; then
128 # shards of 100 packages
129
130 local shard_num=${BASH_REMATCH[1]}
131 #echo shard=$shard_num
132
133 local range
134 # shard 0 is 0-99
135 # shard 9 is 900 to 999
136 # shard 10 is 1000 to 1099
137 case $shard_num in
138 # sed doesn't like 000,099
139 0) range='1,100p' ;;
140 *) range="${shard_num}01,$(( shard_num + 1))00p" ;;
141 esac
142
143 prefix=( sed -n "$range" )
144
145 # shardA, shardB For testing the combined report
146 elif [[ $package_filter =~ ^shard([A-Z]+)$ ]]; then
147 local shard_name=${BASH_REMATCH[1]}
148 case $a_repo in
149 main)
150 case $shard_name in
151 A) package_filter='^gzip' ;; # failure
152 B) package_filter='^xz' ;; # failure
153 C) package_filter='^lz' ;; # 3 packages
154 D) package_filter='^jq$' ;; # produces autotools test-suite.log
155 E) package_filter='^py3-p' ;; # many packages in parallel
156 F) package_filter='^py3-pathspec' ;; # very fast package
157 P) package_filter='^xz$|^shorewall' ;; # patches
158 *) package_filter='^perl-http-daemon' ;; # test out perl
159 esac
160 ;;
161 community)
162 case $shard_name in
163 A) package_filter='^py3-zulip' ;; # one Python package
164 B) package_filter='^xterm' ;; # one C package
165 C) package_filter='^shfmt' ;; # one Go package
166 D) package_filter='^shellspec' ;; # OSH disagreement because of 'var'
167 *) package_filter='^shell' ;; # a bunch of packages
168 esac
169 ;;
170 *)
171 die "Invalid a_repo $a_repo"
172 ;;
173 esac
174
175 prefix=( egrep "$package_filter" )
176
177 elif [[ $package_filter =~ ^disagree-(.*)+$ ]]; then
178 local filename=${BASH_REMATCH[1]}
179 # A file of EXACT package names, not patterns
180 # See copy-disagree
181 local package_file="_tmp/$package_filter.txt"
182 comm -1 -2 <(sort $package_file) <(sort _tmp/apk-${a_repo}-manifest.txt)
183 return
184
185 else
186 prefix=( egrep "$package_filter" )
187
188 fi
189
190 "${prefix[@]}" _tmp/apk-${a_repo}-manifest.txt
191}
192
193copy-disagree() {
194 ### Determine what to run
195
196 local epoch=${1:-2025-09-18-bash}
197 cp -v \
198 _tmp/aports-report/$epoch/disagree-packages.txt \
199 _tmp/disagree-$epoch.txt
200}
201
202do-packages() {
203 ### Download sources - abuild puts it in /var/cahe/distfiles
204 local action=${1:-fetch}
205 local package_filter=${2:-}
206 local a_repo=${3:-main}
207 # flags to pass to the inner shell
208 local sh_flags=${4:-'-e -u'} # -u to disable -e
209
210 # 6 seconds for 10 packages
211 # There are ~1600 packages
212 # So if there are 20 shards, each shard could have 10?
213
214 local -a package_dirs
215 package_dirs=( $(package-dirs "$package_filter" "$a_repo") )
216
217 echo "${dirs[@]}"
218 #return
219
220 time enter-rootfs-user sh $sh_flags -c '
221
222 action=$1
223 a_repo=$2
224 shift 2
225 for dir in "$@"; do
226 time abuild -r -C aports/$a_repo/$dir "$action"
227 done
228 ' dummy0 "$action" "$a_repo" "${package_dirs[@]}"
229}
230
231fetch-packages() {
232 local package_filter=${1:-}
233 local a_repo=${2:-main}
234
235 # -u means we don't pass -e (and it's non-empty)
236 do-packages fetch "$package_filter" "$a_repo" '-u'
237}
238
239banner() {
240 echo
241 echo "=== $@"
242 echo
243}
244
245build-package-overlayfs() {
246 local config=${1:-baseline}
247 local pkg=${2:-lua5.4}
248 local a_repo=${3:-main}
249
250 # baseline stack:
251 # _chroot/aports-build
252 # _chroot/package-upper/baseline/gzip # upper dir / layer dir
253 #
254 # osh-as-sh stack:
255 # _chroot/aports-build
256 # _chroot/osh-as-sh.overlay/layer # this has the symlink
257 # _chroot/package-upper/osh-as-sh/gzip # upper dir / layer dir
258
259 # allow concurrency
260 local xargs_slot="${XARGS_SLOT:-99}"
261 local ov_base_dir=_chroot/package-slot${xargs_slot}.overlay
262
263 local merged=$ov_base_dir/merged
264 local work=$ov_base_dir/work
265
266 local layer_dir=_chroot/package-layers/$config/$pkg
267 mkdir -p $merged $work $layer_dir
268
269 local overlay_opts
270 case $config in
271 baseline)
272 overlay_opts="lowerdir=$CHROOT_DIR,upperdir=$layer_dir,workdir=$work"
273 ;;
274 osh-as-sh)
275 local osh_as_sh=_chroot/osh-as-sh.overlay/layer
276 overlay_opts="lowerdir=$osh_as_sh:$CHROOT_DIR,upperdir=$layer_dir,workdir=$work"
277 ;;
278 *)
279 die "Invalid config $config"
280 ;;
281 esac
282
283 # -o index=off fixes this error: fsconfig() failed: Stale file handle
284 # See also https://oilshell.zulipchat.com/#narrow/channel/522730-distros/topic/setting.20up.20regtest.2Faports-setup.2Esh/with/544318771
285 sudo mount \
286 -t overlay \
287 aports-package \
288 -o "$overlay_opts" \
289 -o index=off \
290 $merged
291
292 # mount over the overlay, onto the merged
293 sudo mount \
294 -t proc \
295 "_chroot_proc_${xargs_slot}" $merged/proc
296
297 sudo mount \
298 -t sysfs \
299 "_chroot_sysfs_${xargs_slot}" $merged/sys
300
301 sudo mount \
302 -t devtmpfs \
303 "_chroot_devtmpfs_${xargs_slot}" $merged/dev
304
305 local -a prefix
306 if test -n "${XARGS_SLOT:-}"; then
307 local x=$XARGS_SLOT
308
309 # run slot 0 on cores 0 and 1
310 # run slot 9 on cores 18 and 19
311 local cores="$(( x*2 )),$(( x*2 + 1 ))"
312
313 # oversubscribe
314 # run slot 0 on cores 0 and 1
315 # run slot 19 on cores 19 and 0
316 #local cores="$(( x )),$(( (x + 1) % NUM_CORES ))"
317 prefix=( taskset -c "$cores" )
318 fi
319
320 "${prefix[@]}" $merged/enter-chroot -u udu sh -c '
321 cd oils
322
323 # show the effect of the overlay
324 #ls -l /bin/sh
325
326 regtest/aports-guest.sh build-one-package "$@"
327 ' dummy0 "$pkg" "$a_repo" "$xargs_slot"
328
329 if test -n "$INTERACTIVE"; then
330 echo "Starting interactive shell in overlayfs environment for package $a_repo/$pkg"
331 echo "Rebuild: abuild -f -r -C ~/aports/$a_repo/$pkg -k -K"
332 echo " Help: abuild -h"
333 # If the last command in the child shell exited non-zero then ctrl-d/exit
334 # will report that error code to the parent. If we don't ignore that error
335 # we will exit early and leave the package overlay mounted.
336 set +o errexit
337 $merged/enter-chroot -u udu
338 set -o errexit
339 fi
340
341 unmount-loop $merged/proc
342 unmount-loop $merged/sys
343 unmount-loop $merged/dev
344 unmount-loop $merged
345}
346
347build-pkg() {
348 ### trivial wrapper around build-package-overlayfs - change arg order for xargs
349 local config=${1:-baseline}
350 local a_repo=${2:-main}
351 local pkg=${3:-lua5.4}
352
353 build-package-overlayfs "$config" "$pkg" "$a_repo"
354
355 # TODO:
356 # - we should only do this after we've done BOTH configs, so it appears
357 # atomically
358 save-package-files $config $a_repo $pkg
359
360 # TODO: blow away the layer dir, since we saved the "tombstone".
361 # We're not doing this now because we're still reporting off DEPRECATED shard
362 # files.
363}
364
365LOG_SIZE_THRESHOLD=$(( 500 * 1000 )) # 500 KB
366#LOG_SIZE_THRESHOLD=$(( 1 * 1000 ))
367
368abridge-one-log() {
369 local src=$1
370 local dest=$2
371
372 local size
373 size=$(stat --format '%s' $src)
374 if test $size -lt $LOG_SIZE_THRESHOLD; then
375 #cp --verbose $src $dest
376 cp $src $dest
377 else
378 # Bug fix: abridging to 1000 lines isn't sufficient. We got some logs
379 # that were hundreds of MB, with less than 1000 lines!
380 { echo "*** This log is abridged to its last $LOG_SIZE_THRESHOLD bytes"
381 echo
382 tail --bytes $LOG_SIZE_THRESHOLD $src
383 } > $dest
384 fi
385}
386
387# save-package-files creates a tree we can rsync
388# For EACH PACKAGE, without shards
389#
390# TODO: Both baseline and osh-as-sh should appear atomically?
391
392# Source tree:
393#
394# _chroot/package-layers/
395# baseline/
396# jq/
397# home/udu/
398# oils/_tmp/aports-guest/
399# jq.log.txt
400# jq.task.tsv
401# packages/main/x86_64
402# jq-*.apk
403# aports/main/jq/
404# src/jq-1.8.0/test-suite.log
405#
406# _tmp/aports-build/
407# 2025-11-12/
408# shard0/ # TODO: remove shards
409# baseline/
410# NEW:
411# apk/
412# jq.apk.txt # md5sum
413# layer/
414# jq.tombstone.txt # find '%s %P\n'
415# task/
416# jq.task.tsv
417# EXISTING:
418# apk.txt
419# tasks.tsv
420# log/
421# jq.log.txt
422# test-suite/
423# jq/ TODO: support multiple logs
424# test-suite.log
425
426save-package-files() {
427 ### Copy some files from _chroot/package-layers/ -> _tmp/aports-build
428
429 local config=${1:-baseline}
430 local a_repo=${2:-main}
431 local pkg=${3:-jq}
432
433 local layer_dir=_chroot/package-layers/$config/$pkg
434 local dest_dir=$BASE_DIR/$APORTS_EPOCH/$config
435
436 # 5 directories
437 mkdir -p $dest_dir/{apk,layer,task,log,test-suite}
438
439 cp \
440 $layer_dir/home/udu/oils/_tmp/aports-guest/$pkg.task.tsv \
441 $dest_dir/task
442
443 abridge-one-log \
444 $layer_dir/home/udu/oils/_tmp/aports-guest/$pkg.log.txt \
445 $dest_dir/log/$pkg.log.txt
446
447 # Abridge this log too
448 { find $layer_dir/home/udu/aports/$a_repo/$pkg -name 'test-suite.log' 2> /dev/null || true; } |
449 while read -r log_src; do
450 local test_suite_dest_dir=$dest_dir/test-suite/$pkg
451 mkdir -p $test_suite_dest_dir
452 abridge-one-log \
453 $log_src \
454 $test_suite_dest_dir/test-suite.log.txt
455 done
456
457 md5sum $layer_dir/home/udu/packages/$a_repo/x86_64/*.apk \
458 > $dest_dir/apk/$pkg.apk.txt 2> /dev/null || true # allow failure if nothing built
459
460 # Truncate large listings - e.g. clang packages have over 120K files
461 { find $layer_dir -printf '%s %P\n' 2> /dev/null || true; } |
462 head -n 1000 > $dest_dir/layer/$pkg.tombstone.txt
463
464 #tree $dest_dir
465
466 # log.txt
467 # log.txt
468}
469
470NUM_CORES=$(( $(nproc) ))
471
472# 2 cores per package build
473NUM_PAR=$(( NUM_CORES / 2 ))
474
475# over-subscribe - allow 20 processes to see 2 cores each
476# Note: this causes more timeouts. TODO: get rid of shards to get rid of
477# stragglers, and then raise the timeout to 20 minutes or more.
478# NUM_PAR=$(( NUM_CORES ))
479
480# TODO: we ran into the env.sh race condition in the enter-chroot script
481# generated by alpine-chroot-install
482build-many-packages-overlayfs() {
483 local package_filter=${1:-}
484 local config=${2:-baseline}
485 local a_repo=${3:-main}
486 local parallel=${4:-T}
487
488 banner "Building packages (filter=$package_filter a_repo=$a_repo)"
489
490 local -a flags
491 if test -n "$parallel"; then
492 log "(with $NUM_PAR jobs in parallel)"
493 flags=( -P $NUM_PAR )
494 else
495 log '(serially)'
496 fi
497
498 package-dirs "$package_filter" $a_repo |
499 xargs "${flags[@]}" -n 1 --process-slot-var=XARGS_SLOT -- \
500 $0 build-pkg $config $a_repo
501}
502
503
504clean-host-and-guest() {
505 # host dir _tmp/aports-build
506 rm -r -f -v $BASE_DIR
507}
508
509clean-guest() {
510 # clean guest chroot
511 sudo rm -r -f -v $CHROOT_HOME_DIR/oils/_tmp
512}
513
514readonly -a CONFIGS=( baseline osh-as-sh )
515
516APORTS_EPOCH="${APORTS_EPOCH:-}"
517# default epoch
518if test -z "$APORTS_EPOCH"; then
519 APORTS_EPOCH=$(date '+%Y-%m-%d')
520fi
521
522_build-many-configs-overlayfs() {
523 local package_filter=${1:-}
524 local epoch=${2:-$APORTS_EPOCH}
525 local a_repo=${3:-main}
526
527 if test -z "$package_filter"; then
528 die "Package filter is required (e.g. shard3, ALL)"
529 fi
530
531 clean-guest
532
533 # See note about /etc/sudoers.d at top of file
534
535 local dest_dir="$BASE_DIR/$epoch/$package_filter" # e.g. shard10
536
537 for config in "${CONFIGS[@]}"; do
538 banner "$epoch: Using config $config"
539
540 build-many-packages-overlayfs "$package_filter" "$config" "$a_repo"
541 done
542}
543
544remove-shard-files() {
545 local shard_dir=${1:-_chroot/shardC}
546
547 # For all packages packages, for baseline and osh-as-sh, clean up the aports source dir
548 # For linux, clang, etc. it becomes MANY GIGABYTES
549 #
550 # 2025-09-12: ignore errors from rm; I think there was a race condition -
551 # processes could still be running and creating files
552 #
553 # rm: cannot remove '_chroot/shard6/baseline/llvm19/home/udu/aports/main/llvm19/src/llvm-project-19.1.7.src/build/lib': Directory not empty
554 # real 1041m46.464s
555
556 #log "Removing big files in shard $shard_dir"
557 #sudo rm -r -f $shard_dir/*/*/home/udu/aports/ || true
558
559 log "Removing all files in $shard_dir"
560 sudo rm -r -f $shard_dir || true
561}
562
563build-many-shards-overlayfs() {
564 sudo -k
565
566 local a_repo=${A_REPO:-main} # env var like $APORTS_EPOCH
567
568 # Clean up old runs
569 sudo rm -r -f _chroot/package-layers _chroot/shard* _chroot/disagree*
570
571 banner "$APORTS_EPOCH $a_repo: building shards: $*"
572
573 time for shard_name in "$@"; do
574 _build-many-configs-overlayfs "$shard_name" "$APORTS_EPOCH" "$a_repo"
575
576 # Move layer files to _chroot/shard10/{baseline,osh}/...
577 mv -v --no-target-directory _chroot/package-layers _chroot/$shard_name
578
579 # Make it rsync-able in _tmp/aports-build ($BASE_DIR)
580 make-shard-tree $shard_name $a_repo
581
582 # Remove big files
583 remove-shard-files _chroot/$shard_name
584
585 # TODO: we should publish and clean up after every PACKAGE, rather than
586 # each shard
587 done
588}
589
590build-and-proc-log() {
591 # Measure resource utilization
592 local proc_dir="$BASE_DIR/$APORTS_EPOCH/proc-log"
593 mkdir -v -p $proc_dir
594 regtest/proc_log.py --out-dir $proc_dir --sleep-secs 5 &
595 local proc_log_pid=$!
596
597 sleep 0.05 # prevent overlapping sudo prompt
598
599 build-many-shards-overlayfs "$@"
600
601 kill -s TERM $proc_log_pid
602 wc -l $proc_dir/*.txt
603}
604
605make-shard-tree() {
606 ### Put outputs in rsync-able format, for a SINGLE shard
607
608 # The dir structure is like this:
609 #
610 # _tmp/aports-build/
611 # 2025-09-10-overlayfs/
612 # shard0/
613 # baseline/
614 # apk.txt
615 # tasks.tsv
616 # log/
617 # gzip.log.txt
618 # xz.log.txt
619 # test-suite/ # autotools dir
620 # gzip/
621 # test-suite.log.txt
622 # osh-as-sh/
623 # apk.txt
624 # tasks.tsv
625 # log/
626 # gzip.log.txt
627 # xz.log.txt
628 # test-suite/
629 # gzip/
630 # test-suite.log.txt
631 # shard1/
632 # ...
633 # shard16/
634 # ...
635
636 local shard_name=$1
637 local a_repo=${2:-main}
638 local epoch=${3:-$APORTS_EPOCH}
639
640 local shard_dir=_chroot/$shard_name
641
642 for config in baseline osh-as-sh; do
643 local dest_dir=$BASE_DIR/$epoch/$shard_name/$config
644 mkdir -p $dest_dir
645 #ls -l $shard_dir/$config
646
647 # Four outputs
648 # 1) log.txt for each package
649 # 2) Optional test-suite.txt for each package
650 # 3) merged tasks.tsv
651 # - comes from .task.tsv
652 # 4) merged apk.txt
653 #
654 # So 3 and 4 should not be merged yet
655 #
656 # _tmp/aports-build/
657 # 2025-11-12/
658 # shardP/
659 # baseline/
660 # log/
661 # test-suite/
662 # apk.txt
663 # tasks.tsv
664 #
665 # We want to
666
667 time python3 devtools/tsv_concat.py \
668 $shard_dir/$config/*/home/udu/oils/_tmp/aports-guest/*.task.tsv > $dest_dir/tasks.tsv
669
670 # Allowed to fail if zero .apk are built
671 time md5sum $shard_dir/$config/*/home/udu/packages/$a_repo/x86_64/*.apk \
672 > $dest_dir/apk.txt 2> /dev/null || true
673
674 abridge-logs $shard_dir/$config $dest_dir
675
676 done
677}
678
679abridge-logs() {
680 local config_src_dir=${1:-_chroot/shardD/osh-as-sh}
681 local dest_dir=${2:-$BASE_DIR/shardD/osh-as-sh}
682
683 local log_dest_dir=$dest_dir/log
684 local test_suite_dest_dir=$dest_dir/test-suite
685 mkdir -p $log_dest_dir $test_suite_dest_dir
686
687 local threshold=$(( 500 * 1000 )) # 500 KB
688
689 # this assumes the build process doesn't create *.log.txt
690 # test-suite.log is the name used by the autotools test runner - we want to save those too
691 # ignore permission errors with || true
692 { find $config_src_dir -name '*.log.txt' -a -printf '%s\t%P\n' 2> /dev/null || true; } |
693 while read -r size path; do
694 local src=$config_src_dir/$path
695 # Remove text until last slash (shortest match)
696 # like $(basename $path) but in bash, for speed
697 local filename=${path##*/}
698 local dest=$log_dest_dir/$filename
699
700 if test "$size" -lt "$threshold"; then
701 cp -v $src $dest
702 else
703 # Bug fix: abriding to 1000 lines isn't sufficient. We got some logs
704 # that were hundreds of MB, with less than 1000 lines!
705 { echo "*** This log is abridged to its last 500 KB:"
706 echo
707 tail --bytes 500000 $src
708 } > $dest
709 fi
710 done
711
712 { find $config_src_dir -name 'test-suite.log' -a -printf '%P\n' 2> /dev/null || true; } |
713 while read -r path; do
714 local src=$config_src_dir/$path
715
716 # Remove text after the first slash (shortest match)
717 local package_name=${path%%/*}
718 local dest=$test_suite_dest_dir/$package_name/test-suite.log.txt
719
720 mkdir -p "$(dirname $dest)"
721 cp -v --no-target-directory $src $dest
722 done
723
724 # 500K threshold: 76 MB
725 du --si -s $log_dest_dir
726}
727
728demo-build() {
729 local pkg=${1:-gzip} # in shardA, uses many cores
730 local do_pin=${2:-}
731
732 local -a prefix
733 if test -n "$do_pin"; then
734 echo "*** Pinning to CPU 0 ***"
735 prefix=( taskset -c 0 )
736 fi
737
738 "${prefix[@]}" $CHROOT_DIR/enter-chroot -u udu sh -c '
739 pkg=$1
740
741 echo "nproc = $(nproc)"
742
743 cd oils
744 set -x
745
746 # Note the user / real ratio! How many cores did we use?
747 time regtest/aports-guest.sh build-one-package $pkg
748 ' dummy0 $pkg
749}
750
751test-taskset() {
752 local pkg=${1:-gzip} # in shardA, uses many cores
753
754 demo-build $pkg ''
755 demo-build $pkg T
756}
757
758test-proc-log() {
759 local out_dir=_tmp/proc-log
760 mkdir -p $out_dir
761
762 regtest/proc_log.py --out-dir $out_dir &
763 local pid=$!
764 sleep 3.1 # should get 3 entries
765 kill $pid
766 wc -l $out_dir/*.txt
767}
768
769task-five "$@"