From 20fb06d29da4e1d6902e670568c98fbb14fc6c74 Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Mon, 14 Sep 2026 08:04:45 +0000 Subject: [PATCH] d2: fix version string and raster closure test Upstream renamed the Go module from oss.terrastruct.com/d2 to github.com/d2lang/d2 in 0.9.0, so the -X ldflag no longer matched anything and `d2 --version` reported the baked-in v0.8.1-HEAD. The new d2renderers/d2raster closure test shells out to `go list -mod=readonly -deps`, which overrides GOFLAGS=-mod=vendor and therefore bypasses vendor/, leaving it to resolve modules from an empty module cache with GOPROXY=off. Switch to proxyVendor so the cache is populated. Assisted-by: Claude Code (Claude Opus 5) --- pkgs/by-name/d2/d2/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/d2/d2/package.nix b/pkgs/by-name/d2/d2/package.nix index 0e83442723f5..cbedbb9d9829 100644 --- a/pkgs/by-name/d2/d2/package.nix +++ b/pkgs/by-name/d2/d2/package.nix @@ -29,7 +29,11 @@ buildGo127Module (finalAttrs: { hash = "sha256-HhCktLU43Y/uje038axwO7tNqO353mV/JID223sBtd8="; }; - vendorHash = "sha256-LRvQ4diXmoZNnRomVv6HTni6jrJ8e0IHqxVmJhEFR/w="; + # d2renderers/d2raster's TestRasterPackageHasNoIOCapabilities shells out to + # `go list -mod=readonly -deps`, which bypasses the vendor directory and needs + # a populated module cache. + proxyVendor = true; + vendorHash = "sha256-6rrFjboeJ2Qln5TxbsJKmyTclIh1gz1X91g5IFjbMKo="; excludedPackages = [ "./ci" @@ -40,7 +44,7 @@ buildGo127Module (finalAttrs: { ldflags = [ "-s" "-w" - "-X oss.terrastruct.com/d2/lib/version.Version=v${finalAttrs.version}" + "-X github.com/d2lang/d2/lib/version.Version=v${finalAttrs.version}" ]; nativeBuildInputs = [