internal/rosa: early toybox variant
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m52s
Test / Hakurei (push) Successful in 5m6s
Test / ShareFS (push) Successful in 5m15s
Test / Hpkg (push) Successful in 5m55s
Test / Sandbox (race detector) (push) Successful in 6m15s
Test / Hakurei (race detector) (push) Successful in 7m16s
Test / Flake checks (push) Successful in 2m35s

This is a variant of toybox with unfinished tools enabled, for artifacts that will end up in a dependency loop without them.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-30 00:24:14 +09:00
parent 9d9b7294a4
commit 616ed29edf
13 changed files with 62 additions and 19 deletions

View File

@@ -54,6 +54,7 @@ const (
Sed
Setuptools
Toybox
toyboxEarly
Wayland
WaylandProtocols
XCB

View File

@@ -11,6 +11,8 @@ func (t Toolchain) newGit() pkg.Artifact {
)
return t.New("git-"+version, 0, stage3Concat(t, []pkg.Artifact{},
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Perl),
t.Load(M4),
t.Load(Autoconf),

View File

@@ -7,7 +7,7 @@ func (t Toolchain) newMake() pkg.Artifact {
version = "4.4.1"
checksum = "YS_B07ZcAy9PbaK5_vKGj64SrxO2VMpnMKfc9I0Q9IC1rn0RwOH7802pJoj2Mq4a"
)
return t.New("make-"+version, 0, nil, nil, nil, `
return t.New("make-"+version, TEarly, nil, nil, nil, `
cd "$(mktemp -d)"
/usr/src/make/configure \
--prefix=/system \
@@ -31,7 +31,9 @@ func (t Toolchain) newM4() pkg.Artifact {
)
return t.New("m4-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
}, nil, nil, `
cd /usr/src/m4
chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh
@@ -59,6 +61,8 @@ func (t Toolchain) newSed() pkg.Artifact {
return t.New("sed-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
}, nil, nil, `
cd "$(mktemp -d)"
/usr/src/sed/configure \
@@ -85,7 +89,9 @@ func (t Toolchain) newAutoconf() pkg.Artifact {
t.Load(M4),
t.Load(Perl),
t.Load(Bash),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
}, nil, nil, `
cd "$(mktemp -d)"
/usr/src/autoconf/configure \
@@ -112,6 +118,8 @@ func (t Toolchain) newGzip() pkg.Artifact {
)
return t.New("gzip-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
}, nil, nil, `
cd "$(mktemp -d)"
/usr/src/gzip/configure \
@@ -135,7 +143,9 @@ func (t Toolchain) newGettext() pkg.Artifact {
)
return t.New("gettext-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
t.Load(Gzip),
t.Load(Sed),
}, nil, nil, `
@@ -174,7 +184,7 @@ func (t Toolchain) newDiffutils() pkg.Artifact {
version = "3.12"
checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44"
)
return t.New("diffutils-"+version, 0, []pkg.Artifact{
return t.New("diffutils-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
}, nil, nil, `
cd /usr/src/diffutils
@@ -204,7 +214,7 @@ func (t Toolchain) newPatch() pkg.Artifact {
version = "2.8"
checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR"
)
return t.New("patch-"+version, 0, []pkg.Artifact{
return t.New("patch-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
}, nil, nil, `
cd /usr/src/patch
@@ -233,7 +243,7 @@ func (t Toolchain) newBash() pkg.Artifact {
version = "5.3"
checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq"
)
return t.New("bash-"+version, 0, []pkg.Artifact{
return t.New("bash-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
}, nil, nil, `
cd "$(mktemp -d)"
@@ -258,7 +268,7 @@ func (t Toolchain) newCoreutils() pkg.Artifact {
version = "9.9"
checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6"
)
return t.New("coreutils-"+version, 0, []pkg.Artifact{
return t.New("coreutils-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
t.Load(Perl),
t.Load(Bash),
@@ -314,7 +324,7 @@ func (t Toolchain) newGawk() pkg.Artifact {
version = "5.3.2"
checksum = "uIs0d14h_d2DgMGYwrPtegGNyt_bxzG3D6Fe-MmExx_pVoVkQaHzrtmiXVr6NHKk"
)
return t.New("gawk-"+version, 0, []pkg.Artifact{
return t.New("gawk-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
}, nil, nil, `
cd "$(mktemp -d)"
@@ -338,6 +348,9 @@ func (t Toolchain) newFindutils() pkg.Artifact {
)
return t.New("findutils-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
t.Load(XZ),
t.Load(Sed),
}, nil, nil, `

View File

@@ -35,7 +35,7 @@ cd /usr/src/linux
}
func (t Toolchain) newKernelHeaders() pkg.Artifact {
return t.newKernel(0, nil, `
return t.newKernel(TEarly, nil, `
make "-j$(nproc)" \
INSTALL_HDR_PATH=/work/system \
headers_install

View File

@@ -9,6 +9,9 @@ func (t Toolchain) newLibffi() pkg.Artifact {
)
return t.New("libffi-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(KernelHeaders),
}, nil, nil, `
cd "$(mktemp -d)"

View File

@@ -186,6 +186,7 @@ cp -r /system/include /usr/include && rm -rf /system/include
t.Load(Perl),
t.Load(Diffutils),
t.Load(Bash),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Findutils),

View File

@@ -10,6 +10,7 @@ func (t Toolchain) newMksh() pkg.Artifact {
return t.New("mksh-"+version, 0, stage3Concat(t, []pkg.Artifact{},
t.Load(Make),
t.Load(Perl),
t.Load(Coreutils),
), nil, []string{
"LDSTATIC=-static",
}, `

View File

@@ -7,7 +7,7 @@ func (t Toolchain) newPerl() pkg.Artifact {
version = "5.42.0"
checksum = "2KR7Jbpk-ZVn1a30LQRwbgUvg2AXlPQZfzrqCr31qD5-yEsTwVQ_W76eZH-EdxM9"
)
return t.New("perl-"+version, 0, []pkg.Artifact{
return t.New("perl-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
}, nil, nil, `
chmod -R +w /usr/src/perl && cd /usr/src/perl

View File

@@ -35,6 +35,9 @@ func (t Toolchain) newPython() pkg.Artifact {
}
return t.New("python-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Zlib),
t.Load(Libffi),
}, nil, []string{

View File

@@ -178,6 +178,8 @@ var absCureScript = fhs.AbsUsrBin.Append(".cure-script")
const (
// TExclusive denotes an exclusive [pkg.Artifact].
TExclusive = 1 << iota
// TEarly hints for an early variant of [Toybox] to be used when available.
TEarly
)
// New returns a [pkg.Artifact] compiled on this toolchain.
@@ -253,6 +255,10 @@ ln -vs ../usr/bin /work/bin
boot := t - 1
musl, compilerRT, runtimes, clang := boot.NewLLVM()
toybox := Toybox
if flag&TEarly != 0 {
toybox = toyboxEarly
}
support = slices.Concat(extra, []pkg.Artifact{
cureEtc{newIANAEtc()},
musl,
@@ -260,7 +266,7 @@ ln -vs ../usr/bin /work/bin
runtimes,
clang,
boot.Load(Mksh),
boot.Load(Toybox),
boot.Load(toybox),
})
env = fixupEnviron(env, []string{
EnvTriplet + "=" + triplet(),

View File

@@ -7,7 +7,7 @@ func (t Toolchain) newRsync() pkg.Artifact {
version = "3.4.1"
checksum = "VBlTsBWd9z3r2-ex7GkWeWxkUc5OrlgDzikAC0pK7ufTjAJ0MbmC_N04oSVTGPiv"
)
return t.New("rsync-"+version, 0, []pkg.Artifact{
return t.New("rsync-"+version, TEarly, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
}, nil, nil, `

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newToybox() pkg.Artifact {
func (t Toolchain) newToybox(suffix, script string) pkg.Artifact {
const (
version = "0.8.13"
checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"
)
return t.New("toybox-"+version, 0, stage3Concat(t, []pkg.Artifact{},
return t.New("toybox-"+version+suffix, TEarly, stage3Concat(t, []pkg.Artifact{},
t.Load(Make),
t.Load(Bash),
t.Load(Gzip),
@@ -30,12 +30,7 @@ make defconfig
sed -i \
's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \
.config
echo '
CONFIG_EXPR=y
CONFIG_TR=y
CONFIG_AWK=y
CONFIG_DIFF=y
' >> .config
`+script+`
make \
"-j$(nproc)" \
LDFLAGS="${LDFLAGS} -static"
@@ -51,4 +46,19 @@ ln -s ../../system/bin/env /work/usr/bin
pkg.TarGzip,
)))
}
func init() { artifactsF[Toybox] = Toolchain.newToybox }
func init() {
artifactsF[Toybox] = func(t Toolchain) pkg.Artifact {
return t.newToybox("", "")
}
artifactsF[toyboxEarly] = func(t Toolchain) pkg.Artifact {
return t.newToybox("-early", `
echo '
CONFIG_EXPR=y
CONFIG_TR=y
CONFIG_AWK=y
CONFIG_DIFF=y
' >> .config
`)
}
}

View File

@@ -9,6 +9,9 @@ func (t Toolchain) newXZ() pkg.Artifact {
)
return t.New("xz-"+version, 0, []pkg.Artifact{
t.Load(Make),
t.Load(Gawk),
t.Load(Coreutils),
t.Load(Diffutils),
}, nil, nil, `
cd "$(mktemp -d)"
/usr/src/xz/configure \