7 Commits

Author SHA1 Message Date
mae
b255f07b0f Merge remote-tracking branch 'origin/pkgserver' into pkgserver 2026-03-05 02:06:27 -06:00
mae
dec4cdd068 cmd/pkgserver: replace favicon 2026-03-05 02:06:07 -06:00
mae
73c620ecd5 cmd/pkgserver: pagination 2026-03-05 02:06:07 -06:00
mae
69467a1542 cmd/pkgserver: basic web ui 2026-03-05 02:06:07 -06:00
mae
1ae6a35bc8 cmd/pkgserver: replace favicon 2026-03-05 01:12:17 -06:00
mae
9ef5b52b85 cmd/pkgserver: pagination 2026-03-05 00:32:25 -06:00
mae
f93158cb3c cmd/pkgserver: basic web ui 2026-03-04 22:50:58 -06:00
82 changed files with 572 additions and 2203 deletions

View File

@@ -10,10 +10,6 @@ import (
"os/signal"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"syscall"
"time"
"unique"
@@ -133,207 +129,6 @@ 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
@@ -466,6 +261,30 @@ 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
@@ -607,16 +426,6 @@ func main() {
if cache != nil {
cache.Close()
}
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)
}
}
log.Fatal(err)
})
}

55
cmd/pkgserver/main.go Normal file
View File

@@ -0,0 +1,55 @@
package main
import (
"embed"
"fmt"
"net/http"
)
//go:generate sh -c "sass ui/static/dark.scss ui/static/dark.css && sass ui/static/light.scss ui/static/light.css && tsc ui/static/index.ts"
//go:embed ui/*
var content embed.FS
func serveWebUI(w http.ResponseWriter, r *http.Request) {
fmt.Printf("serveWebUI: %s\n", r.URL.Path)
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("X-XSS-Protection", "1")
w.Header().Set("X-Frame-Options", "DENY")
http.ServeFileFS(w, r, content, "ui/index.html")
}
func serveStaticContent(w http.ResponseWriter, r *http.Request) {
fmt.Printf("serveStaticContent: %s\n", r.URL.Path)
switch r.URL.Path {
case "/static/style.css":
darkTheme := r.CookiesNamed("dark_theme")
if len(darkTheme) > 0 && darkTheme[0].Value == "true" {
http.ServeFileFS(w, r, content, "ui/static/dark.css")
} else {
http.ServeFileFS(w, r, content, "ui/static/light.css")
}
break
case "/favicon.ico":
http.ServeFileFS(w, r, content, "ui/static/favicon.ico")
break
case "/static/index.js":
http.ServeFileFS(w, r, content, "ui/static/index.js")
break
default:
http.NotFound(w, r)
}
}
func serveAPI(w http.ResponseWriter, r *http.Request) {
}
func main() {
http.HandleFunc("GET /{$}", serveWebUI)
http.HandleFunc("GET /favicon.ico", serveStaticContent)
http.HandleFunc("GET /static/", serveStaticContent)
http.HandleFunc("GET /api/", serveAPI)
http.ListenAndServe(":8067", nil)
}

View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="static/style.css">
<title>Hakurei PkgServer</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="static/index.js"></script>
</head>
<body>
<h1>Hakurei PkgServer</h1>
<table id="pkg-list">
<tr><th>Status</th><th>Name</th><th>Version</th></tr>
</table>
<p>Showing entries <span id="entry-counter"></span>.</p>
<span class="bottom-nav"><a href="javascript:prevPage()">&laquo; Previous</a> <span id="page-number">1</span> <a href="javascript:nextPage()">Next &raquo;</a></span>
<span><label for="count">Entries per page:</label><select name="count" id="count">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select></span>
</body>
<footer>&copy; <a href="https://hakurei.app/">Hakurei</a>. Licensed under the MIT license.</footer>
</html>

View File

View File

@@ -0,0 +1,6 @@
@use 'common';
html {
background-color: #2c2c2c;
color: ghostwhite; }
/*# sourceMappingURL=dark.css.map */

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"mappings": "AAAA,aAAa;AAEb,IAAK;EACH,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,UAAU",
"sources": ["dark.scss"],
"names": [],
"file": "dark.css"
}

View File

@@ -0,0 +1,6 @@
@use 'common';
html {
background-color: #2c2c2c;
color: ghostwhite;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,67 @@
"use strict";
var PackageEntry = /** @class */ (function () {
function PackageEntry() {
}
return PackageEntry;
}());
var State = /** @class */ (function () {
function State() {
this.entriesPerPage = 10;
this.currentPage = 1;
this.entryIndex = 0;
this.loadedEntries = [];
}
State.prototype.getEntriesPerPage = function () {
return this.entriesPerPage;
};
State.prototype.setEntriesPerPage = function (entriesPerPage) {
this.entriesPerPage = entriesPerPage;
this.updateRange();
};
State.prototype.getCurrentPage = function () {
return this.currentPage;
};
State.prototype.setCurrentPage = function (page) {
this.currentPage = page;
document.getElementById("page-number").innerText = String(this.currentPage);
this.updateRange();
};
State.prototype.getEntryIndex = function () {
return this.entryIndex;
};
State.prototype.setEntryIndex = function (entryIndex) {
this.entryIndex = entryIndex;
this.updateRange();
};
State.prototype.getLoadedEntries = function () {
return this.loadedEntries;
};
State.prototype.getMaxPage = function () {
return this.loadedEntries.length / this.entriesPerPage;
};
State.prototype.updateRange = function () {
var max = Math.min(this.entryIndex + this.entriesPerPage, this.loadedEntries.length);
document.getElementById("entry-counter").innerText = "".concat(this.entryIndex, "-").concat(max, " of ").concat(this.loadedEntries.length);
};
return State;
}());
var STATE;
function prevPage() {
var current = STATE.getCurrentPage();
if (current > 1) {
STATE.setCurrentPage(STATE.getCurrentPage() - 1);
}
}
function nextPage() {
var current = STATE.getCurrentPage();
if (current < STATE.getMaxPage()) {
STATE.setCurrentPage(STATE.getCurrentPage() + 1);
}
}
document.addEventListener("DOMContentLoaded", function () {
STATE = new State();
STATE.updateRange();
document.getElementById("count").addEventListener("change", function (event) {
STATE.setEntriesPerPage(parseInt(event.target.value));
});
});

View File

@@ -0,0 +1,66 @@
"use strict"
class PackageEntry {
}
class State {
entriesPerPage: number = 10
currentPage: number = 1
entryIndex: number = 0
loadedEntries: PackageEntry[] = []
getEntriesPerPage(): number {
return this.entriesPerPage
}
setEntriesPerPage(entriesPerPage: number) {
this.entriesPerPage = entriesPerPage
this.updateRange()
}
getCurrentPage(): number {
return this.currentPage
}
setCurrentPage(page: number) {
this.currentPage = page
document.getElementById("page-number").innerText = String(this.currentPage)
this.updateRange()
}
getEntryIndex(): number {
return this.entryIndex
}
setEntryIndex(entryIndex: number) {
this.entryIndex = entryIndex
this.updateRange()
}
getLoadedEntries(): PackageEntry[] {
return this.loadedEntries
}
getMaxPage(): number {
return this.loadedEntries.length / this.entriesPerPage
}
updateRange() {
let max = Math.min(this.entryIndex + this.entriesPerPage, this.loadedEntries.length)
document.getElementById("entry-counter").innerText = `${this.entryIndex}-${max} of ${this.loadedEntries.length}`
}
}
let STATE: State
function prevPage() {
let current = STATE.getCurrentPage()
if (current > 1) {
STATE.setCurrentPage(STATE.getCurrentPage() - 1)
}
}
function nextPage() {
let current = STATE.getCurrentPage()
if (current < STATE.getMaxPage()) {
STATE.setCurrentPage(STATE.getCurrentPage() + 1)
}
}
document.addEventListener("DOMContentLoaded", () => {
STATE = new State()
STATE.updateRange()
document.getElementById("count").addEventListener("change", (event) => {
STATE.setEntriesPerPage(parseInt((event.target as HTMLSelectElement).value))
})
})

View File

@@ -0,0 +1,6 @@
@use 'common';
html {
background-color: #d3d3d3;
color: black; }
/*# sourceMappingURL=light.css.map */

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"mappings": "AAAA,aAAa;AAEb,IAAK;EACH,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,KAAK",
"sources": ["light.scss"],
"names": [],
"file": "light.css"
}

View File

@@ -0,0 +1,6 @@
@use 'common';
html {
background-color: #d3d3d3;
color: black;
}

View File

69
internal/azalea/azalea.go Normal file
View File

@@ -0,0 +1,69 @@
//go:generate gocc -a azalea.bnf
package azalea
import (
"io"
"io/fs"
"os"
"path/filepath"
"strconv"
"strings"
"hakurei.app/container/check"
)
type Parser struct {
Generator
}
func NewParser(gen Generator) *Parser {
return &Parser{
Generator: gen,
}
}
func (p Parser) Initialise() {
}
func (p Parser) Consume(ns string, file io.Reader) error {
return nil
}
// ConsumeDir walks a directory and consumes all Azalea source files within it and all its subdirectories, as long as they end with the .az extension.
func (p Parser) ConsumeDir(dir *check.Absolute) error {
ds := dir.String()
return filepath.WalkDir(ds, func(path string, d fs.DirEntry, err error) (e error) {
if err != nil {
return err
}
if d.IsDir() || !strings.HasSuffix(d.Name(), ".az") {
return
}
rel, e := filepath.Rel(ds, path)
ns := strings.TrimSuffix(rel, ".az")
f, e := os.Open(path)
return p.Consume(ns, f)
})
}
// ConsumeAll consumes all provided readers as Azalea source code, each given the namespace `r%d` where `%d` is the index of the reader in the provided arguments.
func (p Parser) ConsumeAll(in ...io.Reader) error {
for i, r := range in {
err := p.Consume("r"+strconv.FormatInt(int64(i), 10), r)
if err != nil {
return err
}
}
return nil
}
// ConsumeStrings consumes all provided strings as Azalea source code, each given the namespace `s%d` where `%d` is the index of the string in the provided arugments.
func (p Parser) ConsumeStrings(in ...string) error {
for i, s := range in {
err := p.Consume("s"+strconv.FormatInt(int64(i), 10), strings.NewReader(s))
if err != nil {
return err
}
}
return nil
}

View File

@@ -0,0 +1,36 @@
package azalea
import (
"io"
)
type Generator interface {
Finalise() (error, io.Writer)
}
type JsonGenerator struct {
t any
}
func NewJsonGenerator[T any]() JsonGenerator {
t := new(T)
return JsonGenerator{
t,
}
}
func (j *JsonGenerator) Finalise() (error, io.Writer) {
}
type PkgIRGenerator struct {
}
func NewPkgIRGenerator() PkgIRGenerator {
return PkgIRGenerator{}
}
func (p *PkgIRGenerator) Finalise() (error, io.Writer) {
}

View File

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

View File

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

View File

@@ -1,11 +1,6 @@
package rosa
import (
"context"
"encoding/json"
"errors"
"net/http"
"strconv"
"sync"
"hakurei.app/internal/pkg"
@@ -15,12 +10,8 @@ import (
type PArtifact int
const (
LLVMCompilerRT PArtifact = iota
LLVMRuntimes
LLVMClang
// ImageInitramfs is the Rosa OS initramfs archive.
ImageInitramfs
ImageInitramfs PArtifact = iota
// Kernel is the generic Rosa OS Linux kernel.
Kernel
@@ -61,6 +52,7 @@ const (
Gzip
Hakurei
HakureiDist
IniConfig
Kmod
LibXau
Libcap
@@ -88,6 +80,7 @@ const (
Ninja
OpenSSL
PCRE2
Packaging
Patch
Perl
PerlLocaleGettext
@@ -101,13 +94,11 @@ const (
PerlUnicodeGCString
PerlYAMLTiny
PkgConfig
Pluggy
Procps
PyTest
Pygments
Python
PythonIniConfig
PythonPackaging
PythonPluggy
PythonPyTest
PythonPygments
QEMU
Rsync
Sed
@@ -161,79 +152,11 @@ 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,16 +51,3 @@ 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,7 +32,5 @@ func init() {
Name: "bzip2",
Description: "a freely available, patent free, high-quality data compressor",
Website: "https://sourceware.org/bzip2/",
ID: 237,
}
}

View File

@@ -111,8 +111,6 @@ func init() {
Name: "cmake",
Description: "cross-platform, open-source build system",
Website: "https://cmake.org/",
ID: 306,
}
}
@@ -128,9 +126,6 @@ type CMakeHelper struct {
Cache [][2]string
// Runs after install.
Script string
// Whether to generate Makefile instead.
Make bool
}
var _ Helper = new(CMakeHelper)
@@ -144,10 +139,7 @@ func (attr *CMakeHelper) name(name, version string) string {
}
// extra returns a hardcoded slice of [CMake] and [Ninja].
func (attr *CMakeHelper) extra(int) []PArtifact {
if attr != nil && attr.Make {
return []PArtifact{CMake, Make}
}
func (*CMakeHelper) extra(int) []PArtifact {
return []PArtifact{CMake, Ninja}
}
@@ -179,19 +171,11 @@ 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 ` + generate + ` \
cmake -G Ninja \
-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]) {
@@ -199,9 +183,9 @@ cmake -G ` + generate + ` \
}
}
}), " \\\n\t") + ` \
-DCMAKE_INSTALL_PREFIX=/system \
-DCMAKE_INSTALL_PREFIX=/work/system \
'/usr/src/` + name + `/` + path.Join(attr.Append...) + `'
cmake --build .` + jobs + `
cmake --install . --prefix=/work/system
cmake --build .
cmake --install .
` + attr.Script
}

View File

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

View File

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

View File

@@ -25,7 +25,5 @@ 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,
},
PythonIniConfig,
PythonPackaging,
PythonPluggy,
PythonPygments,
PythonPyTest,
IniConfig,
Packaging,
Pluggy,
Pygments,
PyTest,
KernelHeaders,
), version
@@ -40,7 +40,5 @@ 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.53.0"
checksum = "rlqSTeNgSeVKJA7nvzGqddFH8q3eFEPB4qRZft-4zth8wTHnbTbm7J90kp_obHGm"
version = "2.52.0"
checksum = "uH3J1HAN_c6PfGNJd2OBwW4zo36n71wmkdvityYnrh8Ak0D1IifiAvEWz9Vi9DmS"
)
return t.NewPackage("git", version, pkg.NewHTTPGetTar(
nil, "https://www.kernel.org/pub/software/scm/git/"+
@@ -72,8 +72,6 @@ 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.21"
checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm"
version = "1.4.20"
checksum = "RT0_L3m4Co86bVBY3lCFAEs040yI1WdeNmRylFpah8IZovTm6O4wI7qiHJN3qsW9"
)
return t.NewPackage("m4", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2",
@@ -18,8 +18,6 @@ chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh
`,
}, (*MakeHelper)(nil),
Diffutils,
KernelHeaders,
), version
}
func init() {
@@ -29,8 +27,6 @@ func init() {
Name: "m4",
Description: "a macro processor with GNU extensions",
Website: "https://www.gnu.org/software/m4/",
ID: 1871,
}
}
@@ -56,8 +52,6 @@ func init() {
Name: "bison",
Description: "a general-purpose parser generator",
Website: "https://www.gnu.org/software/bison/",
ID: 193,
}
}
@@ -81,8 +75,6 @@ func init() {
Name: "sed",
Description: "a non-interactive command-line text editor",
Website: "https://www.gnu.org/software/sed/",
ID: 4789,
}
}
@@ -116,8 +108,6 @@ func init() {
Name: "autoconf",
Description: "M4 macros to produce self-contained configure script",
Website: "https://www.gnu.org/software/autoconf/",
ID: 141,
}
}
@@ -158,8 +148,6 @@ func init() {
Name: "automake",
Description: "a tool for automatically generating Makefile.in files",
Website: "https://www.gnu.org/software/automake/",
ID: 144,
}
}
@@ -189,8 +177,6 @@ func init() {
Name: "libtool",
Description: "a generic library support script",
Website: "https://www.gnu.org/software/libtool/",
ID: 1741,
}
}
@@ -215,8 +201,6 @@ func init() {
Name: "gzip",
Description: "a popular data compression program",
Website: "https://www.gnu.org/software/gzip/",
ID: 1290,
}
}
@@ -261,8 +245,6 @@ func init() {
Name: "gettext",
Description: "tools for producing multi-lingual messages",
Website: "https://www.gnu.org/software/gettext/",
ID: 898,
}
}
@@ -294,8 +276,6 @@ func init() {
Name: "diffutils",
Description: "several programs related to finding differences between files",
Website: "https://www.gnu.org/software/diffutils/",
ID: 436,
}
}
@@ -326,8 +306,6 @@ func init() {
Name: "patch",
Description: "a program to apply diff output to files",
Website: "https://savannah.gnu.org/projects/patch/",
ID: 2597,
}
}
@@ -356,15 +334,13 @@ 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.10"
checksum = "o-B9wssRnZySzJUI1ZJAgw-bZtj1RC67R9po2AcM2OjjS8FQIl16IRHpC6IwO30i"
version = "9.9"
checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6"
)
return t.NewPackage("coreutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz",
@@ -377,105 +353,12 @@ 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/ls/hyperlink.sh
test_disable '#!/bin/sh' tests/dd/no-allocate.sh
test_disable '#!/bin/sh' tests/env/env.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{
@@ -495,15 +378,13 @@ 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.3"
checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-"
version = "7.2"
checksum = "9EelM5b7QGMAY5DKrAm_El8lofBGuFWlaBPSBhh7l_VQE8054MBmC0KBvGrABqjv"
)
return t.NewPackage("texinfo", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz",
@@ -523,8 +404,6 @@ func init() {
Name: "texinfo",
Description: "the GNU square-wheel-reinvension of man pages",
Website: "https://www.gnu.org/software/texinfo/",
ID: 4958,
}
}
@@ -548,15 +427,13 @@ 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.4.0"
checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C"
version = "5.3.2"
checksum = "uIs0d14h_d2DgMGYwrPtegGNyt_bxzG3D6Fe-MmExx_pVoVkQaHzrtmiXVr6NHKk"
)
return t.NewPackage("gawk", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz",
@@ -576,8 +453,6 @@ func init() {
Name: "gawk",
Description: "an implementation of awk with GNU extensions",
Website: "https://www.gnu.org/software/gawk/",
ID: 868,
}
}
@@ -609,8 +484,6 @@ func init() {
Name: "grep",
Description: "searches input for lines containing a match to a pattern",
Website: "https://www.gnu.org/software/grep/",
ID: 1251,
}
}
@@ -641,8 +514,6 @@ func init() {
Name: "findutils",
Description: "the basic directory searching utilities",
Website: "https://www.gnu.org/software/findutils/",
ID: 812,
}
}
@@ -671,15 +542,13 @@ 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.19"
checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x"
version = "1.18"
checksum = "iV5q3VxP5VPdJ-X7O5OQI4fGm8VjeYb5viLd1L3eAHg26bbHb2_Qn63XPF3ucVZr"
)
return t.NewPackage("libiconv", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz",
@@ -694,8 +563,6 @@ func init() {
Name: "libiconv",
Description: "iconv implementation independent of glibc",
Website: "https://www.gnu.org/software/libiconv/",
ID: 10656,
}
}
@@ -736,15 +603,13 @@ 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.46.0"
checksum = "4kK1_EXQipxSqqyvwD4LbiMLFKCUApjq6PeG4XJP4dzxYGqDeqXfh8zLuTyOuOVR"
version = "2.45"
checksum = "hlLtqqHDmzAT2OQVHaKEd_io2DGFvJkaeS-igBuK8bRRir7LUKGHgHYNkDVKaHTT"
)
return t.NewPackage("binutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/binutils/binutils-"+version+".tar.bz2",
@@ -761,8 +626,6 @@ func init() {
Name: "binutils",
Description: "a collection of binary tools",
Website: "https://www.gnu.org/software/binutils/",
ID: 7981,
}
}
@@ -787,8 +650,6 @@ func init() {
Name: "gmp",
Description: "a free library for arbitrary precision arithmetic",
Website: "https://gmplib.org/",
ID: 1186,
}
}
@@ -813,8 +674,6 @@ func init() {
Name: "mpfr",
Description: "a C library for multiple-precision floating-point computations",
Website: "https://www.mpfr.org/",
ID: 2019,
}
}
@@ -840,8 +699,6 @@ func init() {
Name: "mpc",
Description: "a C library for the arithmetic of complex numbers",
Website: "https://www.multiprecision.org/",
ID: 1667,
}
}
@@ -1054,7 +911,5 @@ 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.1"
checksum = "DdC5Ea-aCYPUHNObQh_09uWU0vn4e-8Ben850Vq-5OoamDRrXhuYI4YQ_BOFgaT0"
version = "1.26.0"
checksum = "uHLcrgBc0NMcyTMDLRNAZIcOx0RyQlyekSl9xbWSwj3esEFWJysYLfLa3S8p39Nh"
)
return t.newGo(
version,
@@ -177,7 +177,5 @@ 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.87.3"
checksum = "iKSLpzZZVfmAZZmqfO1y6uHdlIks4hzPWrqeUCp4ZeQjrPFA3aAa4OmrBYMNS-Si"
version = "2.86.4"
checksum = "AfTjBrrxtXXPL6dFa1LfTe40PyPSth62CoIkM5m_VJTUngGLOFHw6I4XE7RGQE8G"
)
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,
PythonPackaging,
Packaging,
Bash,
PCRE2,
@@ -54,8 +54,6 @@ func init() {
Name: "glib",
Description: "the GNU library of miscellaneous stuff",
Website: "https://developer.gnome.org/glib/",
ID: 10024,
Website: "https://gitlab.gnome.org/GNOME/glib/",
}
}

View File

@@ -2,19 +2,7 @@ package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newHakurei(
suffix, script string,
withHostname bool,
) pkg.Artifact {
hostname := `
echo '# Building test helper (hostname).'
go build -v -o /bin/hostname /usr/src/hostname/main.go
echo
`
if !withHostname {
hostname = ""
}
func (t Toolchain) newHakurei(suffix, script string) pkg.Artifact {
return t.New("hakurei"+suffix+"-"+hakureiVersion, 0, []pkg.Artifact{
t.Load(Go),
@@ -41,12 +29,17 @@ echo
"CGO_ENABLED=1",
"GOCACHE=/tmp/gocache",
"CC=clang -O3 -Werror",
}, hostname+`
}, `
echo '# Building test helper (hostname).'
go build -v -o /bin/hostname /usr/src/hostname/main.go
echo
chmod -R +w /usr/src/hakurei
cd /usr/src/hakurei
HAKUREI_VERSION='v`+hakureiVersion+`'
`+script, pkg.Path(AbsUsrSrc.Append("hakurei"), true, t.NewPatchedSource(
"hakurei", hakureiVersion, hakureiSource, false, hakureiPatches...,
"hakurei", hakureiVersion, hakureiSource, true, hakureiPatches...,
)), pkg.Path(AbsUsrSrc.Append("hostname", "main.go"), false, pkg.NewFile(
"hostname.go",
[]byte(`
@@ -76,11 +69,10 @@ go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
-buildid=
-linkmode external
-extldflags=-static
-X hakurei.app/internal/info.buildVersion=${HAKUREI_VERSION}
-X hakurei.app/internal/info.buildVersion="$HAKUREI_VERSION"
-X hakurei.app/internal/info.hakureiPath=/system/bin/hakurei
-X hakurei.app/internal/info.hsuPath=/system/bin/hsu
-X main.hakureiPath=/system/bin/hakurei
" ./...
-X main.hakureiPath=/system/bin/hakurei" ./...
echo
echo '# Testing hakurei.'
@@ -92,21 +84,19 @@ mkdir -p /work/system/bin/
hakurei \
sharefs \
../../bin/)
`, true), hakureiVersion
`), hakureiVersion
},
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) {
return t.newHakurei("-dist", `
export HAKUREI_VERSION
DESTDIR=/work /usr/src/hakurei/dist/release.sh
`, true), hakureiVersion
`), hakureiVersion
},
Name: "hakurei-dist",

View File

@@ -4,15 +4,48 @@ package rosa
import "hakurei.app/internal/pkg"
const hakureiVersion = "0.3.6"
const hakureiVersion = "0.3.5"
// 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("Yul9J2yV0x453lQP9KUnG_wEJo_DbKMNM7xHJGt4rITCSeX9VRK2J4kzAxcv_0-b"),
mustDecode("6Tn38NLezRD2d3aGdFg5qFfqn8_KvC6HwMKwJMPvaHmVw8xRgxn8B0PObswl2mOk"),
pkg.TarGzip,
)
// hakureiPatches are patches applied against a hakurei release.
var hakureiPatches [][2]string
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{
`},
}

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.76 Kernel Configuration
# Linux/x86 6.12.73 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 22.1.0"
CONFIG_CC_VERSION_TEXT="clang version 21.1.8"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220100
CONFIG_CLANG_VERSION=210108
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220100
CONFIG_AS_VERSION=210108
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220100
CONFIG_LLD_VERSION=210108
CONFIG_RUSTC_VERSION=0
CONFIG_RUSTC_LLVM_VERSION=0
CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
@@ -12308,6 +12308,7 @@ 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
#
@@ -12344,7 +12345,7 @@ CONFIG_HAVE_RETHOOK=y
CONFIG_RETHOOK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y
CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=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.76 Kernel Configuration
# Linux/arm64 6.12.73 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 22.1.0"
CONFIG_CC_VERSION_TEXT="clang version 21.1.8"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=220100
CONFIG_CLANG_VERSION=210108
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=220100
CONFIG_AS_VERSION=210108
CONFIG_LD_VERSION=0
CONFIG_LD_IS_LLD=y
CONFIG_LLD_VERSION=220100
CONFIG_LLD_VERSION=210108
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 is not set
CONFIG_SERIAL_IMX_CONSOLE=m
CONFIG_SERIAL_IMX_EARLYCON=y
CONFIG_SERIAL_UARTLITE=m
CONFIG_SERIAL_UARTLITE_NR_UARTS=1
@@ -5772,7 +5772,6 @@ 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
@@ -6472,7 +6471,6 @@ 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
@@ -12534,7 +12532,6 @@ 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
@@ -14025,6 +14022,7 @@ 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
#
@@ -14059,7 +14057,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_FREGS=y
CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y

View File

@@ -37,7 +37,5 @@ 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,7 +48,5 @@ 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.4"
checksum = "W6NI2FESBjrTqRPcvs15fK5c3nwF6f9RT8U-XHKQKblXVzJB3nt_ez5B5jO0ZVDG"
version = "2.7.3"
checksum = "GmkoD23nRi9cMT0cgG1XRMrZWD82UcOMzkkvP1gkwSFWCBgeSXMuoLpa8-v8kxW-"
)
return t.NewPackage("libexpat", version, pkg.NewHTTPGetTar(
nil, "https://github.com/libexpat/libexpat/releases/download/"+
@@ -28,7 +28,5 @@ 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.5.2"
checksum = "2_Q-ZNBBbVhltfL5zEr0wljxPegUimTK4VeMSiwJEGksls3n4gj3lV0Ly3vviSFH"
version = "3.4.5"
checksum = "apIJzypF4rDudeRoI_n3K7N-zCeBLTbQlHRn9NSAZqdLAWA80mR0gXPTpHsL7oMl"
)
return t.NewPackage("libffi", version, pkg.NewHTTPGetTar(
nil, "https://github.com/libffi/libffi/releases/download/"+
@@ -23,7 +23,5 @@ 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,7 +30,5 @@ 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,7 +30,5 @@ 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,7 +31,5 @@ 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,7 +34,5 @@ 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.2"
checksum = "xba8VCofMsbWmQypA2__M9_RXNq9HDEuccjib6-tOni6OPngplRoAsYdY3NdYf8o"
version = "2.15.1"
checksum = "pYzAR3cNrEHezhEMirgiq7jbboLzwMj5GD7SQp0jhSIMdgoU4G9oU9Gxun3zzUIU"
)
return t.NewPackage("libxml2", version, pkg.NewHTTPGet(
nil, "https://download.gnome.org/sources/libxml2/"+
@@ -30,7 +30,5 @@ func init() {
Name: "libxml2",
Description: "an XML toolkit implemented in C",
Website: "https://gitlab.gnome.org/GNOME/libxml2/",
ID: 1783,
}
}

View File

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

View File

@@ -73,15 +73,12 @@ 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 checksum = "-_Tu5Lt8xkWoxm2VDVV7crh0WqZQbbblN3fYamMdPTDSy_54FAkD2ii7afSymPVV"
const (
version = "21.1.8"
checksum = "8SUpqDkcgwOPsqHVtmf9kXfFeVmjVxl4LMn-qSE1AI_Xoeju-9HaoPNGtidyxyka"
)
if attr == nil {
panic("LLVM attr must be non-nil")
}
@@ -164,9 +161,9 @@ ln -s ld.lld /work/system/bin/ld
)
}
return t.NewPackage("llvm", llvmVersion, pkg.NewHTTPGetTar(
return t.NewPackage("llvm", version, pkg.NewHTTPGetTar(
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
"llvmorg-"+llvmVersion+".tar.gz",
"llvmorg-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &PackageAttr{
@@ -187,7 +184,6 @@ ln -s ld.lld /work/system/bin/ld
Append: cmakeAppend,
Script: script + attr.script,
},
Zlib,
Libffi,
Python,
Perl,
@@ -249,10 +245,10 @@ func (t Toolchain) newLLVM() (musl, compilerRT, runtimes, clang pkg.Artifact) {
muslHeaders,
},
script: `
mkdir -p "/work/system/lib/clang/` + llvmVersionMajor + `/lib/"
mkdir -p "/work/system/lib/clang/21/lib/"
ln -s \
"../../../${ROSA_TRIPLE}" \
"/work/system/lib/clang/` + llvmVersionMajor + `/lib/"
"/work/system/lib/clang/21/lib/"
ln -s \
"clang_rt.crtbegin-` + linuxArch() + `.o" \
@@ -265,7 +261,7 @@ ln -s \
musl, _ = t.newMusl(false, stage0ExclConcat(t, []string{
"CC=clang",
"LIBCC=/system/lib/clang/" + llvmVersionMajor + "/lib/" +
"LIBCC=/system/lib/clang/21/lib/" +
triplet() + "/libclang_rt.builtins.a",
"AR=ar",
"RANLIB=ranlib",
@@ -318,10 +314,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 9c83abeeb3b1..5acfe5836a23 100644
index 657f4230379e..12c305756184 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -190,6 +190,7 @@ public:
@@ -185,6 +185,7 @@ public:
Apple,
PC,
@@ -330,25 +326,25 @@ index 9c83abeeb3b1..5acfe5836a23 100644
Freescale,
IBM,
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index a4f9dd42c0fe..cb5a12387034 100644
index 0584c941d2e6..e4d6ef963cc7 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -279,6 +279,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
@@ -269,6 +269,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";
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)
}
@@ -669,6 +670,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Case("intel", Triple::Intel)
+ .Case("rosa", Triple::Rosa)
.Case("scei", Triple::SCEI)
.Case("sie", Triple::SCEI)
.Case("fsl", Triple::Freescale)
.Default(Triple::UnknownVendor);
}
`},
{"xfail-broken-tests", `diff --git a/clang/test/Modules/timestamps.c b/clang/test/Modules/timestamps.c
@@ -493,42 +489,6 @@ 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,8 +33,6 @@ 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,7 +13,6 @@ 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, `
@@ -37,8 +36,6 @@ func init() {
Name: "meson",
Description: "an open source build system",
Website: "https://mesonbuild.com/",
ID: 6472,
}
}
@@ -67,7 +64,6 @@ 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,7 +40,5 @@ func init() {
Name: "mksh",
Description: "MirBSD Korn Shell",
Website: "https://www.mirbsd.org/mksh",
ID: 5590,
}
}

View File

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

View File

@@ -30,7 +30,5 @@ 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,7 +42,5 @@ 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.6.1"
checksum = "boMAj2SIVIFXHswZva3qHJuFEpc32rxCCu07wjMPsVe9nn_976BGMmW_5P1zthgg"
version = "3.5.5"
checksum = "I2Hp1LxcTR8j4G6LFEQMVy6EJH-Na1byI9Ti-ThBot6EMLNRnjGXGq-WXrim3Fkz"
)
return t.NewPackage("openssl", version, pkg.NewHTTPGetTar(
nil, "https://github.com/openssl/openssl/releases/download/"+
@@ -44,10 +44,5 @@ 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.47"
checksum = "IbC24vVayju6nB9EhrBPSDexk22wDecdpyrjgC3nCZXkwTnUjq4CD2q5sopqu6CW"
version = "10.43"
checksum = "iyNw-POPSJwiZVJfUK5qACA6q2uMzP-84WieimN_CskaEkuw5fRnRTZhEv6ry2Yo"
)
return t.NewPackage("pcre2", version, pkg.NewHTTPGetTar(
nil, "https://github.com/PCRE2Project/pcre2/releases/download/"+
@@ -37,7 +37,5 @@ 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,13 +39,12 @@ 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: `LD_LIBRARY_PATH="$PWD" ./perl -Ilib -I. installperl --destdir=/work`,
Install: "./perl -Ilib -I. installperl --destdir=/work",
}), version
}
func init() {
@@ -55,11 +54,6 @@ 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,7 +26,5 @@ 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,7 +36,5 @@ 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.3"
checksum = "ajEC32WPmn9Jvll0n4gGvlTvhMPUHb2H_j5_h9jf_esHmkZBRfAumDcKY7nTTsCH"
version = "3.14.2"
checksum = "7nZunVMGj0viB-CnxpcRego2C90X5wFsMTgsoewd5z-KSZY2zLuqaBwG-14zmKys"
)
return t.NewPackage("python", version, pkg.NewHTTPGetTar(
nil, "https://www.python.org/ftp/python/"+version+
@@ -68,8 +68,6 @@ func init() {
Name: "python",
Description: "the Python programming language interpreter",
Website: "https://www.python.org/",
ID: 13254,
}
}
@@ -87,7 +85,6 @@ func newViaPip(
}
return t.New(name+"-"+version, 0, slices.Concat([]pkg.Artifact{
t.Load(Zlib),
t.Load(Python),
}, extraRes), nil, nil, `
pip3 install \
@@ -109,11 +106,10 @@ pip3 install \
func (t Toolchain) newSetuptools() (pkg.Artifact, string) {
const (
version = "82.0.0"
checksum = "K9f8Yi7Gg95zjmQsE1LLw9UBb8NglI6EY6pQpdD6DM0Pmc_Td5w2qs1SMngTI6Jp"
version = "80.10.1"
checksum = "p3rlwEmy1krcUH1KabprQz1TCYjJ8ZUjOQknQsWh3q-XEqLGEd3P4VrCc7ouHGXU"
)
return t.New("setuptools-"+version, 0, []pkg.Artifact{
t.Load(Zlib),
t.Load(Python),
}, nil, nil, `
pip3 install \
@@ -135,13 +131,11 @@ func init() {
Name: "setuptools",
Description: "the autotools of the Python ecosystem",
Website: "https://pypi.org/project/setuptools/",
ID: 4021,
}
}
func init() {
artifactsM[PythonPygments] = newViaPip(
artifactsM[Pygments] = newViaPip(
"pygments",
" a syntax highlighting package written in Python",
"2.19.2", "none", "any",
@@ -150,7 +144,7 @@ func init() {
"c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/",
)
artifactsM[PythonPluggy] = newViaPip(
artifactsM[Pluggy] = newViaPip(
"pluggy",
"the core framework used by the pytest, tox, and devpi projects",
"1.6.0", "none", "any",
@@ -159,7 +153,7 @@ func init() {
"54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/",
)
artifactsM[PythonPackaging] = newViaPip(
artifactsM[Packaging] = newViaPip(
"packaging",
"reusable core utilities for various Python Packaging interoperability specifications",
"26.0", "none", "any",
@@ -168,7 +162,7 @@ func init() {
"b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/",
)
artifactsM[PythonIniConfig] = newViaPip(
artifactsM[IniConfig] = newViaPip(
"iniconfig",
"a small and simple INI-file parser module",
"2.3.0", "none", "any",
@@ -176,16 +170,16 @@ func init() {
"https://files.pythonhosted.org/packages/"+
"cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/",
)
artifactsM[PythonPyTest] = newViaPip(
artifactsM[PyTest] = newViaPip(
"pytest",
"the pytest framework",
"9.0.2", "none", "any",
"IM2wDbLke1EtZhF92zvAjUl_Hms1uKDtM7U8Dt4acOaChMnDg1pW7ib8U0wYGDLH",
"https://files.pythonhosted.org/packages/"+
"3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/",
PythonIniConfig,
PythonPackaging,
PythonPluggy,
PythonPygments,
IniConfig,
Packaging,
Pluggy,
Pygments,
)
}

View File

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

View File

@@ -1,235 +0,0 @@
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

@@ -1,57 +0,0 @@
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/" + llvmVersionMajor + "/lib/" + triplet() +
"LIBCC=/system/lib/clang/21/lib/" + triplet() +
"/libclang_rt.builtins.a",
}, "/system/bin", "/bin")

View File

@@ -33,7 +33,5 @@ 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.5"
checksum = "rF52wLQP-jeAmcD-48wqJcck8ZWRFwkax3T-7snaRf5EBnCQQh0YypMY9lwcivLz"
version = "4.7.4"
checksum = "pG0E_wkRJFS6bvPYF-hTKZT-cWnvo5BbIzCDZrJZVQDgJOx2Vc3ZfNSEV7Di7cSW"
)
return t.NewPackage("squashfs-tools", version, pkg.NewHTTPGetTar(
nil, "https://github.com/plougher/squashfs-tools/releases/"+
@@ -47,7 +47,5 @@ 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,22 +1,20 @@
package rosa
import (
"strings"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newNSS() (pkg.Artifact, string) {
const (
version = "3.121"
checksum = "MTS4Eg-1vBN3T7gdUAdNO0y_e9x9BE3f_k_DHdM_BIovc7y57vhsZTfB5f6BeQfi"
version = "3_120"
checksum = "9M0SNMrj9BJp6RH2rQnMm6bZWtP0Kgj64D5JNPHF7Cxr2_8kfy3msubIcvEPwC35"
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_"+strings.Join(strings.SplitN(version, ".", 2), "_")+"_RTM.tar.gz",
"NSS_"+version+"_RTM.tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &PackageAttr{
@@ -74,8 +72,6 @@ func init() {
Name: "nss",
Description: "Network Security Services",
Website: "https://firefox-source-docs.mozilla.org/security/nss/index.html",
ID: 2503,
}
}
@@ -93,7 +89,6 @@ 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,7 +15,6 @@ func (t Toolchain) newStage0() (pkg.Artifact, string) {
runtimes,
clang,
t.Load(Zlib),
t.Load(Bzip2),
t.Load(Patch),

View File

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

View File

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

View File

@@ -53,10 +53,5 @@ 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.91"
checksum = "SQkjYShk2TutoBOfmeJcdLU9iDExVKOg0DZhLeL8U_qjc9olLTC7h3vuUBvVtx9w"
version = "1.24.0"
checksum = "JxgLiFRRGw2D3uhVw8ZeDbs3V7K_d4z_ypDog2LBqiA_5y2vVbUAk5NT6D5ozm0m"
)
return t.NewPackage("wayland", version, pkg.NewHTTPGetTar(
nil, "https://gitlab.freedesktop.org/wayland/wayland/"+
@@ -41,8 +41,6 @@ func init() {
Name: "wayland",
Description: "core Wayland window system code and protocol",
Website: "https://wayland.freedesktop.org/",
ID: 10061,
}
}
@@ -124,7 +122,5 @@ 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.20.2"
checksum = "Ze8QH3Z3emC0pWFP-0nUYeMy7aBW3L_dxBBmVgcumIHNzEKc1iGTR-yUFR3JcM1G"
version = "1.17"
checksum = "vYPO4Qq3B_WGcsBjG0-lfwZ6DZ7ayyrOLqfDrVOgTDcyLChuMGOAAVAa_UXLu5tD"
)
return t.NewPackage("util-macros", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/individual/util/"+
"util-macros-"+version+".tar.gz",
nil, "https://www.x.org/releases/X11R7.7/src/util/"+
"util-macros-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarGzip,
pkg.TarBzip2,
), nil, (*MakeHelper)(nil)), version
}
func init() {
@@ -21,18 +21,16 @@ 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.31"
checksum = "Cm69urWY5RctKpR78eGzuwrjDEfXGkvHRdodj6sjypOGy5FF4-lmnUttVHYV1ydg"
version = "7.0.23"
checksum = "goxwWxV0jZ_3pNczXFltZWHAhq92x-aEreUGyp5Ns8dBOoOmgbpeNIu1nv0Zx07z"
)
return t.NewPackage("xproto", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/individual/proto/"+
nil, "https://www.x.org/releases/X11R7.7/src/proto/"+
"xproto-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
@@ -56,21 +54,19 @@ 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.12"
checksum = "G9AjnU_C160q814MCdjFOVt_mQz_pIt4wf4GNOQmGJS3UuuyMw53sfPvJ7WOqwXN"
version = "1.0.7"
checksum = "bm768RoZZnHRe9VjNU1Dw3BhfE60DyS9D_bgSR-JLkEEyUWT_Hb_lQripxrXto8j"
)
return t.NewPackage("libXau", version, pkg.NewHTTPGetTar(
nil, "https://www.x.org/releases/individual/lib/"+
"libXau-"+version+".tar.gz",
nil, "https://www.x.org/releases/X11R7.7/src/lib/"+
"libXau-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarGzip,
pkg.TarBzip2,
), nil, &MakeHelper{
// ancient configure script
Generate: "autoreconf -if",
@@ -93,7 +89,5 @@ 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,8 +22,6 @@ 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,
}
}
@@ -52,7 +50,5 @@ func init() {
Name: "xcb",
Description: "The X protocol C-language Binding",
Website: "https://xcb.freedesktop.org/",
ID: 1767,
}
}

View File

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

View File

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

View File

@@ -16,6 +16,7 @@ func (t Toolchain) newZstd() (pkg.Artifact, string) {
Append: []string{"build", "cmake"},
Cache: [][2]string{
{"CMAKE_BUILD_TYPE", "Release"},
{"CMAKE_INSTALL_LIBDIR", "lib"},
},
}), version
}
@@ -26,7 +27,5 @@ 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.6> `
` <derivation hakurei-static-x86_64-unknown-linux-musl-0.3.5> `
@@ -805,7 +805,7 @@ package
*Default:*
` <derivation hakurei-hsu-0.3.6> `
` <derivation hakurei-hsu-0.3.5> `

View File

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