Skip to content

Commit dfb1fd0

Browse files
committed
update build_overlay
1 parent a98142d commit dfb1fd0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

nix/build_overlay.nix

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ let
99
if len == 0 then [ ] else final.lib.lists.take (len - 1) l ++ [ newVal ];
1010
in
1111
{
12+
# Override go_1_24 to create go_1_25 with Windows platform support
13+
# Native nixpkgs go_1_25 doesn't support Windows (x86_64-windows not in meta.platforms)
14+
# By overriding go_1_24, we inherit its Windows support
15+
# See: https://github.com/crypto-org-chain/chain-main/pull/1220
16+
go_1_25 = super.go_1_24.overrideAttrs (old: rec {
17+
version = "1.25.0";
18+
src = final.fetchurl {
19+
url = "https://go.dev/dl/go${version}.src.tar.gz";
20+
hash = "sha256-S9AekSlyB7+kUOpA1NWpOxtTGl5DhHOyoG4Y4HciciU=";
21+
};
22+
# Filter out patches that don't apply to Go 1.25
23+
patches = builtins.filter (
24+
patch:
25+
let
26+
patchName = builtins.baseNameOf (builtins.toString patch);
27+
in
28+
!final.lib.hasSuffix "-iana-etc-1.17.patch" patchName
29+
) (old.patches or [ ]);
30+
# Apply the iana-etc substitutions manually for Go 1.25
31+
postPatch = (old.postPatch or "") + ''
32+
substituteInPlace src/net/lookup_unix.go \
33+
--replace 'open("/etc/protocols")' 'open("${final.iana-etc}/etc/protocols")'
34+
substituteInPlace src/net/port_unix.go \
35+
--replace 'open("/etc/services")' 'open("${final.iana-etc}/etc/services")'
36+
'';
37+
});
1238
rocksdb = final.callPackage ./rocksdb.nix { };
1339
golangci-lint = final.callPackage ./golangci-lint.nix { };
1440

0 commit comments

Comments
 (0)