From 8807cbc7305e424725b2be8eed7ecd9234f7772e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 19 May 2026 00:03:42 +0900 Subject: internal/rosa: create metadata alongside artifact This enables deferring evaluation of azalea-based packages and fixes the longstanding quirk of version being disjoint from other metadata. Signed-off-by: Ophestra --- internal/rosa/python.go | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'internal/rosa/python.go') diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 93fe0d70..a9ec642a 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -88,9 +88,7 @@ index 19aea290b58..51603ba9510 100644 ), version } func init() { - native.MustRegister(&Artifact{ - f: Toolchain.newPython, - + native.mustRegister(Toolchain.newPython, &Metadata{ Name: "python", Description: "the Python programming language interpreter", Website: "https://www.python.org/", @@ -200,15 +198,13 @@ func (s *S) newPythonPackage( build P, extra ...ArtifactH, ) { name = "python-" + name - s.MustRegister(&Artifact{ - f: func(t Toolchain) (pkg.Artifact, string) { - return t.NewPackage(name, version, source, attrP, attr, slices.Concat( - P{Python}, - extra, - build, - )...), version - }, - + s.mustRegister(func(t Toolchain) (pkg.Artifact, string) { + return t.NewPackage(name, version, source, attrP, attr, slices.Concat( + P{Python}, + extra, + build, + )...), version + }, &Metadata{ Name: name, Description: description, Website: website, @@ -352,18 +348,16 @@ func init() { } func init() { - native.MustRegister(&Artifact{ - f: func(t Toolchain) (pkg.Artifact, string) { - source, version := t.Load(llvmSource) - return t.NewPackage("lit", version, source, nil, &PipHelper{ - Append: []string{"llvm", "utils", "lit"}, - // already checked during llvm - SkipCheck: true, - }, - PythonSetuptools, - ), version + native.mustRegister(func(t Toolchain) (pkg.Artifact, string) { + meta, source := t.Load(llvmSource) + return t.NewPackage("lit", meta.Version, source, nil, &PipHelper{ + Append: []string{"llvm", "utils", "lit"}, + // already checked during llvm + SkipCheck: true, }, - + PythonSetuptools, + ), meta.Version + }, &Metadata{ Name: "lit", Description: "a portable tool for executing LLVM and Clang style test suites", Website: "https://llvm.org/docs/CommandGuide/lit.html", -- cgit v1.3.1