aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/python.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-31 05:09:17 +0900
committerOphestra <cat@gensokyo.uk>2026-01-31 08:55:33 +0900
commit8b4576bc5f6eaaf703886629f2dfa12ba38b574c (patch)
treef347a2189841297be8c5bc96b02dfc610490b19d /internal/rosa/python.go
parent29ebc52e26811b0a657bd1978b0c02284822462f (diff)
internal/rosa: migrate to make helper
This migrates artifacts that the helper cannot produce an identical instance of. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/python.go')
-rw-r--r--internal/rosa/python.go83
1 files changed, 39 insertions, 44 deletions
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",
+ 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,
- // makes assumptions about uid_map/gid_map
- "test_os",
- "test_subprocess",
+ 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",
- // somehow picks up mtime of source code
- "test_zipfile",
+ // makes assumptions about uid_map/gid_map
+ "test_os",
+ "test_subprocess",
- // requires gcc
- "test_ctypes",
+ // somehow picks up mtime of source code
+ "test_zipfile",
- // breaks on llvm
- "test_dbm_gnu",
- }
- return t.New("python-"+version, 0, []pkg.Artifact{
- t.Load(Make),
- t.Load(Gawk),
- t.Load(Coreutils),
+ // requires gcc
+ "test_ctypes",
- t.Load(Zlib),
- t.Load(Libffi),
- }, nil, []string{
- "EXTRATESTOPTS=-j0 -x " + strings.Join(skipTests, " -x "),
+ // 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",
+ },
- // _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 }