flake.nix: add patch for debug/mod.go (#19238)

main
Mike O'Driscoll 2 weeks ago committed by GitHub
parent 7ddbd84171
commit 5ba3015b48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      flake.nix

@ -55,7 +55,7 @@
system = system;
overlays = [
(final: prev: {
go_1_26 = prev.go_1_26.overrideAttrs {
go_1_26 = prev.go_1_26.overrideAttrs (old: {
version = goVersion;
src = prev.fetchFromGitHub {
owner = "tailscale";
@ -63,7 +63,19 @@
rev = toolChainRev;
sha256 = gitHash;
};
};
# The Tailscale Go fork carries a placeholder in
# src/runtime/debug/mod.go that must be replaced with
# the actual toolchain git rev at build time. Without
# this, binaries report an empty tailscale.toolchain.rev
# and the runtime assertion in
# assert_ts_toolchain_match.go panics.
postPatch =
(old.postPatch or "")
+ ''
substituteInPlace src/runtime/debug/mod.go \
--replace-fail "TAILSCALE_GIT_REV_TO_BE_REPLACED_AT_BUILD_TIME" "${toolChainRev}"
'';
});
})
];
}));

Loading…
Cancel
Save