internal/rosa: rename stage0 toolchain
All checks were successful
Test / Create distribution (push) Successful in 1m2s
Test / Sandbox (push) Successful in 1m48s
Test / Sandbox (race detector) (push) Successful in 2m52s
Test / Hakurei (push) Successful in 3m1s
Test / ShareFS (push) Successful in 3m16s
Test / Hakurei (race detector) (push) Successful in 3m58s
Test / Hpkg (push) Successful in 3m57s
Test / Flake checks (push) Successful in 1m48s
All checks were successful
Test / Create distribution (push) Successful in 1m2s
Test / Sandbox (push) Successful in 1m48s
Test / Sandbox (race detector) (push) Successful in 2m52s
Test / Hakurei (push) Successful in 3m1s
Test / ShareFS (push) Successful in 3m16s
Test / Hakurei (race detector) (push) Successful in 3m58s
Test / Hpkg (push) Successful in 3m57s
Test / Flake checks (push) Successful in 1m48s
This is stage0 relative to Rosa OS, and stage3 relative to the toolchain it is compiled on (Gentoo in this case). Referring to the toolchain itself as stage3 is counterintuitive and misleading. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -97,7 +97,7 @@ func (t Toolchain) NewViaCMake(
|
||||
}
|
||||
|
||||
sourcePath := AbsUsrSrc.Append(name)
|
||||
return t.New(name+"-"+variant+"-"+version, attr.Flag, stage3Concat(t, extra,
|
||||
return t.New(name+"-"+variant+"-"+version, attr.Flag, stage0Concat(t, extra,
|
||||
t.Load(CMake),
|
||||
t.Load(Ninja),
|
||||
), nil, slices.Concat([]string{
|
||||
|
||||
@@ -160,7 +160,7 @@ ln -s ld.lld /work/system/bin/ld
|
||||
[2]string{"LIBCXX_USE_COMPILER_RT", "ON"},
|
||||
)
|
||||
|
||||
if t > toolchainStage3 {
|
||||
if t > toolchainStage0 {
|
||||
// libcxxabi fails to compile if c++ headers not prefixed in /usr
|
||||
// is found by the compiler, and doing this is easier than
|
||||
// overriding CXXFLAGS; not using mv here to avoid chown failures
|
||||
@@ -199,7 +199,7 @@ cp -r /system/include /usr/include && rm -rf /system/include
|
||||
|
||||
Paths: attr.paths,
|
||||
Flag: TExclusive,
|
||||
}, stage3Concat(t, attr.extra,
|
||||
}, stage0Concat(t, attr.extra,
|
||||
t.Load(Libffi),
|
||||
t.Load(Python),
|
||||
t.Load(Perl),
|
||||
@@ -233,7 +233,7 @@ func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) {
|
||||
}
|
||||
|
||||
compilerRT = t.newLLVMVariant("compiler-rt", &llvmAttr{
|
||||
env: stage3ExclConcat(t, []string{},
|
||||
env: stage0ExclConcat(t, []string{},
|
||||
"LDFLAGS="+earlyLDFLAGS(false),
|
||||
),
|
||||
cmake: [][2]string{
|
||||
@@ -276,7 +276,7 @@ ln -s \
|
||||
|
||||
musl = t.NewMusl(&MuslAttr{
|
||||
Extra: []pkg.Artifact{compilerRT},
|
||||
Env: stage3ExclConcat(t, []string{
|
||||
Env: stage0ExclConcat(t, []string{
|
||||
"CC=clang",
|
||||
"LIBCC=/system/lib/clang/21/lib/" +
|
||||
triplet() + "/libclang_rt.builtins.a",
|
||||
@@ -288,7 +288,7 @@ ln -s \
|
||||
})
|
||||
|
||||
runtimes = t.newLLVMVariant("runtimes", &llvmAttr{
|
||||
env: stage3ExclConcat(t, []string{},
|
||||
env: stage0ExclConcat(t, []string{},
|
||||
"LDFLAGS="+earlyLDFLAGS(false),
|
||||
),
|
||||
flags: llvmRuntimeLibunwind | llvmRuntimeLibcxx | llvmRuntimeLibcxxABI,
|
||||
@@ -308,7 +308,7 @@ ln -s \
|
||||
|
||||
clang = t.newLLVMVariant("clang", &llvmAttr{
|
||||
flags: llvmProjectClang | llvmProjectLld,
|
||||
env: stage3ExclConcat(t, []string{},
|
||||
env: stage0ExclConcat(t, []string{},
|
||||
"CFLAGS="+earlyCFLAGS,
|
||||
"CXXFLAGS="+earlyCXXFLAGS(),
|
||||
"LDFLAGS="+earlyLDFLAGS(false),
|
||||
|
||||
@@ -36,8 +36,8 @@ type MakeAttr struct {
|
||||
|
||||
// Do not include default extras.
|
||||
OmitDefaults bool
|
||||
// Dependencies not provided by stage3.
|
||||
NonStage3 []pkg.Artifact
|
||||
// Dependencies not provided by stage0.
|
||||
NonStage0 []pkg.Artifact
|
||||
|
||||
// Additional environment variables.
|
||||
Env []string
|
||||
@@ -148,8 +148,8 @@ func (t Toolchain) NewViaMake(
|
||||
panic("cannot remain in root")
|
||||
}
|
||||
|
||||
return t.New(name+"-"+version, attr.Flag, stage3Concat(t,
|
||||
attr.NonStage3,
|
||||
return t.New(name+"-"+version, attr.Flag, stage0Concat(t,
|
||||
attr.NonStage0,
|
||||
finalExtra...,
|
||||
), nil, attr.Env, scriptEarly+`
|
||||
/usr/src/`+name+`/configure \
|
||||
|
||||
@@ -7,7 +7,7 @@ func (t Toolchain) newMksh() pkg.Artifact {
|
||||
version = "59c"
|
||||
checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq"
|
||||
)
|
||||
return t.New("mksh-"+version, 0, stage3Concat(t, []pkg.Artifact{},
|
||||
return t.New("mksh-"+version, 0, stage0Concat(t, []pkg.Artifact{},
|
||||
t.Load(Perl),
|
||||
t.Load(Coreutils),
|
||||
), nil, []string{
|
||||
|
||||
@@ -42,7 +42,7 @@ rmdir -v /work/lib
|
||||
script = ""
|
||||
}
|
||||
|
||||
return t.New("musl-"+version, 0, stage3Concat(t, attr.Extra,
|
||||
return t.New("musl-"+version, 0, stage0Concat(t, attr.Extra,
|
||||
t.Load(Make),
|
||||
t.Load(Coreutils),
|
||||
), nil, slices.Concat([]string{
|
||||
|
||||
@@ -82,11 +82,11 @@ func earlyLDFLAGS(static bool) string {
|
||||
return s
|
||||
}
|
||||
|
||||
// earlyCFLAGS is reference CFLAGS for the stage3 toolchain.
|
||||
// earlyCFLAGS is reference CFLAGS for the stage0 toolchain.
|
||||
const earlyCFLAGS = "-Qunused-arguments " +
|
||||
"-isystem/system/include"
|
||||
|
||||
// earlyCXXFLAGS returns reference CXXFLAGS for the stage3 toolchain
|
||||
// earlyCXXFLAGS returns reference CXXFLAGS for the stage0 toolchain
|
||||
// corresponding to [runtime.GOARCH].
|
||||
func earlyCXXFLAGS() string {
|
||||
return "--start-no-unused-arguments " +
|
||||
@@ -105,12 +105,12 @@ const (
|
||||
// binary distribution. This is for decompressing unsupported formats.
|
||||
toolchainBusybox Toolchain = iota
|
||||
|
||||
// toolchainStage3 denotes the Gentoo stage3 toolchain. Special care must be
|
||||
// taken to compile correctly against this toolchain.
|
||||
toolchainStage3
|
||||
// toolchainStage0 denotes the stage0 toolchain. Special care must be taken
|
||||
// to compile correctly against this toolchain.
|
||||
toolchainStage0
|
||||
|
||||
// toolchainIntermediate denotes the intermediate toolchain compiled against
|
||||
// toolchainStage3. This toolchain should be functionally identical to [Std]
|
||||
// toolchainStage0. This toolchain should be functionally identical to [Std]
|
||||
// and is used to bootstrap [Std].
|
||||
toolchainIntermediate
|
||||
|
||||
@@ -122,19 +122,19 @@ const (
|
||||
_toolchainEnd
|
||||
)
|
||||
|
||||
// stage3Concat concatenates s and values. If the current toolchain is
|
||||
// toolchainStage3, stage3Concat returns s as is.
|
||||
func stage3Concat[S ~[]E, E any](t Toolchain, s S, values ...E) S {
|
||||
if t == toolchainStage3 {
|
||||
// stage0Concat concatenates s and values. If the current toolchain is
|
||||
// toolchainStage0, stage0Concat returns s as is.
|
||||
func stage0Concat[S ~[]E, E any](t Toolchain, s S, values ...E) S {
|
||||
if t == toolchainStage0 {
|
||||
return s
|
||||
}
|
||||
return slices.Concat(s, values)
|
||||
}
|
||||
|
||||
// stage3ExclConcat concatenates s and values. If the current toolchain is not
|
||||
// toolchainStage3, stage3ExclConcat returns s as is.
|
||||
func stage3ExclConcat[S ~[]E, E any](t Toolchain, s S, values ...E) S {
|
||||
if t == toolchainStage3 {
|
||||
// stage0ExclConcat concatenates s and values. If the current toolchain is not
|
||||
// toolchainStage0, stage0ExclConcat returns s as is.
|
||||
func stage0ExclConcat[S ~[]E, E any](t Toolchain, s S, values ...E) S {
|
||||
if t == toolchainStage0 {
|
||||
return slices.Concat(s, values)
|
||||
}
|
||||
return s
|
||||
@@ -208,7 +208,7 @@ func (t Toolchain) New(
|
||||
args[0] = "hush"
|
||||
env = fixupEnviron(env, nil, "/system/bin")
|
||||
|
||||
case toolchainStage3:
|
||||
case toolchainStage0:
|
||||
name += "-boot"
|
||||
var seed string
|
||||
switch runtime.GOARCH {
|
||||
@@ -224,11 +224,11 @@ func (t Toolchain) New(
|
||||
args[0] = "bash"
|
||||
support = slices.Concat([]pkg.Artifact{
|
||||
cureEtc{},
|
||||
toolchainBusybox.New("stage3", 0, nil, nil, nil, `
|
||||
tar -C /work -xf /usr/src/stage3.tar.xz
|
||||
toolchainBusybox.New("stage0", 0, nil, nil, nil, `
|
||||
tar -C /work -xf /usr/src/stage0.tar.xz
|
||||
rm -rf /work/dev/ /work/proc/
|
||||
ln -vs ../usr/bin /work/bin
|
||||
`, pkg.Path(AbsUsrSrc.Append("stage3.tar.xz"), false,
|
||||
`, pkg.Path(AbsUsrSrc.Append("stage0.tar.xz"), false,
|
||||
pkg.NewHTTPGet(
|
||||
nil, "https://basement.gensokyo.uk/seed/"+seed,
|
||||
mustDecode(seed),
|
||||
@@ -328,7 +328,7 @@ cat /usr/src/` + name + `-patches/* | \
|
||||
`
|
||||
aname += "-patched"
|
||||
}
|
||||
return t.New(aname, 0, stage3Concat(t, []pkg.Artifact{},
|
||||
return t.New(aname, 0, stage0Concat(t, []pkg.Artifact{},
|
||||
t.Load(Patch),
|
||||
), nil, nil, script, paths...)
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ func (t Toolchain) newToybox(suffix, script string) pkg.Artifact {
|
||||
version = "0.8.13"
|
||||
checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"
|
||||
)
|
||||
return t.New("toybox-"+version+suffix, TEarly, stage3Concat(t, []pkg.Artifact{},
|
||||
return t.New("toybox-"+version+suffix, TEarly, stage0Concat(t, []pkg.Artifact{},
|
||||
t.Load(Make),
|
||||
t.Load(Bash),
|
||||
t.Load(Gzip),
|
||||
|
||||
t.Load(KernelHeaders),
|
||||
), nil, stage3Concat(t, []string{},
|
||||
), nil, stage0Concat(t, []string{},
|
||||
"ROSA_CHECK=make USER=cure tests",
|
||||
), `
|
||||
ln -s ../system/bin/bash /bin/ || true
|
||||
|
||||
Reference in New Issue
Block a user