Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/packages/wandb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ versions:
- filename: wandb-0.28.2-py3-none-manylinux_2_39_riscv64.whl
sha256: 7b9a45a7da50aab34734ce201be69acb83d14f7899514995bdb62a7b9c18de09
requires-python: '>=3.10'
- version: 0.29.0
- version: 0.30.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 80188c19d33ba79407b5db2f47ee42a2c5ca87ef Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Thu, 27 Aug 2026 00:41:59 +0200
Subject: [PATCH] add riscv64 to the Go/Rust build target maps

Upstream-Status: To upstream [not submitted yet: wandb has no riscv64 CI runner, so a drive-by PR could not be exercised by upstream's own release workflow; needs a maintainer discussion first]

hatch_build.py derives GOARCH and the Rust target triple from the Python
platform name, but both tables only know amd64 and arm64. On riscv64
_platform_goarch() returns "" so _parse_target_platform() gives up, the
host fallback maps platform.machine() to "" as well, and the build runs
with an empty GOARCH.

Add riscv64 to the platform-name regex, to the GOARCH map and to the Rust
architecture map (riscv64gc-unknown-linux-gnu), so wandb-core, wandb-xpu
and librust_parquet_ffi.so build for riscv64. Existing platforms resolve
unchanged.

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
hatch_build.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hatch_build.py b/hatch_build.py
index f8bf67cd5..547b190ee 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -285,6 +285,7 @@ def _to_rust_target(goos: str, goarch: str, *, is_musl: bool) -> str | None:
rust_arch = {
"amd64": "x86_64",
"arm64": "aarch64",
+ "riscv64": "riscv64gc",
}.get(goarch)
if not rust_arch:
return None
@@ -301,7 +302,7 @@ def _to_rust_target(goos: str, goarch: str, *, is_musl: bool) -> str | None:

def _platform_goarch(platform_name: str) -> str:
arch_match = re.search(
- r"(?:-|_)(aarch64|arm64|x86_64|amd64)$",
+ r"(?:-|_)(aarch64|arm64|x86_64|amd64|riscv64)$",
platform_name,
)
return _to_goarch(arch_match.group(1)) if arch_match else ""
@@ -320,4 +321,5 @@ def _to_goarch(arch: str) -> str:
# arm64 synonyms
"arm64": "arm64",
"aarch64": "arm64",
+ "riscv64": "riscv64",
}.get(arch, "")
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From 2c4172c431304050eade11d86ad0375ac5e03bb6 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Thu, 27 Aug 2026 02:45:49 +0200
Subject: [PATCH] set the riscv64 ELF interpreter explicitly when linking
wandb-core

Upstream-Status: Inappropriate [works around golang/go#77209 in the Go toolchain core/go.mod pins; the fix belongs in Go, not in wandb, and this can be dropped once the pinned Go version carries CL 737180]

wandb-core vendors github.com/ebitengine/purego, whose
dlfcn_nocgo_linux.go declares //go:cgo_import_dynamic for dlopen/dlsym.
That makes Go's internal linker emit a dynamic executable even with
CGO_ENABLED=0, so the binary carries a PT_INTERP.

Go hardcodes /lib/ld.so.1 as the riscv64 dynamic loader, and no glibc
distribution installs that name -- Debian, Ubuntu and the manylinux
riscv64 image all ship /lib/ld-linux-riscv64-lp64d.so.1 only. The wheel
therefore built fine and then failed at run time with
"FileNotFoundError: [Errno 2] ... wandb/bin/wandb-core", which is what
execve reports for a missing interpreter.

golang/go#77209 fixed this in Go (CL 737180), after the go1.26.5 that
core/go.mod pins. Until the pinned toolchain carries the fix, pass the
correct path with the linker's -I flag; it is a no-op on the platforms
that link statically.

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
core/hatch.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/core/hatch.py b/core/hatch.py
index 7722923ef..9dbce91d2 100644
--- a/core/hatch.py
+++ b/core/hatch.py
@@ -53,7 +53,9 @@ def build_wandb_core(
race_detect_flags = ["-race"] if with_race_detection else []
output_flags = ["-o", str(".." / output_path)]

- ld_flags = [f"-ldflags={_go_linker_flags(wandb_commit_sha=wandb_commit_sha)}"]
+ ld_flags = [
+ f"-ldflags={_go_linker_flags(wandb_commit_sha, target_arch=target_arch)}"
+ ]

vendor_flags = ["-mod=vendor"]

@@ -120,7 +122,7 @@ def _strip_dynamic_elf_metadata(
pass


-def _go_linker_flags(wandb_commit_sha: str | None) -> str:
+def _go_linker_flags(wandb_commit_sha: str | None, target_arch: str) -> str:
"""Returns linker flags for the Go binary as a string."""
flags = [
"-s", # Omit the symbol table and debug info.
@@ -130,6 +132,12 @@ def _go_linker_flags(wandb_commit_sha: str | None) -> str:
f"main.commit={wandb_commit_sha or 'unknown'}",
]

+ # purego's //go:cgo_import_dynamic makes the internal linker emit a dynamic
+ # executable, and Go <=1.26 hardcodes /lib/ld.so.1 as the riscv64 ELF
+ # interpreter, which no glibc distribution installs (golang/go#77209).
+ if target_arch == "riscv64":
+ flags += ["-I", "/lib/ld-linux-riscv64-lp64d.so.1"]
+
return " ".join(flags)


Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 46c744f15c3e71664400843dfc2527a5d1d45d0b Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Thu, 27 Aug 2026 00:41:59 +0200
Subject: [PATCH] add riscv64 to the Go/Rust build target maps

Upstream-Status: To upstream [not submitted yet: wandb has no riscv64 CI runner, so a drive-by PR could not be exercised by upstream's own release workflow; needs a maintainer discussion first]

hatch_build.py derives GOARCH and the Rust target triple from the Python
platform name, but both tables only know amd64 and arm64. On riscv64
_platform_goarch() returns "" so _parse_target_platform() gives up, the
host fallback maps platform.machine() to "" as well, and the build runs
with an empty GOARCH.

Add riscv64 to the platform-name regex, to the GOARCH map and to the Rust
architecture map (riscv64gc-unknown-linux-gnu), so wandb-core, wandb-xpu
and librust_parquet_ffi.so build for riscv64. Existing platforms resolve
unchanged.

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
hatch_build.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hatch_build.py b/hatch_build.py
index f8bf67cd5..547b190ee 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -285,6 +285,7 @@ def _to_rust_target(goos: str, goarch: str, *, is_musl: bool) -> str | None:
rust_arch = {
"amd64": "x86_64",
"arm64": "aarch64",
+ "riscv64": "riscv64gc",
}.get(goarch)
if not rust_arch:
return None
@@ -301,7 +302,7 @@ def _to_rust_target(goos: str, goarch: str, *, is_musl: bool) -> str | None:

def _platform_goarch(platform_name: str) -> str:
arch_match = re.search(
- r"(?:-|_)(aarch64|arm64|x86_64|amd64)$",
+ r"(?:-|_)(aarch64|arm64|x86_64|amd64|riscv64)$",
platform_name,
)
return _to_goarch(arch_match.group(1)) if arch_match else ""
@@ -320,4 +321,5 @@ def _to_goarch(arch: str) -> str:
# arm64 synonyms
"arm64": "arm64",
"aarch64": "arm64",
+ "riscv64": "riscv64",
}.get(arch, "")
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From 029193002855a046a0a83f3c45826e1187e2caf9 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Thu, 27 Aug 2026 02:45:49 +0200
Subject: [PATCH] set the riscv64 ELF interpreter explicitly when linking
wandb-core

Upstream-Status: Inappropriate [works around golang/go#77209 in the Go toolchain core/go.mod pins; the fix belongs in Go, not in wandb, and this can be dropped once the pinned Go version carries CL 737180]

wandb-core vendors github.com/ebitengine/purego, whose
dlfcn_nocgo_linux.go declares //go:cgo_import_dynamic for dlopen/dlsym.
That makes Go's internal linker emit a dynamic executable even with
CGO_ENABLED=0, so the binary carries a PT_INTERP.

Go hardcodes /lib/ld.so.1 as the riscv64 dynamic loader, and no glibc
distribution installs that name -- Debian, Ubuntu and the manylinux
riscv64 image all ship /lib/ld-linux-riscv64-lp64d.so.1 only. The wheel
therefore built fine and then failed at run time with
"FileNotFoundError: [Errno 2] ... wandb/bin/wandb-core", which is what
execve reports for a missing interpreter.

golang/go#77209 fixed this in Go (CL 737180), after the go1.26.5 that
core/go.mod pins. Until the pinned toolchain carries the fix, pass the
correct path with the linker's -I flag; it is a no-op on the platforms
that link statically.

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
core/hatch.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/core/hatch.py b/core/hatch.py
index 7722923ef..9dbce91d2 100644
--- a/core/hatch.py
+++ b/core/hatch.py
@@ -53,7 +53,9 @@ def build_wandb_core(
race_detect_flags = ["-race"] if with_race_detection else []
output_flags = ["-o", str(".." / output_path)]

- ld_flags = [f"-ldflags={_go_linker_flags(wandb_commit_sha=wandb_commit_sha)}"]
+ ld_flags = [
+ f"-ldflags={_go_linker_flags(wandb_commit_sha, target_arch=target_arch)}"
+ ]

vendor_flags = ["-mod=vendor"]

@@ -120,7 +122,7 @@ def _strip_dynamic_elf_metadata(
pass


-def _go_linker_flags(wandb_commit_sha: str | None) -> str:
+def _go_linker_flags(wandb_commit_sha: str | None, target_arch: str) -> str:
"""Returns linker flags for the Go binary as a string."""
flags = [
"-s", # Omit the symbol table and debug info.
@@ -130,6 +132,12 @@ def _go_linker_flags(wandb_commit_sha: str | None) -> str:
f"main.commit={wandb_commit_sha or 'unknown'}",
]

+ # purego's //go:cgo_import_dynamic makes the internal linker emit a dynamic
+ # executable, and Go <=1.26 hardcodes /lib/ld.so.1 as the riscv64 ELF
+ # interpreter, which no glibc distribution installs (golang/go#77209).
+ if target_arch == "riscv64":
+ flags += ["-I", "/lib/ld-linux-riscv64-lp64d.so.1"]
+
return " ".join(flags)


Loading