Unverified Commit 9d22b3e6 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

[Backport release-25.05] python3Packages.wandb: fix x86_64-darwin (#408491)

parents dae513c1 b24acc69
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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 \