From 50b82dcf8265a4fe00e9856759553c26dfc43f58 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 22 Jan 2026 05:42:23 +0900 Subject: [PATCH] internal/rosa/gnu: coreutils artifact Required by llvm unit and regression tests. Signed-off-by: Ophestra --- internal/rosa/gnu.go | 34 +++++++++++++++++++++++++++++++--- internal/rosa/llvm.go | 1 + 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go index b208718..5d0b917 100644 --- a/internal/rosa/gnu.go +++ b/internal/rosa/gnu.go @@ -149,9 +149,6 @@ func (t Toolchain) NewBash() pkg.Artifact { return t.New("bash-"+version, []pkg.Artifact{ t.NewMake(), }, nil, nil, ` -cd /usr/src/bash -test_disable() { chmod +w "$2" && echo "$1" > "$2"; } - cd "$(mktemp -d)" /usr/src/bash/configure \ --prefix=/system \ @@ -166,3 +163,34 @@ make DESTDIR=/work install pkg.TarGzip, ))) } + +// NewCoreutils returns a [pkg.Artifact] containing an installation of GNU Coreutils. +func (t Toolchain) NewCoreutils() pkg.Artifact { + const ( + version = "9.9" + checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6" + ) + return t.New("coreutils-"+version, []pkg.Artifact{ + t.NewMake(), + t.NewPerl(), + + t.NewKernelHeaders(), + }, nil, nil, ` +cd /usr/src/coreutils +test_disable() { chmod +w "$2" && echo "$1" > "$2"; } + +test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh + +cd "$(mktemp -d)" +/usr/src/coreutils/configure \ + --prefix=/system \ + --build="${ROSA_TRIPLE}" +make "-j$(nproc)" check +make DESTDIR=/work install +`, pkg.Path(AbsUsrSrc.Append("coreutils"), true, pkg.NewHTTPGetTar( + nil, + "https://ftp.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz", + mustDecode(checksum), + pkg.TarGzip, + ))) +} diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index fd31d4b..ecb383d 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -130,6 +130,7 @@ func (t Toolchain) newLLVM(variant string, attr *llvmAttr) pkg.Artifact { t.NewPerl(), t.NewDiffutils(), t.NewBash(), + t.NewCoreutils(), t.NewKernelHeaders(), }