From 8b4576bc5f6eaaf703886629f2dfa12ba38b574c Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 31 Jan 2026 05:09:17 +0900 Subject: internal/rosa: migrate to make helper This migrates artifacts that the helper cannot produce an identical instance of. Signed-off-by: Ophestra --- internal/rosa/python.go | 91 +++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 48 deletions(-) (limited to 'internal/rosa/python.go') diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 4aca9713..81cf9b45 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -12,57 +12,52 @@ func (t Toolchain) newPython() pkg.Artifact { version = "3.14.2" checksum = "7nZunVMGj0viB-CnxpcRego2C90X5wFsMTgsoewd5z-KSZY2zLuqaBwG-14zmKys" ) - skipTests := []string{ - // requires internet access (http://www.pythontest.net/) - "test_asyncio", - "test_socket", - "test_urllib2", - "test_urllibnet", - "test_urllib2net", - - // makes assumptions about uid_map/gid_map - "test_os", - "test_subprocess", - - // somehow picks up mtime of source code - "test_zipfile", - - // requires gcc - "test_ctypes", - - // breaks on llvm - "test_dbm_gnu", - } - return t.New("python-"+version, 0, []pkg.Artifact{ - t.Load(Make), - t.Load(Gawk), - t.Load(Coreutils), + return t.NewViaMake("python", version, t.NewPatchedSource("python", version, pkg.NewHTTPGetTar( + nil, "https://www.python.org/ftp/python/"+version+ + "/Python-"+version+".tgz", + mustDecode(checksum), + pkg.TarGzip, + ), false), &MakeAttr{ + // test_synopsis_sourceless assumes this is writable and checks __pycache__ + Writable: true, - t.Load(Zlib), - t.Load(Libffi), - }, nil, []string{ - "EXTRATESTOPTS=-j0 -x " + strings.Join(skipTests, " -x "), + Env: []string{ + "EXTRATESTOPTS=-j0 -x " + strings.Join([]string{ + // requires internet access (http://www.pythontest.net/) + "test_asyncio", + "test_socket", + "test_urllib2", + "test_urllibnet", + "test_urllib2net", + + // makes assumptions about uid_map/gid_map + "test_os", + "test_subprocess", + + // somehow picks up mtime of source code + "test_zipfile", + + // requires gcc + "test_ctypes", - // _ctypes appears to infer something from the linker name - "LDFLAGS=-Wl,--dynamic-linker=/system/lib/" + - "ld-musl-" + linuxArch() + ".so.1", - }, ` + // breaks on llvm + "test_dbm_gnu", + }, " -x "), + + // _ctypes appears to infer something from the linker name + "LDFLAGS=-Wl,--dynamic-linker=/system/lib/" + + "ld-musl-" + linuxArch() + ".so.1", + }, + + ScriptEarly: ` export HOME="$(mktemp -d)" -cd "$(mktemp -d)" -/usr/src/python/configure \ - --prefix=/system \ - --build="${ROSA_TRIPLE}" -make "-j$(nproc)" -make test -make DESTDIR=/work install -`, pkg.Path(AbsUsrSrc.Append("python"), true, - // test_synopsis_sourceless assumes this is writable and checks __pycache__ - t.NewPatchedSource("python", version, pkg.NewHTTPGetTar( - nil, "https://www.python.org/ftp/python/"+version+ - "/Python-"+version+".tgz", - mustDecode(checksum), - pkg.TarGzip, - ), false))) +`, + + CheckName: "test", + }, + t.Load(Zlib), + t.Load(Libffi), + ) } func init() { artifactsF[Python] = Toolchain.newPython } -- cgit v1.3.1