From 7924c28ad9b7faa2beee3d24b27e7ea6bbe9a4c9 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sat, 17 May 2025 14:08:49 +0200 Subject: [PATCH] python3Packages.wandb: fix x86_64-darwin --- .../python-modules/wandb/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index df396b281391..ee89f7c83d50 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -7,6 +7,7 @@ buildGoModule, git, versionCheckHook, + fetchpatch2, ## gpu-stats rustPlatform, @@ -118,6 +119,23 @@ let sourceRoot = "${src.name}/core"; + # x86_64-darwin fails with: + # "link: duplicated definition of symbol dlopen, from github.com/ebitengine/purego and github.com/ebitengine/purego" + # This is fixed in purego 0.8.3, but wandb-core uses 0.8.2, so we pull in the fix here. + patches = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + (fetchpatch2 { + url = "https://github.com/ebitengine/purego/commit/1638563e361522e5f63511d84c4541ae1c5fd704.patch"; + stripLen = 1; + extraPrefix = "vendor/github.com/ebitengine/purego/"; + # These are not vendored by wandb-core + excludes = [ + "vendor/github.com/ebitengine/purego/.github/workflows/test.yml" + "vendor/github.com/ebitengine/purego/internal/fakecgo/gen.go" + ]; + hash = "sha256-GoT/OL6r3rJY5zoUyl3kGzSRpX3PoI7Yjpe7oRb0cFc="; + }) + ]; + # hardcode the `gpu_stats` binary path. postPatch = '' substituteInPlace pkg/monitor/gpuresourcemanager.go \