59 Commits

Author SHA1 Message Date
5c8cd46c02 internal/rosa: update arm64 kernel config
This was not feasible during the bump, now there is a viable toolchain.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 03:17:53 +09:00
2dba550a2b internal/rosa/zlib: 1.3.1 to 1.3.2
This also switches to the CMake build system because upstream broke their old build system.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 02:36:59 +09:00
8c64812b34 internal/rosa: add zlib runtime dependency
For transitioning to dynamically linking zlib.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 02:36:09 +09:00
d1423d980d internal/rosa/cmake: bake in CMAKE_INSTALL_LIBDIR
There is never a good reason to set this to anything else, and the default value of lib64 breaks everything. This did not manifest on LLVM (which the CMake helper was initially written for) because it did not use this value.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 01:20:41 +09:00
104da0f66a internal/rosa/cmake: pass correct prefix
This can change build output similar to autotools --prefix and DESTDIR, but was not clearly indicated to do so.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 01:04:02 +09:00
d996d9fbb7 internal/rosa/cmake: pass parallel argument for make
This uses the default value for each build system, which is parallel for ninja but not for make.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 00:55:58 +09:00
469f97ccc1 internal/rosa/gnu: libiconv 1.18 to 1.19
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-08 00:36:38 +09:00
af7a6180a1 internal/rosa/cmake: optionally use makefile
This breaks the dependency loop in zlib.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 22:47:30 +09:00
03b5c0e20a internal/rosa/tamago: populate Anitya project id
This had to wait quite a while due to Microsoft Github rate-limiting.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 19:37:03 +09:00
6a31fb4fa3 internal/rosa: hakurei 0.3.5 to 0.3.6
This also removes the backport patch.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 18:53:48 +09:00
bae45363bc release: 0.3.6
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 16:32:04 +09:00
2c17d1abe0 cmd/mbf: create report with reasonable perm
Making it inaccessible certainly is not reasonable.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 16:16:47 +09:00
0aa459d1a9 cmd/mbf: check for updates concurrently
Runs much faster this way.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 16:05:16 +09:00
00053e6287 internal/rosa: set User-Agent for Anitya requests
This is cleaner than using the default string.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 16:03:06 +09:00
3a0c020150 internal/rosa/gnu: coreutils 9.9 to 9.10
This breaks two tests, one of them is fixed and the other disabled. Additionally, two fixed tests are re-enabled.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 14:31:03 +09:00
78655f159e internal/rosa/ncurses: use stable Anitya project
The alpine mapping points to ncurses~devel for some reason.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 13:43:38 +09:00
30bb52e380 internal/rosa/x: libXau 1.0.7 to 1.0.12
This also switches to individual releases.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 13:39:48 +09:00
66197ebdb2 internal/rosa/x: xproto 7.0.23 to 7.0.31
This also switches to individual releases.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 13:39:23 +09:00
f7a2744025 internal/rosa/x: util-macros 1.17 to 1.20.2
This also switches to individual releases.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 13:38:54 +09:00
f16b7bfaf0 internal/rosa: do not keep underlying file
No operation require further filesystem interaction for now.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 13:04:06 +09:00
6228cda7ad cmd/mbf: optionally read report in info
This is a useful frontend for the report files before web server is ready.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 02:26:35 +09:00
86c336de88 cmd/mbf: cure status report command
This emits a report stream for the opened cache into the specified file.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 02:20:40 +09:00
ba5d882ef2 internal/rosa: stream format for cure report
This is for efficient cure status retrieval by the package website server.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-07 02:18:00 +09:00
1e0d68a29e internal/pkg: move output buffer to reader
This side is the read end of a pipe and buffering reads from it ended up performing better than buffering one half of the TeeReader (which already goes through the kernel page cache anyway).

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 23:39:12 +09:00
80f2367c16 cmd/mbf: merge status and info commands
This is cleaner, and offers better integration with the work-in-progress report file.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 23:20:00 +09:00
5ea4dae4b8 cmd/mbf: info accept multiple names
This also improves formatting for use with multiple info blocks.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 23:10:43 +09:00
eb1a3918a8 internal/rosa/gnu: texinfo 7.2 to 7.3
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 22:09:00 +09:00
349011a5e6 internal/rosa/perl: compile dynamic libperl
Required by texinfo 7.3.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 22:08:38 +09:00
861249751a internal/rosa/openssl: 3.5.5 to 3.6.1
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:39:52 +09:00
e3445c2a7e internal/rosa/libffi: 3.4.5 to 3.5.2
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:39:25 +09:00
7315e64a8a internal/rosa/ssl: nss 3.120 to 3.121
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:38:41 +09:00
7d74454f6d internal/rosa/python: 3.14.2 to 3.14.3
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:38:17 +09:00
96956c849a internal/rosa/gnu: gawk 5.3.2 to 5.4.0
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:30:37 +09:00
aabdcbba1c internal/rosa/gnu: m4 1.4.20 to 1.4.21
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 21:22:33 +09:00
38cc4a6429 internal/rosa/openssl: check stable versions
This has a bunch of strange malformed tags.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 19:22:41 +09:00
27ef7f81fa internal/rosa/perl: check stable versions
This uses odd-even versioning.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 19:16:07 +09:00
f7888074b9 internal/rosa/util-linux: check stable versions
Anitya appears to get confused when seeing release candidates.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 19:15:16 +09:00
95ffe0429c internal/rosa: overridable version check
For projects with strange versioning practices.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 19:13:55 +09:00
16d0cf04c1 internal/rosa/python: setuptools 80.10.1 to 82.0.0
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 18:40:55 +09:00
6a2b32b48c internal/rosa/libxml2: 2.15.1 to 2.15.2
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 18:36:06 +09:00
c1472fc54d internal/rosa/wayland: 1.24.0 to 1.24.91
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 18:33:26 +09:00
179cf07e48 internal/rosa/git: 2.52.0 to 2.53.0
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 18:32:41 +09:00
c2d2795e2b internal/rosa/libexpat: 2.7.3 to 2.7.4
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 18:22:39 +09:00
2c1d7edd7a internal/rosa/squashfs: 4.7.4 to 4.7.5
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 17:47:23 +09:00
1ee8d09223 internal/rosa/pcre2: 10.43 to 10.47
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 17:46:59 +09:00
7f01cb3d59 internal/rosa/gtk: glib 2.86.4 to 2.87.3
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 17:46:32 +09:00
65ae4f57c2 internal/rosa/go: 1.26.0 to 1.26.1
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 17:46:05 +09:00
77110601cc internal/rosa/gnu: binutils 2.45 to 2.46.0
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 17:45:10 +09:00
c5b1949430 internal/rosa/kernel: backport AMD display patches
These reduce stack usage in dml30_ModeSupportAndSystemConfigurationFull enough to fix compile on clang 22.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 16:22:20 +09:00
17805cdfa8 internal/rosa/kernel: 6.12.73 to 6.12.76
Toolchain is broken on arm64 at the moment so the configuration is not updated.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-06 15:01:01 +09:00
9c9befb4c9 internal/rosa/llvm: separate major version
For pathname formatting at compile time.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 22:59:51 +09:00
fcdf9ecee4 internal/rosa/llvm: 21.1.8 to 22.1.0
New patch should not be affected next time.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 22:42:27 +09:00
fbd97b658f cmd/mbf: display metadata
For viewing package metadata before the website is ready.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 22:11:26 +09:00
c93725ac58 internal/rosa: prefix python constants
These have confusing names.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 21:37:06 +09:00
f14ab80253 internal/rosa: populate Anitya project ids
This enables release monitoring for all applicable projects.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 21:32:15 +09:00
9989881dd9 internal/rosa/llvm: populate metadata
This enables use of release monitoring for LLVM.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 21:27:33 +09:00
a36b3ece16 internal/rosa: release monitoring via Anitya
This is much more sustainable than manual package flagging.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 20:57:05 +09:00
75970a5650 internal/rosa: check name uniqueness
This should prevent adding packages with nonunique names.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-05 18:37:55 +09:00
572c99825d Revert "internal/rosa/zlib: 1.3.1 to 1.3.2"
The bump broke elfutils build.

This reverts commit 0eb2bfa12e.
2026-03-05 17:06:15 +09:00
67 changed files with 2184 additions and 204 deletions

View File

@@ -10,6 +10,10 @@ import (
"os/signal"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"syscall"
"time"
"unique"
@@ -129,6 +133,207 @@ func main() {
)
}
{
var (
flagStatus bool
flagReport string
)
c.NewCommand(
"info",
"Display out-of-band metadata of an artifact",
func(args []string) (err error) {
if len(args) == 0 {
return errors.New("info requires at least 1 argument")
}
var r *rosa.Report
if flagReport != "" {
if r, err = rosa.OpenReport(flagReport); err != nil {
return err
}
defer func() {
if closeErr := r.Close(); err == nil {
err = closeErr
}
}()
defer r.HandleAccess(&err)()
}
for i, name := range args {
if p, ok := rosa.ResolveName(name); !ok {
return fmt.Errorf("unknown artifact %q", name)
} else {
var suffix string
if version := rosa.Std.Version(p); version != rosa.Unversioned {
suffix += "-" + version
}
fmt.Println("name : " + name + suffix)
meta := rosa.GetMetadata(p)
fmt.Println("description : " + meta.Description)
if meta.Website != "" {
fmt.Println("website : " +
strings.TrimSuffix(meta.Website, "/"))
}
const statusPrefix = "status : "
if flagStatus {
if r == nil {
var f io.ReadSeekCloser
f, err = cache.OpenStatus(rosa.Std.Load(p))
if err != nil {
if errors.Is(err, os.ErrNotExist) {
fmt.Println(
statusPrefix + "not yet cured",
)
} else {
return
}
} else {
fmt.Print(statusPrefix)
_, err = io.Copy(os.Stdout, f)
if err = errors.Join(err, f.Close()); err != nil {
return
}
}
} else {
status, n := r.ArtifactOf(cache.Ident(rosa.Std.Load(p)))
if status == nil {
fmt.Println(
statusPrefix + "not in report",
)
} else {
fmt.Println("size :", n)
fmt.Print(statusPrefix)
if _, err = os.Stdout.Write(status); err != nil {
return
}
}
}
}
if i != len(args)-1 {
fmt.Println()
}
}
}
return nil
},
).
Flag(
&flagStatus,
"status", command.BoolFlag(false),
"Display cure status if available",
).
Flag(
&flagReport,
"report", command.StringFlag(""),
"Load cure status from this report file instead of cache",
)
}
c.NewCommand(
"report",
"Generate an artifact cure report for the current cache",
func(args []string) (err error) {
var w *os.File
switch len(args) {
case 0:
w = os.Stdout
case 1:
if w, err = os.OpenFile(
args[0],
os.O_CREATE|os.O_EXCL|syscall.O_WRONLY,
0400,
); err != nil {
return
}
defer func() {
closeErr := w.Close()
if err == nil {
err = closeErr
}
}()
default:
return errors.New("report requires 1 argument")
}
if container.Isatty(int(w.Fd())) {
return errors.New("output appears to be a terminal")
}
return rosa.WriteReport(msg, w, cache)
},
)
{
var flagJobs int
c.NewCommand("updates", command.UsageInternal, func([]string) error {
var (
errsMu sync.Mutex
errs []error
n atomic.Uint64
)
w := make(chan rosa.PArtifact)
var wg sync.WaitGroup
for range max(flagJobs, 1) {
wg.Go(func() {
for p := range w {
meta := rosa.GetMetadata(p)
if meta.ID == 0 {
continue
}
v, err := meta.GetVersions(ctx)
if err != nil {
errsMu.Lock()
errs = append(errs, err)
errsMu.Unlock()
continue
}
if current, latest :=
rosa.Std.Version(p),
meta.GetLatest(v); current != latest {
n.Add(1)
log.Printf("%s %s < %s", meta.Name, current, latest)
continue
}
msg.Verbosef("%s is up to date", meta.Name)
}
})
}
done:
for i := range rosa.PresetEnd {
select {
case w <- rosa.PArtifact(i):
break
case <-ctx.Done():
break done
}
}
close(w)
wg.Wait()
if v := n.Load(); v > 0 {
errs = append(errs, errors.New(strconv.Itoa(int(v))+
" package(s) are out of date"))
}
return errors.Join(errs...)
}).
Flag(
&flagJobs,
"j", command.IntFlag(32),
"Maximum number of simultaneous connections",
)
}
{
var (
flagGentoo string
@@ -261,30 +466,6 @@ func main() {
)
}
c.NewCommand(
"status",
"Display the status file of an artifact",
func(args []string) error {
if len(args) != 1 {
return errors.New("status requires 1 argument")
}
if p, ok := rosa.ResolveName(args[0]); !ok {
return fmt.Errorf("unknown artifact %q", args[0])
} else {
r, err := cache.OpenStatus(rosa.Std.Load(p))
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return errors.New(args[0] + " was never cured")
}
return err
}
_, err = io.Copy(os.Stdout, r)
return errors.Join(err, r.Close())
}
},
)
{
var (
flagNet bool
@@ -426,6 +607,16 @@ func main() {
if cache != nil {
cache.Close()
}
log.Fatal(err)
if w, ok := err.(interface{ Unwrap() []error }); !ok {
log.Fatal(err)
} else {
errs := w.Unwrap()
for i, e := range errs {
if i == len(errs)-1 {
log.Fatal(e)
}
log.Println(e)
}
}
})
}

View File

@@ -440,28 +440,23 @@ func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
}
}()
bw := f.cache.getWriter(status)
brStdout, brStderr := f.cache.getReader(stdout), f.cache.getReader(stderr)
stdoutDone, stderrDone := make(chan struct{}), make(chan struct{})
go scanVerbose(
msg, cancel, stdoutDone,
"("+a.name+":1)",
io.TeeReader(stdout, bw),
io.TeeReader(brStdout, status),
)
go scanVerbose(
msg, cancel, stderrDone,
"("+a.name+":2)",
io.TeeReader(stderr, bw),
io.TeeReader(brStderr, status),
)
defer func() {
<-stdoutDone
<-stderrDone
flushErr := bw.Flush()
if err == nil {
err = flushErr
}
f.cache.putWriter(bw)
f.cache.putReader(brStdout)
f.cache.putReader(brStderr)
}()
} else {
z.Stdout, z.Stderr = status, status

View File

@@ -71,6 +71,8 @@ func init() {
Name: "attr",
Description: "Commands for Manipulating Filesystem Extended Attributes",
Website: "https://savannah.nongnu.org/projects/attr/",
ID: 137,
}
}
@@ -98,5 +100,7 @@ func init() {
Name: "acl",
Description: "Commands for Manipulating POSIX Access Control Lists",
Website: "https://savannah.nongnu.org/projects/acl/",
ID: 16,
}
}

View File

@@ -1,6 +1,11 @@
package rosa
import (
"context"
"encoding/json"
"errors"
"net/http"
"strconv"
"sync"
"hakurei.app/internal/pkg"
@@ -10,8 +15,12 @@ import (
type PArtifact int
const (
LLVMCompilerRT PArtifact = iota
LLVMRuntimes
LLVMClang
// ImageInitramfs is the Rosa OS initramfs archive.
ImageInitramfs PArtifact = iota
ImageInitramfs
// Kernel is the generic Rosa OS Linux kernel.
Kernel
@@ -52,7 +61,6 @@ const (
Gzip
Hakurei
HakureiDist
IniConfig
Kmod
LibXau
Libcap
@@ -80,7 +88,6 @@ const (
Ninja
OpenSSL
PCRE2
Packaging
Patch
Perl
PerlLocaleGettext
@@ -94,11 +101,13 @@ const (
PerlUnicodeGCString
PerlYAMLTiny
PkgConfig
Pluggy
Procps
PyTest
Pygments
Python
PythonIniConfig
PythonPackaging
PythonPluggy
PythonPyTest
PythonPygments
QEMU
Rsync
Sed
@@ -152,11 +161,79 @@ type Metadata struct {
Description string `json:"description"`
// Project home page.
Website string `json:"website,omitempty"`
// Project identifier on [Anitya].
//
// [Anitya]: https://release-monitoring.org/
ID int `json:"-"`
// Optional custom version checking behaviour.
latest func(v *Versions) string
}
// GetLatest returns the latest version described by v.
func (meta *Metadata) GetLatest(v *Versions) string {
if meta.latest != nil {
return meta.latest(v)
}
return v.Latest
}
// Unversioned denotes an unversioned [PArtifact].
const Unversioned = "\x00"
// UnpopulatedIDError is returned by [Metadata.GetLatest] for an instance of
// [Metadata] where ID is not populated.
type UnpopulatedIDError struct{}
func (UnpopulatedIDError) Unwrap() error { return errors.ErrUnsupported }
func (UnpopulatedIDError) Error() string { return "Anitya ID is not populated" }
// Versions are package versions returned by Anitya.
type Versions struct {
// The latest version for the project, as determined by the version sorting algorithm.
Latest string `json:"latest_version"`
// List of all versions that arent flagged as pre-release.
Stable []string `json:"stable_versions"`
// List of all versions stored, sorted from newest to oldest.
All []string `json:"versions"`
}
// getStable returns the first Stable version, or Latest if that is unavailable.
func (v *Versions) getStable() string {
if len(v.Stable) == 0 {
return v.Latest
}
return v.Stable[0]
}
// GetVersions returns versions fetched from Anitya.
func (meta *Metadata) GetVersions(ctx context.Context) (*Versions, error) {
if meta.ID == 0 {
return nil, UnpopulatedIDError{}
}
var resp *http.Response
if req, err := http.NewRequestWithContext(
ctx,
http.MethodGet,
"https://release-monitoring.org/api/v2/versions/?project_id="+
strconv.Itoa(meta.ID),
nil,
); err != nil {
return nil, err
} else {
req.Header.Set("User-Agent", "Rosa/1.1")
if resp, err = http.DefaultClient.Do(req); err != nil {
return nil, err
}
}
var v Versions
err := json.NewDecoder(resp.Body).Decode(&v)
return &v, errors.Join(err, resp.Body.Close())
}
var (
// artifactsM is an array of [PArtifact] metadata.
artifactsM [PresetEnd]Metadata

View File

@@ -51,3 +51,16 @@ func TestResolveNameUnexported(t *testing.T) {
})
}
}
func TestUnique(t *testing.T) {
t.Parallel()
names := make(map[string]struct{})
for i := range rosa.PresetEnd {
name := rosa.GetMetadata(rosa.PArtifact(i)).Name
if _, ok := names[name]; ok {
t.Fatalf("name %s is not unique", name)
}
names[name] = struct{}{}
}
}

View File

@@ -32,5 +32,7 @@ func init() {
Name: "bzip2",
Description: "a freely available, patent free, high-quality data compressor",
Website: "https://sourceware.org/bzip2/",
ID: 237,
}
}

View File

@@ -111,6 +111,8 @@ func init() {
Name: "cmake",
Description: "cross-platform, open-source build system",
Website: "https://cmake.org/",
ID: 306,
}
}
@@ -126,6 +128,9 @@ type CMakeHelper struct {
Cache [][2]string
// Runs after install.
Script string
// Whether to generate Makefile instead.
Make bool
}
var _ Helper = new(CMakeHelper)
@@ -139,7 +144,10 @@ func (attr *CMakeHelper) name(name, version string) string {
}
// extra returns a hardcoded slice of [CMake] and [Ninja].
func (*CMakeHelper) extra(int) []PArtifact {
func (attr *CMakeHelper) extra(int) []PArtifact {
if attr != nil && attr.Make {
return []PArtifact{CMake, Make}
}
return []PArtifact{CMake, Ninja}
}
@@ -171,11 +179,19 @@ func (attr *CMakeHelper) script(name string) string {
panic("CACHE must be non-empty")
}
generate := "Ninja"
jobs := ""
if attr.Make {
generate = "'Unix Makefiles'"
jobs += ` "--parallel=$(nproc)"`
}
return `
cmake -G Ninja \
cmake -G ` + generate + ` \
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
-DCMAKE_CXX_COMPILER_TARGET="${ROSA_TRIPLE}" \
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
-DCMAKE_INSTALL_LIBDIR=lib \
` + strings.Join(slices.Collect(func(yield func(string) bool) {
for _, v := range attr.Cache {
if !yield("-D" + v[0] + "=" + v[1]) {
@@ -183,9 +199,9 @@ cmake -G Ninja \
}
}
}), " \\\n\t") + ` \
-DCMAKE_INSTALL_PREFIX=/work/system \
-DCMAKE_INSTALL_PREFIX=/system \
'/usr/src/` + name + `/` + path.Join(attr.Append...) + `'
cmake --build .
cmake --install .
cmake --build .` + jobs + `
cmake --install . --prefix=/work/system
` + attr.Script
}

View File

@@ -34,5 +34,7 @@ func init() {
Name: "curl",
Description: "command line tool and library for transferring data with URLs",
Website: "https://curl.se/",
ID: 381,
}
}

View File

@@ -37,5 +37,7 @@ func init() {
Name: "dtc",
Description: "The Device Tree Compiler",
Website: "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/",
ID: 16911,
}
}

View File

@@ -45,5 +45,7 @@ func init() {
Name: "elfutils",
Description: "utilities and libraries to handle ELF files and DWARF data",
Website: "https://sourceware.org/elfutils/",
ID: 5679,
}
}

View File

@@ -55,5 +55,7 @@ func init() {
Name: "fakeroot",
Description: "tool for simulating superuser privileges",
Website: "https://salsa.debian.org/clint/fakeroot",
ID: 12048,
}
}

View File

@@ -25,5 +25,7 @@ func init() {
Name: "flex",
Description: "scanner generator for lexing in C and C++",
Website: "https://github.com/westes/flex/",
ID: 819,
}
}

View File

@@ -24,11 +24,11 @@ func (t Toolchain) newFuse() (pkg.Artifact, string) {
// this project uses pytest
SkipTest: true,
},
IniConfig,
Packaging,
Pluggy,
Pygments,
PyTest,
PythonIniConfig,
PythonPackaging,
PythonPluggy,
PythonPygments,
PythonPyTest,
KernelHeaders,
), version
@@ -40,5 +40,7 @@ func init() {
Name: "fuse",
Description: "the reference implementation of the Linux FUSE interface",
Website: "https://github.com/libfuse/libfuse/",
ID: 861,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newGit() (pkg.Artifact, string) {
const (
version = "2.52.0"
checksum = "uH3J1HAN_c6PfGNJd2OBwW4zo36n71wmkdvityYnrh8Ak0D1IifiAvEWz9Vi9DmS"
version = "2.53.0"
checksum = "rlqSTeNgSeVKJA7nvzGqddFH8q3eFEPB4qRZft-4zth8wTHnbTbm7J90kp_obHGm"
)
return t.NewPackage("git", version, pkg.NewHTTPGetTar(
nil, "https://www.kernel.org/pub/software/scm/git/"+
@@ -72,6 +72,8 @@ func init() {
Name: "git",
Description: "distributed version control system",
Website: "https://www.git-scm.com/",
ID: 5350,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newM4() (pkg.Artifact, string) {
const (
version = "1.4.20"
checksum = "RT0_L3m4Co86bVBY3lCFAEs040yI1WdeNmRylFpah8IZovTm6O4wI7qiHJN3qsW9"
version = "1.4.21"
checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm"
)
return t.NewPackage("m4", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2",
@@ -18,6 +18,8 @@ chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh
`,
}, (*MakeHelper)(nil),
Diffutils,
KernelHeaders,
), version
}
func init() {
@@ -27,6 +29,8 @@ func init() {
Name: "m4",
Description: "a macro processor with GNU extensions",
Website: "https://www.gnu.org/software/m4/",
ID: 1871,
}
}
@@ -52,6 +56,8 @@ func init() {
Name: "bison",
Description: "a general-purpose parser generator",
Website: "https://www.gnu.org/software/bison/",
ID: 193,
}
}
@@ -75,6 +81,8 @@ func init() {
Name: "sed",
Description: "a non-interactive command-line text editor",
Website: "https://www.gnu.org/software/sed/",
ID: 4789,
}
}
@@ -108,6 +116,8 @@ func init() {
Name: "autoconf",
Description: "M4 macros to produce self-contained configure script",
Website: "https://www.gnu.org/software/autoconf/",
ID: 141,
}
}
@@ -148,6 +158,8 @@ func init() {
Name: "automake",
Description: "a tool for automatically generating Makefile.in files",
Website: "https://www.gnu.org/software/automake/",
ID: 144,
}
}
@@ -177,6 +189,8 @@ func init() {
Name: "libtool",
Description: "a generic library support script",
Website: "https://www.gnu.org/software/libtool/",
ID: 1741,
}
}
@@ -201,6 +215,8 @@ func init() {
Name: "gzip",
Description: "a popular data compression program",
Website: "https://www.gnu.org/software/gzip/",
ID: 1290,
}
}
@@ -245,6 +261,8 @@ func init() {
Name: "gettext",
Description: "tools for producing multi-lingual messages",
Website: "https://www.gnu.org/software/gettext/",
ID: 898,
}
}
@@ -276,6 +294,8 @@ func init() {
Name: "diffutils",
Description: "several programs related to finding differences between files",
Website: "https://www.gnu.org/software/diffutils/",
ID: 436,
}
}
@@ -306,6 +326,8 @@ func init() {
Name: "patch",
Description: "a program to apply diff output to files",
Website: "https://savannah.gnu.org/projects/patch/",
ID: 2597,
}
}
@@ -334,13 +356,15 @@ func init() {
Name: "bash",
Description: "the Bourne Again SHell",
Website: "https://www.gnu.org/software/bash/",
ID: 166,
}
}
func (t Toolchain) newCoreutils() (pkg.Artifact, string) {
const (
version = "9.9"
checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6"
version = "9.10"
checksum = "o-B9wssRnZySzJUI1ZJAgw-bZtj1RC67R9po2AcM2OjjS8FQIl16IRHpC6IwO30i"
)
return t.NewPackage("coreutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz",
@@ -353,12 +377,105 @@ test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh
test_disable '#!/bin/sh' tests/split/line-bytes.sh
test_disable '#!/bin/sh' tests/dd/no-allocate.sh
test_disable '#!/bin/sh' tests/env/env.sh
test_disable '#!/bin/sh' tests/ls/hyperlink.sh
test_disable 'int main(){return 0;}' gnulib-tests/test-chown.c
test_disable 'int main(){return 0;}' gnulib-tests/test-fchownat.c
test_disable 'int main(){return 0;}' gnulib-tests/test-lchown.c
`,
Patches: [][2]string{
{"tests-fix-job-control", `From 21d287324aa43aa3a31f39619ade0deac7fd6013 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Tue, 24 Feb 2026 15:44:41 +0000
Subject: [PATCH] tests: fix job control triggering test termination
This avoids the test harness being terminated like:
make[1]: *** [Makefile:24419: check-recursive] Hangup
make[3]: *** [Makefile:24668: check-TESTS] Hangup
make: *** [Makefile:24922: check] Hangup
make[2]: *** [Makefile:24920: check-am] Hangup
make[4]: *** [Makefile:24685: tests/misc/usage_vs_refs.log] Error 129
...
This happened sometimes when the tests were being run non interactively.
For example when run like:
setsid make TESTS="tests/timeout/timeout.sh \
tests/tail/overlay-headers.sh" SUBDIRS=. -j2 check
Note the race window can be made bigger by adding a sleep
after tail is stopped in overlay-headers.sh
The race can trigger the kernel to induce its job control
mechanism to prevent stuck processes.
I.e. where it sends SIGHUP + SIGCONT to a process group
when it determines that group may become orphaned,
and there are stopped processes in that group.
* tests/tail/overlay-headers.sh: Use setsid(1) to keep the stopped
tail process in a separate process group, thus avoiding any kernel
job control protection mechanism.
* tests/timeout/timeout.sh: Use setsid(1) to avoid the kernel
checking the main process group when sleep(1) is reparented.
Fixes https://bugs.gnu.org/80477
---
tests/tail/overlay-headers.sh | 8 +++++++-
tests/timeout/timeout.sh | 11 ++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/tests/tail/overlay-headers.sh b/tests/tail/overlay-headers.sh
index be9b6a7df..1e6da0a3f 100755
--- a/tests/tail/overlay-headers.sh
+++ b/tests/tail/overlay-headers.sh
@@ -20,6 +20,8 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ tail sleep
+setsid true || skip_ 'setsid required to control groups'
+
# Function to count number of lines from tail
# while ignoring transient errors due to resource limits
countlines_ ()
@@ -54,7 +56,11 @@ echo start > file2 || framework_failure_
env sleep 60 & sleep=$!
# Note don't use timeout(1) here as it currently
-# does not propagate SIGCONT
+# does not propagate SIGCONT.
+# Note use setsid here to ensure we're in a separate process group
+# as we're going to STOP this tail process, and this can trigger
+# the kernel to send SIGHUP to a group if other tests have
+# processes that are reparented. (See tests/timeout/timeout.sh).
tail $fastpoll --pid=$sleep -f file1 file2 > out & pid=$!
# Ensure tail is running
diff --git a/tests/timeout/timeout.sh b/tests/timeout/timeout.sh
index 9a395416b..fbb043312 100755
--- a/tests/timeout/timeout.sh
+++ b/tests/timeout/timeout.sh
@@ -56,9 +56,14 @@ returns_ 124 timeout --foreground -s0 -k1 .1 sleep 10 && fail=1
) || fail=1
# Don't be confused when starting off with a child (Bug#9098).
-out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo')
-status=$?
-test "$out" = "" && test $status = 124 || fail=1
+# Use setsid to avoid sleep being in the test's process group, as
+# upon reparenting it can trigger an orphaned process group SIGHUP
+# (if there were stopped processes in other tests).
+if setsid true; then
+ out=$(setsid sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo')
+ status=$?
+ test "$out" = "" && test $status = 124 || fail=1
+fi
# Verify --verbose output
cat > exp <<\EOF
--
2.53.0
`},
},
Flag: TEarly,
}, &MakeHelper{
Configure: [][2]string{
@@ -378,13 +495,15 @@ func init() {
Name: "coreutils",
Description: "the basic file, shell and text manipulation utilities",
Website: "https://www.gnu.org/software/coreutils/",
ID: 343,
}
}
func (t Toolchain) newTexinfo() (pkg.Artifact, string) {
const (
version = "7.2"
checksum = "9EelM5b7QGMAY5DKrAm_El8lofBGuFWlaBPSBhh7l_VQE8054MBmC0KBvGrABqjv"
version = "7.3"
checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-"
)
return t.NewPackage("texinfo", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz",
@@ -404,6 +523,8 @@ func init() {
Name: "texinfo",
Description: "the GNU square-wheel-reinvension of man pages",
Website: "https://www.gnu.org/software/texinfo/",
ID: 4958,
}
}
@@ -427,13 +548,15 @@ func init() {
Name: "gperf",
Description: "a perfect hash function generator",
Website: "https://www.gnu.org/software/gperf/",
ID: 1237,
}
}
func (t Toolchain) newGawk() (pkg.Artifact, string) {
const (
version = "5.3.2"
checksum = "uIs0d14h_d2DgMGYwrPtegGNyt_bxzG3D6Fe-MmExx_pVoVkQaHzrtmiXVr6NHKk"
version = "5.4.0"
checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C"
)
return t.NewPackage("gawk", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz",
@@ -453,6 +576,8 @@ func init() {
Name: "gawk",
Description: "an implementation of awk with GNU extensions",
Website: "https://www.gnu.org/software/gawk/",
ID: 868,
}
}
@@ -484,6 +609,8 @@ func init() {
Name: "grep",
Description: "searches input for lines containing a match to a pattern",
Website: "https://www.gnu.org/software/grep/",
ID: 1251,
}
}
@@ -514,6 +641,8 @@ func init() {
Name: "findutils",
Description: "the basic directory searching utilities",
Website: "https://www.gnu.org/software/findutils/",
ID: 812,
}
}
@@ -542,13 +671,15 @@ func init() {
Name: "bc",
Description: "an arbitrary precision numeric processing language",
Website: "https://www.gnu.org/software/bc/",
ID: 170,
}
}
func (t Toolchain) newLibiconv() (pkg.Artifact, string) {
const (
version = "1.18"
checksum = "iV5q3VxP5VPdJ-X7O5OQI4fGm8VjeYb5viLd1L3eAHg26bbHb2_Qn63XPF3ucVZr"
version = "1.19"
checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x"
)
return t.NewPackage("libiconv", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz",
@@ -563,6 +694,8 @@ func init() {
Name: "libiconv",
Description: "iconv implementation independent of glibc",
Website: "https://www.gnu.org/software/libiconv/",
ID: 10656,
}
}
@@ -603,13 +736,15 @@ func init() {
Name: "tar",
Description: "provides the ability to create tar archives",
Website: "https://www.gnu.org/software/tar/",
ID: 4939,
}
}
func (t Toolchain) newBinutils() (pkg.Artifact, string) {
const (
version = "2.45"
checksum = "hlLtqqHDmzAT2OQVHaKEd_io2DGFvJkaeS-igBuK8bRRir7LUKGHgHYNkDVKaHTT"
version = "2.46.0"
checksum = "4kK1_EXQipxSqqyvwD4LbiMLFKCUApjq6PeG4XJP4dzxYGqDeqXfh8zLuTyOuOVR"
)
return t.NewPackage("binutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/binutils/binutils-"+version+".tar.bz2",
@@ -626,6 +761,8 @@ func init() {
Name: "binutils",
Description: "a collection of binary tools",
Website: "https://www.gnu.org/software/binutils/",
ID: 7981,
}
}
@@ -650,6 +787,8 @@ func init() {
Name: "gmp",
Description: "a free library for arbitrary precision arithmetic",
Website: "https://gmplib.org/",
ID: 1186,
}
}
@@ -674,6 +813,8 @@ func init() {
Name: "mpfr",
Description: "a C library for multiple-precision floating-point computations",
Website: "https://www.mpfr.org/",
ID: 2019,
}
}
@@ -699,6 +840,8 @@ func init() {
Name: "mpc",
Description: "a C library for the arithmetic of complex numbers",
Website: "https://www.multiprecision.org/",
ID: 1667,
}
}
@@ -911,5 +1054,7 @@ func init() {
Name: "gcc",
Description: "The GNU Compiler Collection",
Website: "https://www.gnu.org/software/gcc/",
ID: 6502,
}
}

View File

@@ -154,8 +154,8 @@ rm \
)
const (
version = "1.26.0"
checksum = "uHLcrgBc0NMcyTMDLRNAZIcOx0RyQlyekSl9xbWSwj3esEFWJysYLfLa3S8p39Nh"
version = "1.26.1"
checksum = "DdC5Ea-aCYPUHNObQh_09uWU0vn4e-8Ben850Vq-5OoamDRrXhuYI4YQ_BOFgaT0"
)
return t.newGo(
version,
@@ -177,5 +177,7 @@ func init() {
Name: "go",
Description: "the Go programming language toolchain",
Website: "https://go.dev/",
ID: 1227,
}
}

View File

@@ -9,8 +9,8 @@ import (
func (t Toolchain) newGLib() (pkg.Artifact, string) {
const (
version = "2.86.4"
checksum = "AfTjBrrxtXXPL6dFa1LfTe40PyPSth62CoIkM5m_VJTUngGLOFHw6I4XE7RGQE8G"
version = "2.87.3"
checksum = "iKSLpzZZVfmAZZmqfO1y6uHdlIks4hzPWrqeUCp4ZeQjrPFA3aAa4OmrBYMNS-Si"
)
return t.NewPackage("glib", version, pkg.NewHTTPGet(
nil, "https://download.gnome.org/sources/glib/"+
@@ -40,7 +40,7 @@ func (t Toolchain) newGLib() (pkg.Artifact, string) {
},
},
XZ,
Packaging,
PythonPackaging,
Bash,
PCRE2,
@@ -54,6 +54,8 @@ func init() {
Name: "glib",
Description: "the GNU library of miscellaneous stuff",
Website: "https://gitlab.gnome.org/GNOME/glib/",
Website: "https://developer.gnome.org/glib/",
ID: 10024,
}
}

View File

@@ -90,6 +90,8 @@ mkdir -p /work/system/bin/
Name: "hakurei",
Description: "low-level userspace tooling for Rosa OS",
Website: "https://hakurei.app/",
ID: 388834,
}
artifactsM[HakureiDist] = Metadata{
f: func(t Toolchain) (pkg.Artifact, string) {

View File

@@ -4,48 +4,15 @@ package rosa
import "hakurei.app/internal/pkg"
const hakureiVersion = "0.3.5"
const hakureiVersion = "0.3.6"
// hakureiSource is the source code of a hakurei release.
var hakureiSource = pkg.NewHTTPGetTar(
nil, "https://git.gensokyo.uk/security/hakurei/archive/"+
"v"+hakureiVersion+".tar.gz",
mustDecode("6Tn38NLezRD2d3aGdFg5qFfqn8_KvC6HwMKwJMPvaHmVw8xRgxn8B0PObswl2mOk"),
mustDecode("Yul9J2yV0x453lQP9KUnG_wEJo_DbKMNM7xHJGt4rITCSeX9VRK2J4kzAxcv_0-b"),
pkg.TarGzip,
)
// hakureiPatches are patches applied against a hakurei release.
var hakureiPatches = [][2]string{
{"createTemp-error-injection", `diff --git a/container/dispatcher_test.go b/container/dispatcher_test.go
index 5de37fc..fe0c4db 100644
--- a/container/dispatcher_test.go
+++ b/container/dispatcher_test.go
@@ -238,8 +238,11 @@ func sliceAddr[S any](s []S) *[]S { return &s }
func newCheckedFile(t *testing.T, name, wantData string, closeErr error) osFile {
f := &checkedOsFile{t: t, name: name, want: wantData, closeErr: closeErr}
- // check happens in Close, and cleanup is not guaranteed to run, so relying on it for sloppy implementations will cause sporadic test results
- f.cleanup = runtime.AddCleanup(f, func(name string) { f.t.Fatalf("checkedOsFile %s became unreachable without a call to Close", name) }, f.name)
+ // check happens in Close, and cleanup is not guaranteed to run, so relying
+ // on it for sloppy implementations will cause sporadic test results
+ f.cleanup = runtime.AddCleanup(f, func(name string) {
+ panic("checkedOsFile " + name + " became unreachable without a call to Close")
+ }, name)
return f
}
diff --git a/container/initplace_test.go b/container/initplace_test.go
index afeddbe..1c2f20b 100644
--- a/container/initplace_test.go
+++ b/container/initplace_test.go
@@ -21,7 +21,7 @@ func TestTmpfileOp(t *testing.T) {
Path: samplePath,
Data: sampleData,
}, nil, nil, []stub.Call{
- call("createTemp", stub.ExpectArgs{"/", "tmp.*"}, newCheckedFile(t, "tmp.32768", sampleDataString, nil), stub.UniqueError(5)),
+ call("createTemp", stub.ExpectArgs{"/", "tmp.*"}, (*checkedOsFile)(nil), stub.UniqueError(5)),
}, stub.UniqueError(5)},
{"Write", &Params{ParentPerm: 0700}, &TmpfileOp{
`},
}
var hakureiPatches [][2]string

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.12.73 Kernel Configuration
# Linux/x86 6.12.76 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 21.1.8"
CONFIG_CC_VERSION_TEXT="clang version 22.1.0"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=210108
CONFIG_CLANG_VERSION=220100
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=210108
CONFIG_AS_VERSION=220100
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=210108
CONFIG_LLD_VERSION=220100
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
@@ -12308,7 +12308,6 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
# CONFIG_NMI_CHECK_CPU is not set
# CONFIG_DEBUG_IRQFLAGS is not set
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
#
@@ -12345,7 +12344,7 @@ CONFIG_HAVE_RETHOOK=y
CONFIG_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=y
CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y

View File

@@ -1,16 +1,16 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.12.73 Kernel Configuration
# Linux/arm64 6.12.76 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 21.1.8"
CONFIG_CC_VERSION_TEXT="clang version 22.1.0"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=210108
CONFIG_CLANG_VERSION=220100
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=210108
CONFIG_AS_VERSION=220100
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=210108
CONFIG_LLD_VERSION=220100
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
@@ -4984,7 +4984,7 @@ CONFIG_SERIAL_TEGRA_TCU=m
CONFIG_SERIAL_MAX3100=m
CONFIG_SERIAL_MAX310X=m
CONFIG_SERIAL_IMX=m
CONFIG_SERIAL_IMX_CONSOLE=m
# CONFIG_SERIAL_IMX_CONSOLE is not set
CONFIG_SERIAL_IMX_EARLYCON=y
CONFIG_SERIAL_UARTLITE=m
CONFIG_SERIAL_UARTLITE_NR_UARTS=1
@@ -5772,6 +5772,7 @@ CONFIG_GPIO_MADERA=m
CONFIG_GPIO_MAX77650=m
CONFIG_GPIO_PMIC_EIC_SPRD=m
CONFIG_GPIO_SL28CPLD=m
CONFIG_GPIO_TN48M_CPLD=m
CONFIG_GPIO_TPS65086=m
CONFIG_GPIO_TPS65218=m
CONFIG_GPIO_TPS65219=m
@@ -6471,6 +6472,7 @@ CONFIG_MFD_MAX5970=m
# CONFIG_MFD_CS47L85 is not set
# CONFIG_MFD_CS47L90 is not set
# CONFIG_MFD_CS47L92 is not set
CONFIG_MFD_TN48M_CPLD=m
# CONFIG_MFD_DA9052_SPI is not set
CONFIG_MFD_DA9062=m
CONFIG_MFD_DA9063=m
@@ -12532,6 +12534,7 @@ CONFIG_RESET_SUNXI=y
CONFIG_RESET_TI_SCI=m
CONFIG_RESET_TI_SYSCON=m
CONFIG_RESET_TI_TPS380X=m
CONFIG_RESET_TN48M_CPLD=m
CONFIG_RESET_UNIPHIER=m
CONFIG_RESET_UNIPHIER_GLUE=m
CONFIG_RESET_ZYNQMP=y
@@ -14022,7 +14025,6 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
# CONFIG_DEBUG_IRQFLAGS is not set
CONFIG_STACKTRACE=y
# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
# CONFIG_DEBUG_KOBJECT is not set
#
@@ -14057,7 +14059,7 @@ CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=y
CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y

View File

@@ -37,5 +37,7 @@ func init() {
Name: "kmod",
Description: "a set of tools to handle common tasks with Linux kernel modules",
Website: "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git",
ID: 1517,
}
}

View File

@@ -48,5 +48,7 @@ func init() {
Name: "libcap",
Description: "a library for getting and setting POSIX.1e draft 15 capabilities",
Website: "https://sites.google.com/site/fullycapable/",
ID: 1569,
}
}

View File

@@ -8,8 +8,8 @@ import (
func (t Toolchain) newLibexpat() (pkg.Artifact, string) {
const (
version = "2.7.3"
checksum = "GmkoD23nRi9cMT0cgG1XRMrZWD82UcOMzkkvP1gkwSFWCBgeSXMuoLpa8-v8kxW-"
version = "2.7.4"
checksum = "W6NI2FESBjrTqRPcvs15fK5c3nwF6f9RT8U-XHKQKblXVzJB3nt_ez5B5jO0ZVDG"
)
return t.NewPackage("libexpat", version, pkg.NewHTTPGetTar(
nil, "https://github.com/libexpat/libexpat/releases/download/"+
@@ -28,5 +28,7 @@ func init() {
Name: "libexpat",
Description: "a stream-oriented XML parser library",
Website: "https://libexpat.github.io/",
ID: 770,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newLibffi() (pkg.Artifact, string) {
const (
version = "3.4.5"
checksum = "apIJzypF4rDudeRoI_n3K7N-zCeBLTbQlHRn9NSAZqdLAWA80mR0gXPTpHsL7oMl"
version = "3.5.2"
checksum = "2_Q-ZNBBbVhltfL5zEr0wljxPegUimTK4VeMSiwJEGksls3n4gj3lV0Ly3vviSFH"
)
return t.NewPackage("libffi", version, pkg.NewHTTPGetTar(
nil, "https://github.com/libffi/libffi/releases/download/"+
@@ -23,5 +23,7 @@ func init() {
Name: "libffi",
Description: "a portable, high level programming interface to various calling conventions",
Website: "https://sourceware.org/libffi/",
ID: 1611,
}
}

View File

@@ -30,5 +30,7 @@ func init() {
Name: "libgd",
Description: "an open source code library for the dynamic creation of images",
Website: "https://libgd.github.io/",
ID: 880,
}
}

View File

@@ -30,5 +30,7 @@ func init() {
Name: "libpsl",
Description: "provides functions to work with the Mozilla Public Suffix List",
Website: "https://rockdaboot.github.io/libpsl/",
ID: 7305,
}
}

View File

@@ -31,5 +31,7 @@ func init() {
Name: "libseccomp",
Description: "an interface to the Linux Kernel's syscall filtering mechanism",
Website: "https://github.com/seccomp/libseccomp/",
ID: 13823,
}
}

View File

@@ -34,5 +34,7 @@ func init() {
Name: "libucontext",
Description: "ucontext implementation featuring glibc-compatible ABI",
Website: "https://github.com/kaniini/libucontext/",
ID: 17085,
}
}

View File

@@ -8,8 +8,8 @@ import (
func (t Toolchain) newLibxml2() (pkg.Artifact, string) {
const (
version = "2.15.1"
checksum = "pYzAR3cNrEHezhEMirgiq7jbboLzwMj5GD7SQp0jhSIMdgoU4G9oU9Gxun3zzUIU"
version = "2.15.2"
checksum = "xba8VCofMsbWmQypA2__M9_RXNq9HDEuccjib6-tOni6OPngplRoAsYdY3NdYf8o"
)
return t.NewPackage("libxml2", version, pkg.NewHTTPGet(
nil, "https://download.gnome.org/sources/libxml2/"+
@@ -30,5 +30,7 @@ func init() {
Name: "libxml2",
Description: "an XML toolkit implemented in C",
Website: "https://gitlab.gnome.org/GNOME/libxml2/",
ID: 1783,
}
}

View File

@@ -23,6 +23,7 @@ func (t Toolchain) newLibxslt() (pkg.Artifact, string) {
SkipCheck: true,
},
XZ,
Zlib,
Python,
PkgConfig,
@@ -36,5 +37,7 @@ func init() {
Name: "libxslt",
Description: "an XSLT processor based on libxml2",
Website: "https://gitlab.gnome.org/GNOME/libxslt/",
ID: 13301,
}
}

View File

@@ -73,12 +73,15 @@ func llvmFlagName(flag int) string {
}
}
const (
llvmVersionMajor = "22"
llvmVersion = llvmVersionMajor + ".1.0"
)
// newLLVMVariant returns a [pkg.Artifact] containing a LLVM variant.
func (t Toolchain) newLLVMVariant(variant string, attr *llvmAttr) pkg.Artifact {
const (
version = "21.1.8"
checksum = "8SUpqDkcgwOPsqHVtmf9kXfFeVmjVxl4LMn-qSE1AI_Xoeju-9HaoPNGtidyxyka"
)
const checksum = "-_Tu5Lt8xkWoxm2VDVV7crh0WqZQbbblN3fYamMdPTDSy_54FAkD2ii7afSymPVV"
if attr == nil {
panic("LLVM attr must be non-nil")
}
@@ -161,9 +164,9 @@ ln -s ld.lld /work/system/bin/ld
)
}
return t.NewPackage("llvm", version, pkg.NewHTTPGetTar(
return t.NewPackage("llvm", llvmVersion, pkg.NewHTTPGetTar(
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
"llvmorg-"+version+".tar.gz",
"llvmorg-"+llvmVersion+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &PackageAttr{
@@ -184,6 +187,7 @@ ln -s ld.lld /work/system/bin/ld
Append: cmakeAppend,
Script: script + attr.script,
},
Zlib,
Libffi,
Python,
Perl,
@@ -245,10 +249,10 @@ func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) {
muslHeaders,
},
script: `
mkdir -p "/work/system/lib/clang/21/lib/"
mkdir -p "/work/system/lib/clang/` + llvmVersionMajor + `/lib/"
ln -s \
"../../../${ROSA_TRIPLE}" \
"/work/system/lib/clang/21/lib/"
"/work/system/lib/clang/` + llvmVersionMajor + `/lib/"
ln -s \
"clang_rt.crtbegin-` + linuxArch() + `.o" \
@@ -261,7 +265,7 @@ ln -s \
musl, _ = t.newMusl(false, stage0ExclConcat(t, []string{
"CC=clang",
"LIBCC=/system/lib/clang/21/lib/" +
"LIBCC=/system/lib/clang/" + llvmVersionMajor + "/lib/" +
triplet() + "/libclang_rt.builtins.a",
"AR=ar",
"RANLIB=ranlib",
@@ -314,10 +318,10 @@ ninja check-all
patches: [][2]string{
{"add-rosa-vendor", `diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 657f4230379e..12c305756184 100644
index 9c83abeeb3b1..5acfe5836a23 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -185,6 +185,7 @@ public:
@@ -190,6 +190,7 @@ public:
Apple,
PC,
@@ -326,25 +330,25 @@ index 657f4230379e..12c305756184 100644
Freescale,
IBM,
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 0584c941d2e6..e4d6ef963cc7 100644
index a4f9dd42c0fe..cb5a12387034 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -269,6 +269,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
@@ -279,6 +279,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case NVIDIA: return "nvidia";
case OpenEmbedded: return "oe";
case PC: return "pc";
+ case Rosa: return "rosa";
case SCEI: return "scei";
case SUSE: return "suse";
}
@@ -669,6 +670,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Case("intel", Triple::Intel)
case Meta:
@@ -689,6 +690,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
return StringSwitch<Triple::VendorType>(VendorName)
.Case("apple", Triple::Apple)
.Case("pc", Triple::PC)
+ .Case("rosa", Triple::Rosa)
.Default(Triple::UnknownVendor);
}
.Case("scei", Triple::SCEI)
.Case("sie", Triple::SCEI)
.Case("fsl", Triple::Freescale)
`},
{"xfail-broken-tests", `diff --git a/clang/test/Modules/timestamps.c b/clang/test/Modules/timestamps.c
@@ -489,6 +493,42 @@ index 64324a3f8b01..15ce70b68217 100644
return
}
func init() {
artifactsM[LLVMCompilerRT] = Metadata{
f: func(t Toolchain) (pkg.Artifact, string) {
_, compilerRT, _, _ := t.newLLVM()
return compilerRT, llvmVersion
},
Name: "llvm-compiler-rt",
Description: "LLVM runtime: compiler-rt",
Website: "https://llvm.org/",
}
artifactsM[LLVMRuntimes] = Metadata{
f: func(t Toolchain) (pkg.Artifact, string) {
_, _, runtimes, _ := t.newLLVM()
return runtimes, llvmVersion
},
Name: "llvm-runtimes",
Description: "LLVM runtimes: libunwind, libcxx, libcxxabi",
Website: "https://llvm.org/",
}
artifactsM[LLVMClang] = Metadata{
f: func(t Toolchain) (pkg.Artifact, string) {
_, _, _, clang := t.newLLVM()
return clang, llvmVersion
},
Name: "clang",
Description: `an "LLVM native" C/C++/Objective-C compiler`,
Website: "https://llvm.org/",
ID: 1830,
}
}
var (
// llvm stores the result of Toolchain.newLLVM.

View File

@@ -33,6 +33,8 @@ func init() {
Name: "make",
Description: "a tool which controls the generation of executables and other non-source files",
Website: "https://www.gnu.org/software/make/",
ID: 1877,
}
}

View File

@@ -13,6 +13,7 @@ func (t Toolchain) newMeson() (pkg.Artifact, string) {
checksum = "w895BXF_icncnXatT_OLCFe2PYEtg4KrKooMgUYdN-nQVvbFX3PvYWHGEpogsHtd"
)
return t.New("meson-"+version, 0, []pkg.Artifact{
t.Load(Zlib),
t.Load(Python),
t.Load(Setuptools),
}, nil, nil, `
@@ -36,6 +37,8 @@ func init() {
Name: "meson",
Description: "an open source build system",
Website: "https://mesonbuild.com/",
ID: 6472,
}
}
@@ -64,6 +67,7 @@ func (*MesonHelper) name(name, version string) string {
// extra returns hardcoded meson runtime dependencies.
func (*MesonHelper) extra(int) []PArtifact {
return []PArtifact{
Zlib,
Python,
Meson,
Ninja,

View File

@@ -40,5 +40,7 @@ func init() {
Name: "mksh",
Description: "MirBSD Korn Shell",
Website: "https://www.mirbsd.org/mksh",
ID: 5590,
}
}

View File

@@ -34,5 +34,7 @@ func init() {
Name: "musl-fts",
Description: "implementation of fts(3) functions which are missing in musl libc",
Website: "https://github.com/void-linux/musl-fts",
ID: 26980,
}
}

View File

@@ -34,5 +34,7 @@ func init() {
Name: "musl-obstack",
Description: "obstack functions and macros separated from glibc",
Website: "https://github.com/void-linux/musl-obstack",
ID: 146206,
}
}

View File

@@ -61,5 +61,7 @@ func init() {
Name: "musl",
Description: "an implementation of the C standard library",
Website: "https://musl.libc.org/",
ID: 11688,
}
}

View File

@@ -30,5 +30,7 @@ func init() {
Name: "ncurses",
Description: "a free software emulation of curses in System V Release 4.0 (SVr4)",
Website: "https://invisible-island.net/ncurses/",
ID: 373226,
}
}

View File

@@ -42,5 +42,7 @@ func init() {
Name: "ninja",
Description: "a small build system with a focus on speed",
Website: "https://ninja-build.org/",
ID: 2089,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newOpenSSL() (pkg.Artifact, string) {
const (
version = "3.5.5"
checksum = "I2Hp1LxcTR8j4G6LFEQMVy6EJH-Na1byI9Ti-ThBot6EMLNRnjGXGq-WXrim3Fkz"
version = "3.6.1"
checksum = "boMAj2SIVIFXHswZva3qHJuFEpc32rxCCu07wjMPsVe9nn_976BGMmW_5P1zthgg"
)
return t.NewPackage("openssl", version, pkg.NewHTTPGetTar(
nil, "https://github.com/openssl/openssl/releases/download/"+
@@ -44,5 +44,10 @@ func init() {
Name: "openssl",
Description: "TLS/SSL and crypto library",
Website: "https://www.openssl.org/",
ID: 2566,
// strange malformed tags treated as pre-releases in Anitya
latest: (*Versions).getStable,
}
}

View File

@@ -6,8 +6,8 @@ import (
func (t Toolchain) newPCRE2() (pkg.Artifact, string) {
const (
version = "10.43"
checksum = "iyNw-POPSJwiZVJfUK5qACA6q2uMzP-84WieimN_CskaEkuw5fRnRTZhEv6ry2Yo"
version = "10.47"
checksum = "IbC24vVayju6nB9EhrBPSDexk22wDecdpyrjgC3nCZXkwTnUjq4CD2q5sopqu6CW"
)
return t.NewPackage("pcre2", version, pkg.NewHTTPGetTar(
nil, "https://github.com/PCRE2Project/pcre2/releases/download/"+
@@ -37,5 +37,7 @@ func init() {
Name: "pcre2",
Description: "a set of C functions that implement regular expression pattern matching",
Website: "https://pcre2project.github.io/pcre2/",
ID: 5832,
}
}

View File

@@ -39,12 +39,13 @@ rm -f /system/bin/ps # perl does not like toybox ps
{"Dldflags", `"${LDFLAGS:-''}"`},
{"Doptimize", "'-O2 -fno-strict-aliasing'"},
{"Duseithreads"},
{"Duseshrplib"},
},
Check: []string{
"TEST_JOBS=256",
"test_harness",
},
Install: "./perl -Ilib -I. installperl --destdir=/work",
Install: `LD_LIBRARY_PATH="$PWD" ./perl -Ilib -I. installperl --destdir=/work`,
}), version
}
func init() {
@@ -54,6 +55,11 @@ func init() {
Name: "perl",
Description: "The Perl Programming language",
Website: "https://www.perl.org/",
ID: 13599,
// odd-even versioning
latest: (*Versions).getStable,
}
}

View File

@@ -26,5 +26,7 @@ func init() {
Name: "pkg-config",
Description: "a helper tool used when compiling applications and libraries",
Website: "https://pkgconfig.freedesktop.org/",
ID: 3649,
}
}

View File

@@ -36,5 +36,7 @@ func init() {
Name: "procps",
Description: "command line and full screen utilities for browsing procfs",
Website: "https://gitlab.com/procps-ng/procps",
ID: 3708,
}
}

View File

@@ -9,8 +9,8 @@ import (
func (t Toolchain) newPython() (pkg.Artifact, string) {
const (
version = "3.14.2"
checksum = "7nZunVMGj0viB-CnxpcRego2C90X5wFsMTgsoewd5z-KSZY2zLuqaBwG-14zmKys"
version = "3.14.3"
checksum = "ajEC32WPmn9Jvll0n4gGvlTvhMPUHb2H_j5_h9jf_esHmkZBRfAumDcKY7nTTsCH"
)
return t.NewPackage("python", version, pkg.NewHTTPGetTar(
nil, "https://www.python.org/ftp/python/"+version+
@@ -68,6 +68,8 @@ func init() {
Name: "python",
Description: "the Python programming language interpreter",
Website: "https://www.python.org/",
ID: 13254,
}
}
@@ -85,6 +87,7 @@ func newViaPip(
}
return t.New(name+"-"+version, 0, slices.Concat([]pkg.Artifact{
t.Load(Zlib),
t.Load(Python),
}, extraRes), nil, nil, `
pip3 install \
@@ -106,10 +109,11 @@ pip3 install \
func (t Toolchain) newSetuptools() (pkg.Artifact, string) {
const (
version = "80.10.1"
checksum = "p3rlwEmy1krcUH1KabprQz1TCYjJ8ZUjOQknQsWh3q-XEqLGEd3P4VrCc7ouHGXU"
version = "82.0.0"
checksum = "K9f8Yi7Gg95zjmQsE1LLw9UBb8NglI6EY6pQpdD6DM0Pmc_Td5w2qs1SMngTI6Jp"
)
return t.New("setuptools-"+version, 0, []pkg.Artifact{
t.Load(Zlib),
t.Load(Python),
}, nil, nil, `
pip3 install \
@@ -131,11 +135,13 @@ func init() {
Name: "setuptools",
Description: "the autotools of the Python ecosystem",
Website: "https://pypi.org/project/setuptools/",
ID: 4021,
}
}
func init() {
artifactsM[Pygments] = newViaPip(
artifactsM[PythonPygments] = newViaPip(
"pygments",
" a syntax highlighting package written in Python",
"2.19.2", "none", "any",
@@ -144,7 +150,7 @@ func init() {
"c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/",
)
artifactsM[Pluggy] = newViaPip(
artifactsM[PythonPluggy] = newViaPip(
"pluggy",
"the core framework used by the pytest, tox, and devpi projects",
"1.6.0", "none", "any",
@@ -153,7 +159,7 @@ func init() {
"54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/",
)
artifactsM[Packaging] = newViaPip(
artifactsM[PythonPackaging] = newViaPip(
"packaging",
"reusable core utilities for various Python Packaging interoperability specifications",
"26.0", "none", "any",
@@ -162,7 +168,7 @@ func init() {
"b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/",
)
artifactsM[IniConfig] = newViaPip(
artifactsM[PythonIniConfig] = newViaPip(
"iniconfig",
"a small and simple INI-file parser module",
"2.3.0", "none", "any",
@@ -170,16 +176,16 @@ func init() {
"https://files.pythonhosted.org/packages/"+
"cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/",
)
artifactsM[PyTest] = newViaPip(
artifactsM[PythonPyTest] = newViaPip(
"pytest",
"the pytest framework",
"9.0.2", "none", "any",
"IM2wDbLke1EtZhF92zvAjUl_Hms1uKDtM7U8Dt4acOaChMnDg1pW7ib8U0wYGDLH",
"https://files.pythonhosted.org/packages/"+
"3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/",
IniConfig,
Packaging,
Pluggy,
Pygments,
PythonIniConfig,
PythonPackaging,
PythonPluggy,
PythonPygments,
)
}

View File

@@ -102,5 +102,7 @@ func init() {
Name: "qemu",
Description: "a generic and open source machine emulator and virtualizer",
Website: "https://www.qemu.org/",
ID: 13607,
}
}

235
internal/rosa/report.go Normal file
View File

@@ -0,0 +1,235 @@
package rosa
import (
"encoding/binary"
"errors"
"fmt"
"io"
"os"
"runtime"
"runtime/debug"
"strconv"
"sync"
"syscall"
"unique"
"unsafe"
"hakurei.app/internal/pkg"
"hakurei.app/message"
)
// wordSize is the boundary which binary segments are always aligned to.
const wordSize = 8
// padSize returns the padding size for aligning sz.
func padSize[T int | int64](sz T) T {
return (wordSize - (sz)%wordSize) % wordSize
}
// WriteReport writes a report of all available [PArtifact] to w.
func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
var (
zero [wordSize]byte
buf [len(pkg.ID{}) + wordSize]byte
)
for i := range PresetEnd {
a := Std.Load(PArtifact(i))
if _, ok := a.(pkg.FileArtifact); ok {
msg.Verbosef("skipping file artifact %s", artifactsM[i].Name)
continue
}
id := c.Ident(a)
var f *os.File
if r, err := c.OpenStatus(a); err != nil {
if errors.Is(err, os.ErrNotExist) {
msg.Verbosef("artifact %s unavailable", artifactsM[i].Name)
continue
}
return err
} else {
f = r.(*os.File)
}
msg.Verbosef("writing artifact %s...", artifactsM[i].Name)
var sz int64
if fi, err := f.Stat(); err != nil {
_ = f.Close()
return err
} else {
sz = fi.Size()
}
*(*pkg.ID)(buf[:]) = id.Value()
binary.LittleEndian.PutUint64(buf[len(pkg.ID{}):], uint64(sz))
if _, err := w.Write(buf[:]); err != nil {
_ = f.Close()
return err
}
if n, err := io.Copy(w, f); err != nil {
_ = f.Close()
return err
} else if n != sz {
_ = f.Close()
return fmt.Errorf("strange status file copy: %d != %d", n, sz)
} else if err = f.Close(); err != nil {
return err
}
if psz := padSize(sz); psz > 0 {
if _, err := w.Write(zero[:psz]); err != nil {
return err
}
}
// existence of status implies cured artifact
var n int
if pathname, _, err := c.Cure(a); err != nil {
return err
} else if n, err = pkg.Flatten(
os.DirFS(pathname.String()), ".",
io.Discard,
); err != nil {
return err
}
binary.LittleEndian.PutUint64(buf[:], uint64(n))
if _, err := w.Write(buf[:wordSize]); err != nil {
return err
}
}
return nil
}
// Report provides efficient access to a report file populated by [WriteReport].
type Report struct {
// Slice backed by the underlying file.
//
// Access must be prepared by HandleAccess.
data []byte
// Offsets into data for each identifier.
offsets map[unique.Handle[pkg.ID]]int
// Outcome of a call to Close.
closeErr error
// Synchronises calls to Close.
closeOnce sync.Once
}
// OpenReport opens a file populated by [WriteReport]
func OpenReport(pathname string) (rp *Report, err error) {
var f *os.File
if f, err = os.Open(pathname); err != nil {
return
}
var fi os.FileInfo
if fi, err = f.Stat(); err != nil {
_ = f.Close()
return
}
var r Report
if r.data, err = syscall.Mmap(
int(f.Fd()),
0,
int(fi.Size()),
syscall.PROT_READ,
syscall.MAP_PRIVATE,
); err != nil {
_ = f.Close()
return
}
if err = f.Close(); err != nil {
_ = r.Close()
return
}
defer r.HandleAccess(&err)()
var offset int
r.offsets = make(map[unique.Handle[pkg.ID]]int)
for offset < len(r.data) {
id := unique.Make((pkg.ID)(r.data[offset:]))
offset += len(pkg.ID{})
r.offsets[id] = offset
offset += int(binary.LittleEndian.Uint64(r.data[offset:])) + wordSize
offset += padSize(offset)
offset += wordSize
}
return &r, nil
}
// ReportIOError describes an I/O error while accessing a [Report].
type ReportIOError struct {
Offset int
Err error
}
// Unwrap returns the underlying runtime error.
func (e *ReportIOError) Unwrap() error { return e.Err }
// Error returns a description of the error offset.
func (e *ReportIOError) Error() string {
return "report I/O error at offset " + strconv.Itoa(e.Offset)
}
// HandleAccess prepares for accessing memory returned by a method of [Report]
// and returns a function that must be deferred by the caller.
func (r *Report) HandleAccess(errP *error) func() {
pof := debug.SetPanicOnFault(true)
return func() {
debug.SetPanicOnFault(pof)
v := recover()
if v == nil {
return
}
if err, ok := v.(error); !ok {
panic(v)
} else if *errP != nil {
return
} else {
*errP = err
}
var runtimeError interface {
Addr() uintptr
runtime.Error
}
if errors.As(*errP, &runtimeError) {
offset := int(runtimeError.Addr() - uintptr(unsafe.Pointer(unsafe.SliceData(r.data))))
// best effort for fragile uintptr
if offset >= 0 {
*errP = &ReportIOError{offset, *errP}
}
}
}
}
// ArtifactOf returns information of a [pkg.Artifact] corresponding to id.
func (r *Report) ArtifactOf(id unique.Handle[pkg.ID]) (status []byte, n int64) {
if offset, ok := r.offsets[id]; !ok {
n = -1
} else {
sz := int(binary.LittleEndian.Uint64(r.data[offset:]))
offset += wordSize
status = r.data[offset : offset+sz]
offset += sz + padSize(sz)
n = int64(binary.LittleEndian.Uint64(r.data[offset:]))
}
return
}
// Close closes the underlying file and releases all associated resources.
func (r *Report) Close() error {
r.closeOnce.Do(func() { r.closeErr = syscall.Munmap(r.data) })
return r.closeErr
}

View File

@@ -0,0 +1,57 @@
package rosa_test
import (
"errors"
"os"
"path"
"syscall"
"testing"
"unique"
"hakurei.app/internal/pkg"
"hakurei.app/internal/rosa"
)
func TestReportZeroLength(t *testing.T) {
report := path.Join(t.TempDir(), "report")
if err := os.WriteFile(report, nil, 0400); err != nil {
t.Fatal(err)
}
if _, err := rosa.OpenReport(report); !errors.Is(err, syscall.EINVAL) {
t.Fatalf("OpenReport: error = %v", err)
}
}
func TestReportSIGSEGV(t *testing.T) {
report := path.Join(t.TempDir(), "report")
if err := os.WriteFile(report, make([]byte, 64), 0400); err != nil {
t.Fatal(err)
}
if r, err := rosa.OpenReport(report); err != nil {
t.Fatalf("OpenReport: error = %v", err)
} else {
status, n := r.ArtifactOf(unique.Make(pkg.ID{}))
if len(status) != 0 {
t.Errorf("ArtifactsOf: status = %#v", status)
}
if n != 0 {
t.Errorf("ArtifactsOf: n = %d", n)
}
if err = r.Close(); err != nil {
t.Fatalf("Close: error = %v", err)
}
defer func() {
ioErr := err.(*rosa.ReportIOError)
if ioErr.Offset != 48 {
panic(ioErr)
}
}()
defer r.HandleAccess(&err)()
r.ArtifactOf(unique.Make(pkg.ID{}))
}
}

View File

@@ -329,7 +329,7 @@ mkdir -vp /work/system/bin
"AR=ar",
"RANLIB=ranlib",
"LIBCC=/system/lib/clang/21/lib/" + triplet() +
"LIBCC=/system/lib/clang/" + llvmVersionMajor + "/lib/" + triplet() +
"/libclang_rt.builtins.a",
}, "/system/bin", "/bin")

View File

@@ -33,5 +33,7 @@ func init() {
Name: "rsync",
Description: "an open source utility that provides fast incremental file transfer",
Website: "https://rsync.samba.org/",
ID: 4217,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newSquashfsTools() (pkg.Artifact, string) {
const (
version = "4.7.4"
checksum = "pG0E_wkRJFS6bvPYF-hTKZT-cWnvo5BbIzCDZrJZVQDgJOx2Vc3ZfNSEV7Di7cSW"
version = "4.7.5"
checksum = "rF52wLQP-jeAmcD-48wqJcck8ZWRFwkax3T-7snaRf5EBnCQQh0YypMY9lwcivLz"
)
return t.NewPackage("squashfs-tools", version, pkg.NewHTTPGetTar(
nil, "https://github.com/plougher/squashfs-tools/releases/"+
@@ -47,5 +47,7 @@ func init() {
Name: "squashfs-tools",
Description: "tools to create and extract Squashfs filesystems",
Website: "https://github.com/plougher/squashfs-tools",
ID: 4879,
}
}

View File

@@ -1,20 +1,22 @@
package rosa
import (
"strings"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newNSS() (pkg.Artifact, string) {
const (
version = "3_120"
checksum = "9M0SNMrj9BJp6RH2rQnMm6bZWtP0Kgj64D5JNPHF7Cxr2_8kfy3msubIcvEPwC35"
version = "3.121"
checksum = "MTS4Eg-1vBN3T7gdUAdNO0y_e9x9BE3f_k_DHdM_BIovc7y57vhsZTfB5f6BeQfi"
version0 = "4_38_2"
checksum0 = "25x2uJeQnOHIiq_zj17b4sYqKgeoU8-IsySUptoPcdHZ52PohFZfGuIisBreWzx0"
)
return t.NewPackage("nss", version, pkg.NewHTTPGetTar(
nil, "https://github.com/nss-dev/nss/archive/refs/tags/"+
"NSS_"+version+"_RTM.tar.gz",
"NSS_"+strings.Join(strings.SplitN(version, ".", 2), "_")+"_RTM.tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &PackageAttr{
@@ -72,6 +74,8 @@ func init() {
Name: "nss",
Description: "Network Security Services",
Website: "https://firefox-source-docs.mozilla.org/security/nss/index.html",
ID: 2503,
}
}
@@ -89,6 +93,7 @@ func init() {
func (t Toolchain) newNSSCACert() (pkg.Artifact, string) {
return t.New("nss-cacert", 0, []pkg.Artifact{
t.Load(Zlib),
t.Load(Bash),
t.Load(Python),

View File

@@ -15,6 +15,7 @@ func (t Toolchain) newStage0() (pkg.Artifact, string) {
runtimes,
clang,
t.Load(Zlib),
t.Load(Bzip2),
t.Load(Patch),

View File

@@ -44,5 +44,7 @@ func init() {
Name: "tamago",
Description: "a Go toolchain extended with support for bare metal execution",
Website: "https://github.com/usbarmory/tamago-go",
ID: 388872,
}
}

View File

@@ -67,6 +67,8 @@ func init() {
Name: "toybox",
Description: "many common Linux command line utilities",
Website: "https://landley.net/toybox/",
ID: 13818,
}
artifactsM[toyboxEarly] = Metadata{

View File

@@ -38,5 +38,7 @@ func init() {
Name: "unzip",
Description: "portable compression/archiver utilities",
Website: "https://infozip.sourceforge.net/",
ID: 8684,
}
}

View File

@@ -53,5 +53,10 @@ func init() {
Name: "util-linux",
Description: "a random collection of Linux utilities",
Website: "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git",
ID: 8179,
// release candidates confuse Anitya
latest: (*Versions).getStable,
}
}

View File

@@ -4,8 +4,8 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newWayland() (pkg.Artifact, string) {
const (
version = "1.24.0"
checksum = "JxgLiFRRGw2D3uhVw8ZeDbs3V7K_d4z_ypDog2LBqiA_5y2vVbUAk5NT6D5ozm0m"
version = "1.24.91"
checksum = "SQkjYShk2TutoBOfmeJcdLU9iDExVKOg0DZhLeL8U_qjc9olLTC7h3vuUBvVtx9w"
)
return t.NewPackage("wayland", version, pkg.NewHTTPGetTar(
nil, "https://gitlab.freedesktop.org/wayland/wayland/"+
@@ -41,6 +41,8 @@ func init() {
Name: "wayland",
Description: "core Wayland window system code and protocol",
Website: "https://wayland.freedesktop.org/",
ID: 10061,
}
}
@@ -122,5 +124,7 @@ func init() {
Name: "wayland-protocols",
Description: "Additional standard Wayland protocols",
Website: "https://wayland.freedesktop.org/",
ID: 13997,
}
}

View File

@@ -4,14 +4,14 @@ import "hakurei.app/internal/pkg"
func (t Toolchain) newUtilMacros() (pkg.Artifact, string) {
const (
version = "1.17"
checksum = "vYPO4Qq3B_WGcsBjG0-lfwZ6DZ7ayyrOLqfDrVOgTDcyLChuMGOAAVAa_UXLu5tD"
version = "1.20.2"
checksum = "Ze8QH3Z3emC0pWFP-0nUYeMy7aBW3L_dxBBmVgcumIHNzEKc1iGTR-yUFR3JcM1G"
)
return t.NewPackage("util-macros", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/X11R7.7/src/util/"+
"util-macros-"+version+".tar.bz2",
nil, "https://www.x.org/releases/individual/util/"+
"util-macros-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarBzip2,
pkg.TarGzip,
), nil, (*MakeHelper)(nil)), version
}
func init() {
@@ -21,16 +21,18 @@ func init() {
Name: "util-macros",
Description: "X.Org Autotools macros",
Website: "https://xorg.freedesktop.org/",
ID: 5252,
}
}
func (t Toolchain) newXproto() (pkg.Artifact, string) {
const (
version = "7.0.23"
checksum = "goxwWxV0jZ_3pNczXFltZWHAhq92x-aEreUGyp5Ns8dBOoOmgbpeNIu1nv0Zx07z"
version = "7.0.31"
checksum = "Cm69urWY5RctKpR78eGzuwrjDEfXGkvHRdodj6sjypOGy5FF4-lmnUttVHYV1ydg"
)
return t.NewPackage("xproto", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/X11R7.7/src/proto/"+
nil, "https://www.x.org/releases/individual/proto/"+
"xproto-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
@@ -54,19 +56,21 @@ func init() {
Name: "xproto",
Description: "X Window System unified protocol definitions",
Website: "https://gitlab.freedesktop.org/xorg/proto/xorgproto",
ID: 13650,
}
}
func (t Toolchain) newLibXau() (pkg.Artifact, string) {
const (
version = "1.0.7"
checksum = "bm768RoZZnHRe9VjNU1Dw3BhfE60DyS9D_bgSR-JLkEEyUWT_Hb_lQripxrXto8j"
version = "1.0.12"
checksum = "G9AjnU_C160q814MCdjFOVt_mQz_pIt4wf4GNOQmGJS3UuuyMw53sfPvJ7WOqwXN"
)
return t.NewPackage("libXau", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/X11R7.7/src/lib/"+
"libXau-"+version+".tar.bz2",
nil, "https://www.x.org/releases/individual/lib/"+
"libXau-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarBzip2,
pkg.TarGzip,
), nil, &MakeHelper{
// ancient configure script
Generate: "autoreconf -if",
@@ -89,5 +93,7 @@ func init() {
Name: "libXau",
Description: "functions for handling Xauthority files and entries",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxau",
ID: 1765,
}
}

View File

@@ -22,6 +22,8 @@ func init() {
Name: "xcb-proto",
Description: "XML-XCB protocol descriptions used by libxcb for the X11 protocol & extensions",
Website: "https://gitlab.freedesktop.org/xorg/proto/xcbproto",
ID: 13646,
}
}
@@ -50,5 +52,7 @@ func init() {
Name: "xcb",
Description: "The X protocol C-language Binding",
Website: "https://xcb.freedesktop.org/",
ID: 1767,
}
}

View File

@@ -23,5 +23,7 @@ func init() {
Name: "xz",
Description: "XZ Utils",
Website: "https://tukaani.org/xz/",
ID: 5277,
}
}

View File

@@ -11,15 +11,21 @@ func (t Toolchain) newZlib() (pkg.Artifact, string) {
nil, "https://www.zlib.net/fossils/zlib-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &PackageAttr{
Env: []string{
"CC=clang -fPIC",
},
}, &MakeHelper{
OmitDefaults: true,
), nil, &CMakeHelper{
Cache: [][2]string{
{"CMAKE_BUILD_TYPE", "Release"},
Host: `""`,
Build: `""`,
{"ZLIB_BUILD_TESTING", "OFF"},
{"ZLIB_BUILD_SHARED", "ON"},
{"ZLIB_BUILD_STATIC", "ON"},
{"ZLIB_BUILD_MINIZIP", "OFF"},
{"ZLIB_INSTALL", "ON"},
{"ZLIB_PREFIX", "OFF"},
},
// ninja dependency loop
Make: true,
}), version
}
func init() {
@@ -29,5 +35,7 @@ func init() {
Name: "zlib",
Description: "lossless data-compression library",
Website: "https://zlib.net/",
ID: 5303,
}
}

View File

@@ -16,7 +16,6 @@ func (t Toolchain) newZstd() (pkg.Artifact, string) {
Append: []string{"build", "cmake"},
Cache: [][2]string{
{"CMAKE_BUILD_TYPE", "Release"},
{"CMAKE_INSTALL_LIBDIR", "lib"},
},
}), version
}
@@ -27,5 +26,7 @@ func init() {
Name: "zstd",
Description: "a fast compression algorithm",
Website: "https://facebook.github.io/zstd/",
ID: 12083,
}
}

View File

@@ -35,7 +35,7 @@ package
*Default:*
` <derivation hakurei-static-x86_64-unknown-linux-musl-0.3.5> `
` <derivation hakurei-static-x86_64-unknown-linux-musl-0.3.6> `
@@ -805,7 +805,7 @@ package
*Default:*
` <derivation hakurei-hsu-0.3.5> `
` <derivation hakurei-hsu-0.3.6> `

View File

@@ -30,7 +30,7 @@
buildGoModule rec {
pname = "hakurei";
version = "0.3.5";
version = "0.3.6";
srcFiltered = builtins.path {
name = "${pname}-src";