OILS / deps / full-rebuild.sh View on Github | oils.pub

105 lines, 48 significant
1#!/usr/bin/env bash
2#
3# Rebuild all OCI containers from scratch
4#
5# Usage:
6# deps/full-rebuild.sh <function name>
7#
8# Examples:
9# deps/full-rebuild.sh soil-all # build boxed wedges; build and push OCI images
10
11: ${LIB_OSH=stdlib/osh}
12source $LIB_OSH/bash-strict.sh
13source $LIB_OSH/task-five.sh
14
15
16# TODO
17# 1. wedge-bootstrap: rename uke0 -> uke
18# - hopefully this fixes the uftrace wedge
19# 2. make deps/wedge.sh boxed builds work with rootless podman
20# - right now deps/image.sh can run rootless
21# 3. migrate to --network none
22# - for wedge builds
23# - for image builds
24# - not sure how it interacts with apt
25# 4. everything with raw crun - requires some other rewrites
26# 5. coarse tree-shaking for task-five.sh, etc.
27
28# MORE WEDGES
29# - uftrace, as mentioned above
30# - test/wild.sh - oil_DEPS ->
31# - ovm-tarball - oil_DEPS -> ../oils.DEPS/wedge/python2-slice
32# - clang binary - contributors use this
33# - benchmarks/osh-runtime files
34# - py3-libs wedge - it has dependencies
35# - py3-libs depends on python3, and on mypy-requirements.txt
36# - uftrace depends on python3 - is it system python3?
37# - other stuff in the release
38# - smoosh tests
39# - spec-compat?
40
41_build-soil-images() {
42 # this excludes the test image
43
44 deps/image.sh list soil | while read -r image; do
45 deps/image.sh build $image T
46 done
47}
48
49build-soil-images() {
50 time _build-soil-images "$@"
51}
52
53push-all-images() {
54 deps/image.sh list | xargs --verbose -n 1 -- deps/image.sh push
55}
56
57download-for-soil() {
58 deps/from-binary.sh download-clang
59 deps/from-tar.sh download-wild
60}
61
62_soil-all() {
63 local resume1=${1:-}
64 local resume2=${2:-}
65 local resume3=${3:-}
66 local resume4=${4:-}
67 local resume5=${5:-}
68
69 if test -z "$resume1"; then
70 download-for-soil
71 fi
72
73 if test -z "$resume2"; then
74 build/deps.sh boxed-clean
75 # TODO: can also rm-oils-crap and _build/wedge/*
76
77 build/deps.sh fetch
78 # 'soil' includes bloaty, uftrace, R-libs
79 build/deps.sh boxed-wedges-2025 soil
80 fi
81
82 if test -z "$resume3"; then
83 # for now, use this /wedge build, because the ../oils.DEPS one has a bug
84 # possibly related to uke0 versus uke user
85 build/deps.sh boxed-uftrace-OLD
86 fi
87
88 if test -z "$resume4"; then
89 # build to populate apt-cache
90 deps/image.sh build wedge-bootstrap-debian-12
91 deps/image.sh build soil-debian-12
92 fi
93
94 if test -z "$resume5"; then
95 build-soil-images
96 fi
97
98 push-all-images
99}
100
101soil-all() {
102 time _soil-all "$@"
103}
104
105task-five "$@"