From e6debce649366c54406b41a8f8a0be64fabd9aa8 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 2 May 2026 21:47:01 +0900 Subject: [PATCH] internal/rosa/llvm: make source independently available This is unfortunately still required, due to the monorepo nature of LLVM. Signed-off-by: Ophestra --- internal/rosa/all.go | 3 ++- internal/rosa/llvm.go | 34 ++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/internal/rosa/all.go b/internal/rosa/all.go index fb745c0a..6f0aefcc 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -171,7 +171,8 @@ const ( // PresetUnexportedStart is the first unexported preset. PresetUnexportedStart - buildcatrust = iota - 1 + llvmSource = iota - 1 + buildcatrust utilMacros // Musl is a standalone libc that does not depend on the toolchain. diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go index a4bdb2c6..feba103c 100644 --- a/internal/rosa/llvm.go +++ b/internal/rosa/llvm.go @@ -9,11 +9,6 @@ import ( ) func (t Toolchain) newLLVM() (pkg.Artifact, string) { - const ( - version = "22.1.4" - checksum = "Bk3t-tV5sD5T0bqefFMcLeFuAwXnhFipywZmqst5hAZs97QQWGKB_5XyAFjj5tDB" - ) - cache := []KV{ {"CMAKE_BUILD_TYPE", "Release"}, @@ -127,11 +122,8 @@ func (t Toolchain) newLLVM() (pkg.Artifact, string) { }...) } - return t.NewPackage("llvm", version, t.NewPatchedSource("llvm", version, newFromGitHub( - "llvm/llvm-project", - "llvmorg-"+version, - checksum, - ), true, llvmPatches...), nil, &CMakeHelper{ + version := t.Version(llvmSource) + return t.NewPackage("llvm", version, t.Load(llvmSource), nil, &CMakeHelper{ Append: []string{"llvm"}, Cache: cache, @@ -174,6 +166,26 @@ ninja ` + jobsFlagE + ` check-all ), version } func init() { + const ( + version = "22.1.4" + checksum = "Bk3t-tV5sD5T0bqefFMcLeFuAwXnhFipywZmqst5hAZs97QQWGKB_5XyAFjj5tDB" + ) + + artifactsM[llvmSource] = Metadata{ + f: func(t Toolchain) (pkg.Artifact, string) { + return t.NewPatchedSource("llvm", version, newFromGitHub( + "llvm/llvm-project", + "llvmorg-"+version, + checksum, + ), true, llvmPatches...), version + }, + + Name: "llvm-project", + Description: "LLVM monorepo with Rosa OS patches", + + ID: 1830, + } + artifactsM[LLVM] = Metadata{ f: Toolchain.newLLVM, @@ -186,7 +198,5 @@ func init() { Zstd, Musl, }, - - ID: 1830, } }