25 Commits

Author SHA1 Message Date
689f972976 internal/rosa/package: migrate stage0
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m58s
Test / ShareFS (push) Successful in 3m45s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m33s
Test / Hakurei (race detector) (push) Successful in 6m34s
Test / Flake checks (push) Successful in 1m19s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 17:53:05 +09:00
3f33b62dfd internal/rosa/package: migrate system image
All checks were successful
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m43s
Test / Hakurei (push) Successful in 3m56s
Test / Sandbox (race detector) (push) Successful in 5m30s
Test / Hakurei (race detector) (push) Successful in 6m30s
Test / Flake checks (push) Successful in 1m22s
The overlay argument also enables migration of stage0.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 17:44:38 +09:00
ac5488eef6 internal/rosa/package: migrate initramfs image
All checks were successful
Test / Create distribution (push) Successful in 1m3s
Test / Sandbox (push) Successful in 2m53s
Test / ShareFS (push) Successful in 3m48s
Test / Hakurei (push) Successful in 3m52s
Test / Sandbox (race detector) (push) Successful in 5m35s
Test / Hakurei (race detector) (push) Successful in 6m30s
Test / Flake checks (push) Successful in 1m22s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 17:30:39 +09:00
77a15130c7 internal/rosa/package: foot
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m44s
Test / ShareFS (push) Successful in 4m21s
Test / Hakurei (push) Successful in 4m41s
Test / Sandbox (race detector) (push) Successful in 5m53s
Test / Hakurei (race detector) (push) Successful in 3m35s
Test / Flake checks (push) Successful in 1m18s
Used by vm test suite.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:51:32 +09:00
4c1e823908 internal/rosa/package: fcft
All checks were successful
Test / Create distribution (push) Successful in 1m6s
Test / Sandbox (push) Successful in 2m53s
Test / ShareFS (push) Successful in 3m46s
Test / Hakurei (push) Successful in 3m51s
Test / Sandbox (race detector) (push) Successful in 5m25s
Test / Hakurei (race detector) (push) Successful in 6m29s
Test / Flake checks (push) Successful in 1m32s
Required by foot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:45:42 +09:00
5f5a398a5b internal/rosa/package: utf8proc
All checks were successful
Test / Create distribution (push) Successful in 1m11s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 4m6s
Test / Sandbox (race detector) (push) Successful in 5m36s
Test / Hakurei (race detector) (push) Successful in 6m47s
Test / Hakurei (push) Successful in 2m47s
Test / Flake checks (push) Successful in 1m25s
Required by foot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:35:38 +09:00
d5e4a2e6a7 internal/rosa/package: tllist
All checks were successful
Test / Create distribution (push) Successful in 1m11s
Test / Sandbox (push) Successful in 2m57s
Test / Hakurei (push) Successful in 4m8s
Test / ShareFS (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 5m34s
Test / Hakurei (race detector) (push) Successful in 6m47s
Test / Flake checks (push) Successful in 1m21s
Required by foot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:35:24 +09:00
57c6b84b60 internal/rosa/package: fontconfig
All checks were successful
Test / Create distribution (push) Successful in 1m7s
Test / Sandbox (push) Successful in 2m58s
Test / ShareFS (push) Successful in 4m2s
Test / Sandbox (race detector) (push) Successful in 5m29s
Test / Hakurei (push) Successful in 2m34s
Test / Hakurei (race detector) (push) Successful in 3m32s
Test / Flake checks (push) Successful in 1m22s
Required by foot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:23:06 +09:00
4269627b4b internal/rosa/package: xkbcommon
All checks were successful
Test / Sandbox (push) Successful in 3m2s
Test / Create distribution (push) Successful in 1m6s
Test / ShareFS (push) Successful in 2m47s
Test / Sandbox (race detector) (push) Successful in 3m37s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Hakurei (push) Successful in 2m34s
Test / Flake checks (push) Successful in 1m24s
Required by foot.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 16:22:51 +09:00
d50e3c3d5b internal/rosa/package/glib: 2.88.1 to 2.89.0
All checks were successful
Test / Create distribution (push) Successful in 1m12s
Test / Sandbox (push) Successful in 3m7s
Test / ShareFS (push) Successful in 3m42s
Test / Hakurei (push) Successful in 4m17s
Test / Sandbox (race detector) (push) Successful in 5m12s
Test / Hakurei (race detector) (push) Successful in 6m42s
Test / Flake checks (push) Successful in 1m22s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:33:37 +09:00
eae2890d98 internal/rosa/package/python: trove-classifiers 2026.5.7.17 to 2026.5.22.10
All checks were successful
Test / Create distribution (push) Successful in 1m11s
Test / Sandbox (push) Successful in 3m4s
Test / Hakurei (push) Successful in 4m7s
Test / ShareFS (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 5m33s
Test / Hakurei (race detector) (push) Successful in 6m41s
Test / Flake checks (push) Successful in 1m25s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:33:20 +09:00
f8ebfd71a7 internal/rosa/package/spirv: spirv-headers 1.4.341.0 to 1.4.350.0
All checks were successful
Test / Create distribution (push) Successful in 1m16s
Test / Sandbox (push) Successful in 3m14s
Test / ShareFS (push) Successful in 4m50s
Test / Hakurei (push) Successful in 5m2s
Test / Sandbox (race detector) (push) Successful in 6m5s
Test / Hakurei (race detector) (push) Successful in 7m16s
Test / Flake checks (push) Successful in 1m23s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:32:52 +09:00
dce1a05f6c internal/rosa/package/firmware: 20260410 to 20260519
All checks were successful
Test / Create distribution (push) Successful in 1m18s
Test / Sandbox (push) Successful in 3m12s
Test / Hakurei (push) Successful in 4m57s
Test / ShareFS (push) Successful in 4m53s
Test / Sandbox (race detector) (push) Successful in 6m16s
Test / Hakurei (race detector) (push) Successful in 7m13s
Test / Flake checks (push) Successful in 1m24s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:32:16 +09:00
eff265837c internal/rosa/package/mesa: 26.1.0 to 26.1.1
All checks were successful
Test / Sandbox (race detector) (push) Successful in 5m37s
Test / Create distribution (push) Successful in 1m6s
Test / Sandbox (push) Successful in 3m19s
Test / Hakurei (race detector) (push) Successful in 4m44s
Test / Hakurei (push) Successful in 4m45s
Test / ShareFS (push) Successful in 4m43s
Test / Flake checks (push) Successful in 1m26s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:32:01 +09:00
7d809eb15f internal/rosa/package/nss: 3.123.1 to 3.124
All checks were successful
Test / Create distribution (push) Successful in 1m15s
Test / Sandbox (push) Successful in 3m6s
Test / ShareFS (push) Successful in 4m12s
Test / Hakurei (push) Successful in 4m27s
Test / Sandbox (race detector) (push) Successful in 5m41s
Test / Hakurei (race detector) (push) Successful in 6m49s
Test / Flake checks (push) Successful in 1m25s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:31:36 +09:00
9accc2f961 internal/rosa/package/nss: nspr 4.38.2 to 4.39
All checks were successful
Test / Create distribution (push) Successful in 1m17s
Test / Sandbox (push) Successful in 3m0s
Test / Hakurei (push) Successful in 4m11s
Test / ShareFS (push) Successful in 4m16s
Test / Sandbox (race detector) (push) Successful in 5m49s
Test / Hakurei (race detector) (push) Successful in 6m45s
Test / Flake checks (push) Successful in 1m25s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:31:19 +09:00
e5a4094298 internal/rosa: remove unused helpers
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m45s
Test / ShareFS (push) Successful in 3m36s
Test / Sandbox (race detector) (push) Successful in 5m15s
Test / Hakurei (race detector) (push) Successful in 6m24s
Test / Hakurei (push) Successful in 3m8s
Test / Flake checks (push) Successful in 1m24s
These are no longer needed after migration.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 14:00:18 +09:00
410c4f8bb0 internal/rosa/package/cmake: 4.3.2 to 4.3.3
All checks were successful
Test / Create distribution (push) Successful in 1m14s
Test / ShareFS (push) Successful in 12m31s
Test / Sandbox (push) Successful in 1m37s
Test / Sandbox (race detector) (push) Successful in 2m31s
Test / Hakurei (push) Successful in 2m48s
Test / Hakurei (race detector) (push) Successful in 3m33s
Test / Flake checks (push) Successful in 1m23s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 13:02:23 +09:00
2e23c6d367 internal/rosa/package/kernel: 6.12.87 to 6.12.90
All checks were successful
Test / Create distribution (push) Successful in 1m7s
Test / Sandbox (race detector) (push) Successful in 12m14s
Test / ShareFS (push) Successful in 12m27s
Test / Hakurei (race detector) (push) Successful in 14m26s
Test / Sandbox (push) Successful in 1m28s
Test / Hakurei (push) Successful in 2m28s
Test / Flake checks (push) Successful in 1m27s
Unfortunately this causes rebuilds due to a single io_uring API change.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 13:01:44 +09:00
f5e9a0c04e internal/pkg: destroy new substitution status on fault
All checks were successful
Test / Create distribution (push) Successful in 1m8s
Test / Sandbox (push) Successful in 2m54s
Test / ShareFS (push) Successful in 3m56s
Test / Hakurei (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 5m44s
Test / Hakurei (race detector) (push) Successful in 7m10s
Test / Flake checks (push) Successful in 2m30s
This avoids leaving behind the substitution status path of a faulted cure.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 01:31:13 +09:00
3bd4ef616c internal/pkg: report errors exiting cure
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m51s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m49s
Test / Sandbox (race detector) (push) Successful in 5m23s
Test / Hakurei (race detector) (push) Successful in 6m29s
Test / Flake checks (push) Successful in 1m21s
This makes ongoing errors more obvious when multiple failures occur.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 01:25:42 +09:00
41402fd578 internal/rosa/package/util-linux: 2.42 to 2.42.1
All checks were successful
Test / Create distribution (push) Successful in 1m9s
Test / Sandbox (push) Successful in 2m51s
Test / ShareFS (push) Successful in 3m45s
Test / Hakurei (push) Successful in 3m54s
Test / Sandbox (race detector) (push) Successful in 5m23s
Test / Hakurei (race detector) (push) Successful in 6m34s
Test / Flake checks (push) Successful in 1m21s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-23 01:00:27 +09:00
b47fa1a214 internal/rosa: IR-curable source override
All checks were successful
Test / Hakurei (push) Successful in 4m16s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 1m54s
Test / ShareFS (push) Successful in 2m36s
Test / Sandbox (race detector) (push) Successful in 2m41s
Test / Flake checks (push) Successful in 1m18s
This creates a tarball in-memory for overriding hakurei-source.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-22 22:24:16 +09:00
9e363cb2c9 internal/rosa/go: runtime dependencies for alterative path
All checks were successful
Test / Create distribution (push) Successful in 1m7s
Test / Sandbox (push) Successful in 2m57s
Test / ShareFS (push) Successful in 4m15s
Test / Hakurei (push) Successful in 4m26s
Test / Sandbox (race detector) (push) Successful in 5m46s
Test / Hakurei (race detector) (push) Successful in 6m47s
Test / Flake checks (push) Successful in 1m25s
The GCC toolchain is not dependency-free, so append them here.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-22 13:42:02 +09:00
1389c77022 internal/rosa/package/hakurei: 0.4.2 to 0.4.3
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m47s
Test / Hakurei (push) Successful in 3m48s
Test / ShareFS (push) Successful in 3m46s
Test / Sandbox (race detector) (push) Successful in 5m19s
Test / Hakurei (race detector) (push) Successful in 6m25s
Test / Flake checks (push) Successful in 1m20s
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-22 03:16:56 +09:00
37 changed files with 460 additions and 289 deletions

View File

@@ -64,11 +64,12 @@ func main() {
return
}
e, ok := r.(rosa.LoadError)
if !ok {
switch r.(type) {
case rosa.LoadError, pkg.IRStringError:
log.Fatal(r)
default:
panic(r)
}
log.Fatal(e)
}()
ctx, stop := signal.NotifyContext(context.Background(),
@@ -86,6 +87,7 @@ func main() {
flagLTO bool
flagPT bool
flagSourcePath string
flagCrossOverride int
addr net.UnixAddr
@@ -136,6 +138,12 @@ func main() {
}
}
if flagSourcePath != "" {
if err := rosa.Native().SetSource(os.DirFS(flagSourcePath)); err != nil {
return err
}
}
return nil
}).Flag(
&flagQuiet,
@@ -196,6 +204,10 @@ func main() {
&flagPT,
"parse-time", command.BoolFlag(false),
"Print duration of the initial azalea parse",
).Flag(
&flagSourcePath,
"source", command.StringFlag(""),
"Override hakurei source tree",
)
c.NewCommand(
@@ -427,8 +439,6 @@ func main() {
var (
flagGentoo string
flagChecksum string
flagStage0 bool
)
c.NewCommand(
"stage3",
@@ -490,17 +500,6 @@ func main() {
"("+pkg.Encode(checksum[0].Value())+")",
)
}
if flagStage0 {
if err = cm.Do(func(cache *pkg.Cache) (err error) {
pathname, _, err = cache.Cure(rosa.Native().Std().NewStage0())
return
}); err != nil {
return
}
log.Println(pathname)
}
return
},
).Flag(
@@ -511,10 +510,6 @@ func main() {
&flagChecksum,
"checksum", command.StringFlag(""),
"Checksum of Gentoo stage3 tarball",
).Flag(
&flagStage0,
"stage0", command.BoolFlag(false),
"Create bootstrap stage0 tarball",
)
}

View File

@@ -155,7 +155,7 @@ type TContext struct {
// Target [Artifact] encoded identifier.
ids string
// Pathname status was created at.
statusPath *check.Absolute
statusPath, statusSPath *check.Absolute
// File statusHeader and logs are written to.
status *os.File
// Error value during prepareStatus.
@@ -258,6 +258,11 @@ func (t *TContext) destroy(errP *error) {
), 10),
).String(),
))
if t.statusSPath != nil {
t.cache.checksumMu.Lock()
*errP = errors.Join(*errP, os.Remove(t.statusSPath.String()))
t.cache.checksumMu.Unlock()
}
}
t.status = nil
}
@@ -1923,6 +1928,9 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
}
c.exitCure(a, curesExempt)
if err != nil {
if c.msg.IsVerbose() {
c.msg.Verbosef("cure file %s: %v", reportName(f, id), err)
}
return
}
@@ -1954,7 +1962,7 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
t := TContext{
c.base.Append(dirWork, ids),
c.base.Append(dirTemp, ids),
ids, nil, nil, nil,
ids, nil, nil, nil, nil,
common{ctx, c},
}
switch ca := a.(type) {
@@ -1966,6 +1974,9 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
err = ca.Cure(&t)
c.exitCure(a, curesExempt)
if err != nil {
if c.msg.IsVerbose() {
c.msg.Verbosef("cure trivial %s: %v", reportName(ca, id), err)
}
return
}
break
@@ -2043,16 +2054,25 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
}
err = ca.Cure(&f)
if err == nil && f.status != nil {
statusS := c.base.Append(
dirStatus,
substitutes,
)
c.checksumMu.Lock()
err = os.Link(c.base.Append(
dirStatus,
ids,
).String(), c.base.Append(
dirStatus,
substitutes,
).String())
).String(), statusS.String())
c.checksumMu.Unlock()
if err == nil {
f.statusSPath = statusS
}
}
c.exitCure(a, curesExempt)
if err != nil {
if c.msg.IsVerbose() {
c.msg.Verbosef("cure %s: %v", reportName(ca, id), err)
}
return
}
break
@@ -2101,6 +2121,9 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
Got: gotChecksum,
Want: checksum.Value(),
}
if c.msg.IsVerbose() {
c.msg.Verbosef("validate %s: %v", reportName(a, id), err)
}
return
}

View File

@@ -26,7 +26,7 @@ func (a busyboxBin) Params(*pkg.IContext) {}
// IsExclusive returns false: Cure performs a trivial filesystem write.
func (busyboxBin) IsExclusive() bool { return false }
// Dependencies returns the underlying busybox [pkg.File].
// Dependencies returns the underlying busybox [pkg.FileArtifact].
func (a busyboxBin) Dependencies() []pkg.Artifact {
return []pkg.Artifact{a.bin}
}

View File

@@ -11,7 +11,7 @@ var (
_ninja = H("ninja")
)
// CMakeHelper is the [CMake] build system helper.
// CMakeHelper builds and tests a CMake project with specified CACHE entries.
type CMakeHelper struct {
// Path elements joined with source.
Append []string
@@ -34,7 +34,7 @@ type CMakeHelper struct {
var _ Helper = new(CMakeHelper)
// extra returns a hardcoded slice of [CMake] and [Ninja].
// extra returns the cmake handle alongside either ninja or make.
func (attr *CMakeHelper) extra(int) P {
if attr != nil && attr.Make {
return P{_cmake, _make}

View File

@@ -36,8 +36,3 @@ git \
rm -rf /work/.git
`, resolvconf())
}
// newTagRemote is a helper around NewViaGit for a tag on a git remote.
func (t Toolchain) newTagRemote(url, tag, checksum string) pkg.Artifact {
return t.NewViaGit(url, "refs/tags/"+tag, mustDecode(checksum))
}

View File

@@ -6,14 +6,12 @@ import (
"hakurei.app/internal/pkg"
)
var _go = H("go")
// newGo returns a specific version of the Go toolchain.
func (t Toolchain) newGo(
version, checksum string,
env []string,
script string,
boot pkg.Artifact,
boot ...pkg.Artifact,
) pkg.Artifact {
return t.NewPackage("go", version, newTar(
"https://go.dev/dl/go"+version+".src.tar.gz",
@@ -28,7 +26,7 @@ func (t Toolchain) newGo(
"TMPDIR=/dev/shm/go",
}, env),
Extra: []pkg.Artifact{boot},
Extra: boot,
}, &GenericHelper{
InPlace: true,
Build: `
@@ -72,13 +70,13 @@ func init() {
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
var (
bootstrapEnv []string
bootstrapEarly pkg.Artifact
bootstrapEarly []pkg.Artifact
finalEnv []string
)
switch t.arch {
case "amd64":
bootstrapEarly = t.NewPackage("go", "1.4-bootstrap", newTar(
bootstrapEarly = []pkg.Artifact{t.NewPackage("go", "1.4-bootstrap", newTar(
"https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz",
"8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23",
pkg.TarGzip,
@@ -98,11 +96,11 @@ mkdir -p /var/tmp/
`,
},
_bash,
)
)}
case "arm64", "riscv64":
bootstrapEnv = append(bootstrapEnv, "GOROOT_BOOTSTRAP=/system")
_, bootstrapEarly = t.MustLoad(H("gcc"))
bootstrapEarly = t.Append(bootstrapEarly, H("gcc"))
finalEnv = append(finalEnv, "CGO_ENABLED=0")
default:
@@ -123,7 +121,7 @@ sed -i \
echo \
'type syscallDescriptor = int' >> \
os/rawconn_test.go
`, bootstrapEarly)
`, bootstrapEarly...)
go121 := t.newGo(
"1.21.13",

View File

@@ -1,51 +0,0 @@
package rosa
import (
"hakurei.app/fhs"
"hakurei.app/internal/pkg"
)
func init() {
meta := Metadata{
Name: "system-image",
Description: "Rosa OS system image",
Version: Unversioned,
}
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.New("system.img", TNoToolchain, t.Append(nil,
H("squashfs-tools"),
), nil, nil, `
mksquashfs /mnt/system /work/system.img
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, t.Append(nil,
_musl,
_mksh,
_toybox,
H("kmod"),
H("kernel"),
H("firmware"),
)...))
})
}
func init() {
meta := Metadata{
Name: "initramfs-image",
Description: "Rosa OS initramfs image",
Version: Unversioned,
}
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.New("initramfs", TNoToolchain, t.Append(nil,
_zstd,
H("earlyinit"),
H("gen_init_cpio"),
), nil, nil, `
gen_init_cpio -t 4294967295 -c /usr/src/initramfs | zstd > /work/initramfs.zst
`, pkg.Path(AbsUsrSrc.Append("initramfs"), false, pkg.NewFile("initramfs", []byte(`
dir /dev 0755 0 0
nod /dev/null 0666 0 0 c 1 3
nod /dev/console 0600 0 0 c 5 1
file /init /system/libexec/hakurei/earlyinit 0555 0 0
`))))
})
}

View File

@@ -7,7 +7,7 @@ import (
var _make = H("make")
// MakeHelper is the [Make] build system helper.
// MakeHelper wraps the make program and its surrounding build system.
type MakeHelper struct {
// Do not include default extras.
OmitDefaults bool

View File

@@ -7,7 +7,7 @@ import (
var _meson = H("meson")
// MesonHelper is the [Meson] build system helper.
// MesonHelper builds and tests a meson project.
type MesonHelper struct {
// Runs after setup.
ScriptCompileEarly string

View File

@@ -3,12 +3,12 @@ package cmake {
website = "https://cmake.org";
anitya = 306;
version* = "4.3.2";
version* = "4.3.3";
source = remoteGitHubRelease {
suffix = "Kitware/CMake";
tag = "v"+version;
name = "cmake-"+version+".tar.gz";
checksum = "6QylwRVKletndTSkZTV2YBRwgd_9rUVgav_QW23HpjUgV21AVYZOUOal8tdBDmO7";
checksum = "VS-b6cN4S9hfNv3JOUAbAfI9nh3EeuVwY_IVgUdgq6VKwvfchhXwvvFAUcpZG6Ez";
compress = gzip;
};
patches = [

View File

@@ -0,0 +1,27 @@
package fcft {
description = "a simple library for font loading and glyph rasterization using FontConfig, FreeType and pixman";
website = "https://codeberg.org/dnkl/fcft";
anitya = 143240;
version* = "3.3.3";
source = remoteTar {
url = "https://codeberg.org/dnkl/fcft/archive/"+version+".tar.gz";
checksum = "bMj8OmqtoANRKZWbjHk4WfP09AxJYRbWGqUsm1gRJ_dOFg6gooNbgkDu597PLfz2";
compress = gzip;
};
exec = meson {};
inputs = [
pixman,
fontconfig,
utf8proc,
tllist,
];
runtime = [
pixman,
fontconfig,
utf8proc,
];
}

View File

@@ -3,12 +3,12 @@ package firmware {
website = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
anitya = 141464;
version* = "20260410";
version* = "20260519";
source = remoteGitLab {
domain = "gitlab.com";
suffix = "kernel-firmware/linux-firmware";
ref = version;
checksum = "J8PdQlGqwrivpskPzbL6xacqR6mlKtXpe5RpzFfVzKPAgG81ZRXsc3qrxwdGJbil";
checksum = "l-wBRTWclYnJsgV4qtUV1-UL5Y4nknAPre8CMe0dH7PxtAqbaeudEIM_Fnuj0TCV";
};
// dedup creates temporary file

View File

@@ -0,0 +1,37 @@
package fontconfig {
description = "font configuration and customization library";
website = "https://www.freedesktop.org/wiki/Software/fontconfig";
anitya = 827;
version* = "2.18.0";
source = remoteGitLab {
domain = "gitlab.freedesktop.org";
suffix = "fontconfig/fontconfig";
ref = version;
checksum = "Z-yA7pFiE7cRDxZm32EHUPmeRx-lth2X6uw51aoeLi4BXwNm4iOWT13IGp3YSbNW";
};
exec = make {
generate = "NOCONFIGURE=1 ./autogen.sh";
};
inputs = [
automake,
libtool,
pkg-config,
gettext,
gperf,
gzip,
python,
zlib,
libexpat,
freetype,
];
runtime = [
zlib,
libexpat,
freetype,
];
}

View File

@@ -0,0 +1,28 @@
package foot {
description = "a fast, lightweight and minimalistic Wayland terminal emulator";
website = "https://codeberg.org/dnkl/foot";
anitya = 141611;
version* = "1.27.0";
source = remoteTar {
url = "https://codeberg.org/dnkl/foot/archive/"+version+".tar.gz";
checksum = "E2XIPRD8t-WBBJUebIwChFT8K_85diwdalssUNwnuZBIynPa7rlXro5WCe9v3UlK";
compress = gzip;
};
exec = meson {};
inputs = [
ncurses,
xkbcommon,
tllist,
fcft,
kernel-headers,
];
runtime = [
xkbcommon,
fcft,
];
}

View File

@@ -3,11 +3,11 @@ package glib {
website = "https://developer.gnome.org/glib";
anitya = 10024;
version* = "2.88.1";
version* = "2.89.0";
source = remoteGit {
url = "https://gitlab.gnome.org/GNOME/glib.git";
tag = version;
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX";
checksum = "4FXKhdS3pC98LevYa_h7piRylG86cZ_c9zAtGr78oHodU1ob8rBxGU0hoIZ4nzcA";
};
files = {

View File

@@ -1,61 +0,0 @@
From 2a9aa3b4007a73a6c9d4608cb9a8822247881fd6 Mon Sep 17 00:00:00 2001
From: Ophestra <cat@gensokyo.uk>
Date: Thu, 21 May 2026 23:34:50 +0900
Subject: [PATCH] cmd/dist: include version in release
This makes HAKUREI_VERSION optional during build.
Signed-off-by: Ophestra <cat@gensokyo.uk>
---
cmd/dist/VERSION | 1 +
cmd/dist/main.go | 7 ++++++-
flake.nix | 1 -
3 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 cmd/dist/VERSION
diff --git a/cmd/dist/VERSION b/cmd/dist/VERSION
new file mode 100644
index 00000000..0eec13e4
--- /dev/null
+++ b/cmd/dist/VERSION
@@ -0,0 +1 @@
+v0.4.2
diff --git a/cmd/dist/main.go b/cmd/dist/main.go
index 9ed7f2f8..d876cf83 100644
--- a/cmd/dist/main.go
+++ b/cmd/dist/main.go
@@ -18,8 +18,13 @@ import (
"os/signal"
"path/filepath"
"runtime"
+ "strings"
)
+//go:generate sh -c "git describe --tags > VERSION"
+//go:embed VERSION
+var version string
+
// getenv looks up an environment variable, and returns fallback if it is unset.
func getenv(key, fallback string) string {
if v, ok := os.LookupEnv(key); ok {
@@ -47,7 +52,7 @@ func main() {
verbose := os.Getenv("VERBOSE") != ""
runTests := os.Getenv("HAKUREI_DIST_MAKE") == ""
- version := getenv("HAKUREI_VERSION", "untagged")
+ version = getenv("HAKUREI_VERSION", strings.TrimSpace(version))
prefix := getenv("PREFIX", "/usr")
destdir := getenv("DESTDIR", "dist")
diff --git a/flake.nix b/flake.nix
index 4de35204..09520be2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -139,7 +139,6 @@
GOCACHE="$(mktemp -d)" \
PATH="${pkgs.pkgsStatic.musl.bin}/bin:$PATH" \
DESTDIR="$out" \
- HAKUREI_VERSION="v${hakurei.version}" \
./all.sh
'';
}

View File

@@ -2,11 +2,11 @@ package hakurei-source {
description = "hakurei source tree";
exclude = true;
version* = "0.4.2";
version* = "0.4.3";
output = remoteTar {
url = "https://git.gensokyo.uk/rosa/hakurei/archive/"+
"v"+version+".tar.gz";
checksum = "jadgaOrxv5ABGvzQ_Rk0aPGz7U8K-427TbMhQNQ32scSizEnlR44Pu7NoWYWVZWq";
checksum = "1LqBJIcYcAFTVfydCahOm4hjjKhY953X9ars0eQj32hnpNncWFefuT6OJpZzIlZv";
compress = gzip;
};
}
@@ -17,7 +17,6 @@ package hakurei {
anitya = 388834;
source = hakurei-source;
patches = [ "2a9aa3b4007a73a6c9d4608cb9a8822247881fd6.patch" ];
enterSource = true;
writable = true;
chmod = true;
@@ -84,7 +83,6 @@ package hakurei-dist {
website = "https://hakurei.app";
source = hakurei-source;
patches = [ "2a9aa3b4007a73a6c9d4608cb9a8822247881fd6.patch" ];
enterSource = true;
writable = true;
chmod = true;
@@ -132,7 +130,6 @@ package earlyinit {
exclude = true;
source = hakurei-source;
patches = [ "2a9aa3b4007a73a6c9d4608cb9a8822247881fd6.patch" ];
enterSource = true;
writable = true;
chmod = true;
@@ -146,10 +143,8 @@ package earlyinit {
exec = generic {
inPlace = true;
build = `
mkdir -p /work/system/libexec/hakurei/
echo '# Building earlyinit.'
go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
go build -trimpath -v -o /work/ -ldflags="-s -w
-buildid=
-linkmode external
-extldflags=-static

View File

@@ -0,0 +1,4 @@
dir /dev 0755 0 0
nod /dev/null 0666 0 0 c 1 3
nod /dev/console 0600 0 0 c 5 1
file /init /usr/src/initramfs-image/earlyinit 0555 0 0

View File

@@ -0,0 +1,45 @@
package initramfs-image {
description = "Rosa OS initramfs image";
version = unversioned;
exclude = true;
source = earlyinit;
files = {
"initramfs";
};
exec = generic {
build = "gen_init_cpio "+
"-t 4294967295 "+
"-c /usr/src/initramfs | "+
"zstd > /work/initramfs.zst";
};
inputs = [
zstd,
gen_init_cpio,
];
}
package system-image {
description = "Rosa OS system image";
version = unversioned;
exclude = true;
source = earlyinit;
extra = [
musl,
mksh,
toybox,
kmod,
kernel,
firmware,
];
overlay = "/mnt";
exec = generic {
build = "mksquashfs /mnt/system /work/system.img";
};
inputs = [ squashfs-tools ];
}

View File

@@ -1,16 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.12.87 Kernel Configuration
# Linux/x86 6.12.90 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 22.1.5"
CONFIG_CC_VERSION_TEXT="clang version 22.1.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220105
CONFIG_CLANG_VERSION=220106
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220105
CONFIG_AS_VERSION=220106
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220105
CONFIG_LLD_VERSION=220106
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y

View File

@@ -1,16 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.12.83 Kernel Configuration
# Linux/arm64 6.12.90 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 22.1.4"
CONFIG_CC_VERSION_TEXT="clang version 22.1.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220104
CONFIG_CLANG_VERSION=220106
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220104
CONFIG_AS_VERSION=220106
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220104
CONFIG_LLD_VERSION=220106
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
@@ -13858,7 +13858,9 @@ CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
# CONFIG_DEBUG_INFO_DWARF4 is not set
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_NONE is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
CONFIG_DEBUG_INFO_COMPRESSED_ZSTD=y
# CONFIG_DEBUG_INFO_SPLIT is not set
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048

View File

@@ -1,16 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/riscv 6.12.80 Kernel Configuration
# Linux/riscv 6.12.90 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 22.1.2"
CONFIG_CC_VERSION_TEXT="clang version 22.1.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220102
CONFIG_CLANG_VERSION=220106
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220102
CONFIG_AS_VERSION=220106
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220102
CONFIG_LLD_VERSION=220106
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
@@ -11123,7 +11123,9 @@ CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
# CONFIG_DEBUG_INFO_DWARF4 is not set
# CONFIG_DEBUG_INFO_DWARF5 is not set
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_NONE is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
CONFIG_DEBUG_INFO_COMPRESSED_ZSTD=y
# CONFIG_GDB_SCRIPTS is not set
CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set

View File

@@ -3,11 +3,11 @@ package kernel-source {
website = "https://kernel.org";
exclude = true;
version* = "6.12.87";
version* = "6.12.90";
output = remoteTar {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
"snapshot/linux-"+version+".tar.gz";
checksum = "QTl5teIy0K5KsOLYGHQ3FbnPCZNRH2bySXVzghiOoHDdM3zAcSPUkmdly85lMzHx";
checksum = "l9d_2veqbj3RVDp8L6vhV7j2DOLQtzQUqnzPFuJBR_VD8a3k4mvBQRR1-LE-SWZJ";
compress = gzip;
};
}
@@ -45,9 +45,9 @@ cat \
checksum = arch {
default = "";
amd64 = "lCmBNcMeUmXifg0vecKOPy3GAaFcJSmOPnf3wit9xYTDSTsFADPt1xxUFfmTn1fD";
arm64 = "PlRxp4JzZeMGx7CScRlT1NBzc2NVyJlb8Gm8sa3ofFght9ZT101ZJhcIXiCkHSHM";
riscv64 = "z0MI2uSA31k_HtIsqGoCy-Vcf3mYm_zBDR_jN1tntg2Fdvz6YTwCU9YlHbYnpNbx";
amd64 = "FkIf0_SD4g3mK_VWa9FJURjLS66YmknYTh49uMDlDSnoQpq6BqBymAm47joDwdWi";
arm64 = "bJ6ZLJhDR3K9So9zLh5s31hQPm_27gyl7XDVmCgdvyJGKDnffCKdtlE0HuvEbvye";
riscv64 = "bbZCVNS1ryP-XoW9Gwx3ugvhvOA6d5UuO6gE7-Gv82g_bQN1hk4GG0SXBo-otyqS";
};
inputs = [ rsync ];
}

View File

@@ -1,5 +1,5 @@
#define LINUX_VERSION_CODE 396372
#define LINUX_VERSION_CODE 396378
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
#define LINUX_VERSION_MAJOR 6
#define LINUX_VERSION_PATCHLEVEL 12
#define LINUX_VERSION_SUBLEVEL 84
#define LINUX_VERSION_SUBLEVEL 90

View File

@@ -4,12 +4,12 @@ package mesa {
anitya = 1970;
latest = anityaFallback;
version* = "26.1.0";
version* = "26.1.1";
source = remoteGitLab {
domain = "gitlab.freedesktop.org";
suffix = "mesa/mesa";
ref = "mesa-"+version;
checksum = "zU0fjqevySBaoi_5SLW3e2UffmGeBdxOuHmAHTH68n2hV-sjYoqg30koLqFXuk5y";
checksum = "OFCxGSTBe7qbnbVdazIJBNMFaQ-ylD5aRzo-JstSAdA0-hvVdRwsZiovMBm2rMzp";
};
exec = meson {

View File

@@ -3,11 +3,11 @@ package nspr {
anitya = 7953;
exclude = true;
version* = "4.38.2";
version* = "4.39";
output = remoteTar {
url = "https://ftp.mozilla.org/pub/nspr/releases/v"+version+
"/src/nspr-"+version+".tar.gz";
checksum = "BcKpVmN6bdBaoZyzht_SpGHnO1CRN5YHeVyWW2skfCKIdhy3ppKe1zMh85QBEsV_";
checksum = "lgIlqiItMBCRTuz8griNqxtJzNBAoZU1020EVR94X2IiZpJ-NgLXouF7m1knNlDs";
compress = gzip;
};
}
@@ -17,7 +17,7 @@ package nss {
website = "https://firefox-source-docs.mozilla.org/security/nss/index.html";
anitya = 2503;
version* = "3.123.1";
version* = "3.124";
source = remoteGitHub {
suffix = "nss-dev/nss";
tag = "NSS_"+join {
@@ -28,7 +28,7 @@ package nss {
};
sep = "_";
}+"_RTM";
checksum = "g811Z_fc74ssg-s6BeXRG-ipSfJggD6hrxjVJxrOBIz98CE7piv0OLwzIRLMQpwR";
checksum = "p_TFOmKxMVV-ZHRY0QwzEReUOxSRjEExpWIuoA3Bzxj50uNCS8EgqfzcpaiGAkr6";
};
extra = [ nspr ];

View File

@@ -252,11 +252,11 @@ package python-trove-classifiers {
website = "https://pypi.org/p/trove-classifiers";
anitya = 88298;
version* = "2026.5.7.17";
version* = "2026.5.22.10";
source = remoteGitHub {
suffix = "pypa/trove-classifiers";
tag = version;
checksum = "1Fcps0gK9P4ofwGL8MISN9k1Q40-quxX7NDpIna50TmziBNrZy-0Vz0I9yIeHCoP";
checksum = "PgFh58qkPCee5SIN62a_8s5kYRrydXODZEqeSgMJItiLrT5kaz8senRGn5B1Hv56";
};
exec = pip {

View File

@@ -5,11 +5,11 @@ package spirv-headers {
// upstream changed version scheme, anitya incapable of filtering them
latest = anityaFilterSPIRV;
version* = "1.4.341.0";
version* = "1.4.350.0";
source = remoteGitHub {
suffix = "KhronosGroup/SPIRV-Headers";
tag = "vulkan-sdk-"+version;
checksum = "0PL43-19Iaw4k7_D8J8BvoJ-iLgCVSYZ2ThgDPGfAJwIJFtre7l0cnQtLjcY-JvD";
checksum = "wFCZquDVL4HoE-kWbS_BHHb_d71EYR2A2kVp08oDutektpnQzhDP89wo821GgcpG";
};
exec = cmake {

View File

@@ -1,5 +1,31 @@
package stage0-dist {
package rosa-stage0 {
description = "Rosa OS stage0 bootstrap seed";
version = unversioned;
exclude = true;
source = hakurei-source;
extra = [
llvm,
mksh,
toybox-early,
];
overlay = "/stage0";
exec = generic {
build = `
umask 377
tar \
-vjc \
-C /stage0 \
-f /work/stage0-`+triple+`.tar.bz2 \
.
`;
};
inputs = [ bzip2 ];
}
package stage0-dist {
description = "Rosa OS stage0 bootstrap seed (binary distribution)";
exclude = true;
version* = "20260504";

View File

@@ -0,0 +1,14 @@
package tllist {
description = "a C header file only implementation of a typed linked list";
website = "https://codeberg.org/dnkl/tllist";
anitya = 141661;
version* = "1.1.0";
source = remoteTar {
url = "https://codeberg.org/dnkl/tllist/archive/"+version+".tar.gz";
checksum = "EEgawChPB8hO7mW9dAzakBGWSRnrgK8pWhCF7Z5F_ycYEqOXxJPCWq6mFUi95U9d";
compress = gzip;
};
exec = meson {};
}

View File

@@ -0,0 +1,18 @@
package utf8proc {
description = "a clean C library for processing UTF-8 Unicode data";
website = "https://juliastrings.github.io/utf8proc";
anitya = 7455;
version* = "2.11.3";
source = remoteGitHub {
suffix = "JuliaStrings/utf8proc";
tag = "v"+version;
checksum = "LlmejkymQEhaMciSE17JSl3pAYdf6DdXNr0ucwclClsMCeq7l1dcgIJl1JmNTQVq";
};
exec = cmake {
cache = {
"UTF8PROC_ENABLE_TESTING": "ON";
};
};
}

View File

@@ -5,7 +5,7 @@ package util-linux {
// release candidates confuse Anitya
latest = anityaFallback;
version* = "2.42";
version* = "2.42.1";
source = remoteTar {
url = "https://www.kernel.org/pub/linux/utils/util-linux/"+
"v"+join {
@@ -19,7 +19,7 @@ package util-linux {
};
sep = ".";
}+"/util-linux-"+version+".tar.gz";
checksum = "Uy8Nxg9DsW5YwDoeaZeZTyQJ2YmnaaL_fSsQXsLUiFFUd7wnZeD_3SEaVO7ClJlk";
checksum = "f1c006mnFL9jTEsqnJn08hHqwcL8TpjCJNIToZNuGEPsLmEdNL87r8RzBT-nl9QB";
compress = gzip;
};

View File

@@ -0,0 +1,38 @@
package xkbcommon {
description = "a library implementing the XKB specification for handling keyboard descriptions";
website = "https://xkbcommon.org";
anitya = 1780;
version* = "1.13.1";
source = remoteGitHub {
suffix = "xkbcommon/libxkbcommon";
tag = "xkbcommon-"+version;
checksum = "8L8-d1OT9vmCTR6y0fpG7IsSjelAdtDcaD9PRk7--49uEW5ZybD1-bniCxsQU_8Q";
};
env = [
"HOME=/proc/nonexistent",
];
exec = meson {
setup = {
"Denable-x11": "false";
};
};
inputs = [
m4,
bison,
libxml2,
wayland,
wayland-protocols,
xkeyboard-config,
];
runtime = [
libxml2,
wayland,
wayland-protocols,
];
}

View File

@@ -1,14 +1,8 @@
package rosa
import (
"slices"
"hakurei.app/internal/pkg"
)
var _perl = H("perl")
// MakeMakerHelper is the [Perl] MakeMaker helper.
// MakeMakerHelper builds projects using the included MakeMaker script.
type MakeMakerHelper struct {
// Whether to skip the check target.
SkipCheck bool
@@ -49,17 +43,3 @@ make \
script += "make DESTDIR=/work install\n"
return script
}
// newViaPerlMakeMaker installs a perl module via Makefile.PL.
func (t Toolchain) newViaPerlMakeMaker(
name, version string,
source pkg.Artifact,
patches []KV,
extra ...ArtifactH,
) pkg.Artifact {
return t.NewPackage("perl-"+name, version, source, &PackageAttr{
Patches: patches,
}, (*MakeMakerHelper)(nil), slices.Concat(extra, P{
_perl,
})...)
}

View File

@@ -1,17 +1,11 @@
package rosa
import (
"slices"
"hakurei.app/internal/pkg"
)
var (
_python = H("python")
_pythonPyTest = H("python-pytest")
)
// PipHelper is the [Python] pip packaging helper.
// PipHelper installs python packages from source using pip.
type PipHelper struct {
// Path elements joined with source.
Append []string
@@ -94,27 +88,3 @@ pip3 install \
'` + sourcePath.String() + `'
` + script
}
// newPythonPackage registers a new [Python] package.
func (s *S) newPythonPackage(
name string, id int, description, website, version string,
source pkg.Artifact, attrP *PackageAttr, attr *PipHelper,
build P, extra ...ArtifactH,
) {
name = "python-" + name
s.MustRegister(name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &Metadata{
Name: name,
Description: description,
Website: website,
Version: version,
Dependencies: slices.Concat(P{_python}, extra),
ID: id,
}, t.NewPackage(name, version, source, attrP, attr, slices.Concat(
extra,
build,
)...)
})
}

View File

@@ -111,7 +111,7 @@ const (
stageIntermediateGentoo
// stageStdGentoo is like Std, but bootstrapped from stageGentoo. This
// toolchain creates the first [Stage0] distribution.
// toolchain creates the first stage0 distribution.
stageStdGentoo
// stageEarly denotes the stage0 toolchain. Special care must be taken
@@ -322,24 +322,6 @@ mkdir -vp /work/system/bin
)
}
// NewStage0 returns a [pkg.Artifact] curing to a stage0 distribution.
func (t Toolchain) NewStage0() pkg.Artifact {
return t.New("stage0", 0, t.Append(nil,
H("bzip2"),
), nil, nil, `
umask 377
tar \
-vjc \
-C /stage0 \
-f /work/stage0-`+t.triple()+`.tar.bz2 \
.
`, pkg.Path(fhs.AbsRoot.Append("stage0"), false, t.Append(nil,
_llvm,
_mksh,
_toyboxEarly,
)...))
}
// HasStageEarly returns whether a stage0 distribution is available.
func (s *S) HasStageEarly() (ok bool) {
func() {

View File

@@ -1,6 +1,9 @@
package rosa
import (
"archive/tar"
"bytes"
"compress/gzip"
"context"
"encoding/json"
"errors"
@@ -408,7 +411,7 @@ func (s *S) Collect() (handles P) {
type deferredGit struct {
url string
tag string
checksum string
checksum pkg.Checksum
}
// getFrame must be called before accessing s.
@@ -658,13 +661,15 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var a deferredGit
var checksum string
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("url"): &a.url,
k("tag"): &a.tag,
k("checksum"): &a.checksum,
k("checksum"): &checksum,
}); err != nil {
return
}
a.checksum = mustDecode(checksum)
v = a
set = true
return
@@ -927,6 +932,7 @@ func (ctx *evalContext) pf(
output pkg.Artifact
sourceA any
helper Helper
overlay string
inputs, runtimes, extra azalea.Array
)
@@ -955,6 +961,7 @@ func (ctx *evalContext) pf(
k("inputs"): &inputs,
k("runtime"): &runtimes,
k("extra"): &extra,
k("overlay"): &overlay,
}); err != nil {
return
}
@@ -986,13 +993,26 @@ func (ctx *evalContext) pf(
})
}
for _, h := range extraH {
_, a := ctx.t.MustLoad(h)
attr.Paths = append(attr.Paths, pkg.Path(
AbsUsrSrc.Append("extra", h.String()),
attr.Writable,
a,
))
if overlay == "" {
for _, h := range extraH {
_, a := ctx.t.MustLoad(h)
attr.Paths = append(attr.Paths, pkg.Path(
AbsUsrSrc.Append("extra", h.String()),
attr.Writable,
a,
))
}
} else {
var o pkg.ExecPath
if o.P, err = check.NewAbs(overlay); err != nil {
o.P = AbsUsrSrc.Append("extra", overlay)
}
o.A = make([]pkg.Artifact, len(extraH))
for i, h := range extraH {
_, a := ctx.t.MustLoad(h)
o.A[i] = a
}
attr.Paths = append(attr.Paths, o)
}
for _, pair := range files {
@@ -1044,7 +1064,7 @@ func (ctx *evalContext) pf(
source = p
case deferredGit:
source = ctx.t.newTagRemote(p.url, p.tag, p.checksum)
source = ctx.t.NewViaGit(p.url, "refs/tags/"+p.tag, p.checksum)
case azalea.Ident:
var _meta *Metadata
@@ -1173,6 +1193,90 @@ func (s *S) RegisterFS(fsys fs.FS) error {
return nil
}
// SetSource overrides the hakurei-source package with a cached tarball of fsys.
// The resulting IR is curable on the daemon. Must not be used concurrently with
// any other method.
func (s *S) SetSource(fsys fs.FS) error {
var buf bytes.Buffer
w, err := gzip.NewWriterLevel(&buf, gzip.BestSpeed)
if err != nil {
return err
}
tw := tar.NewWriter(w)
if err = fs.WalkDir(fsys, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() && d.Name() == ".git" {
return fs.SkipDir
}
var fi fs.FileInfo
if fi, err = d.Info(); err != nil {
return err
}
var linkname string
if fi.Mode()&fs.ModeSymlink != 0 {
if linkname, err = fs.ReadLink(fsys, path); err != nil {
return err
}
}
var h *tar.Header
if h, err = tar.FileInfoHeader(fi, linkname); err != nil {
return err
}
h.Name = path
if err = tw.WriteHeader(h); err != nil {
return err
}
if fi.Mode().IsRegular() {
var f io.ReadCloser
if f, err = fsys.Open(path); err != nil {
return err
}
_, err = io.Copy(tw, f)
if _err := f.Close(); err == nil {
err = _err
}
if err != nil {
return err
}
}
return nil
}); err != nil {
return err
}
if err = tw.Close(); err != nil {
return err
} else if err = w.Close(); err != nil {
return err
}
const name = "hakurei-source"
a := pkg.NewFile("hakurei-src-current.tar.gz", buf.Bytes())
s.artifacts.Store(
H(name),
Artifact(func(t Toolchain) (*Metadata, pkg.Artifact) {
return &Metadata{
Name: name,
Description: "hakurei source tree (current)",
Version: "1.0.0-CURRENT",
Exclude: true,
}, pkg.NewTar(a, pkg.TarGzip)
}),
)
s.DropCaches(s.Arch(), s.Flags())
return nil
}
// SetGentooStage3 sets the Gentoo stage3 tarball url and checksum. It panics
// if given zero values or if these values have already been set.
func (s *S) SetGentooStage3(url string, checksum pkg.Checksum) {