Skip to content

Commit 3c9c9a0

Browse files
committed
build
1 parent 7199de0 commit 3c9c9a0

8 files changed

+86
-24
lines changed

default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
stdenv,
44
buildGoApplication,
55
nix-gitignore,
6+
buildPackages,
67
coverage ? false, # https://tip.golang.org/doc/go1.20#cover
78
rocksdb,
89
network ? "mainnet", # mainnet|testnet

flake.lock

+29-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
inputs = {
3-
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
3+
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
44
flake-utils.url = "github:numtide/flake-utils";
55
nix-bundle-exe = {
66
url = "github:3noch/nix-bundle-exe";

nix/build_overlay.nix

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# some basic overlays necessary for the build
2-
final: super: {
2+
final: super:
3+
let
4+
replaceLast =
5+
newVal: l:
6+
let
7+
len = builtins.length l;
8+
in
9+
if len == 0 then [ ] else final.lib.lists.take (len - 1) l ++ [ newVal ];
10+
in
11+
{
12+
go_1_23 = super.go_1_23.overrideAttrs (old: rec {
13+
version = "1.23.4";
14+
src = final.fetchurl {
15+
url = "https://go.dev/dl/go${version}.src.tar.gz";
16+
hash = "sha256-rTRaxCHpCBQpOpaZzKGd1SOCUcP2h5gLvK4oSVsmNTE=";
17+
};
18+
# https://github.com/NixOS/nixpkgs/pull/372367
19+
patches = replaceLast ./go_no_vendor_checks-1.23.patch old.patches;
20+
});
321
rocksdb = final.callPackage ./rocksdb.nix { };
422
golangci-lint = final.callPackage ./golangci-lint.nix { };
523
}

nix/default.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import sources.nixpkgs {
1515
go-ethereum = pkgs.callPackage ./go-ethereum.nix {
1616
inherit (pkgs.darwin) libobjc;
1717
inherit (pkgs.darwin.apple_sdk.frameworks) IOKit;
18-
buildGoModule = pkgs.buildGo122Module;
18+
buildGoModule = pkgs.buildGo121Module;
1919
};
2020
flake-compat = import sources.flake-compat;
2121
chain-maind = pkgs.callPackage sources.chain-main { rocksdb = null; };
@@ -65,13 +65,13 @@ import sources.nixpkgs {
6565
(_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; })
6666
(_: pkgs: { cosmovisor = pkgs.callPackage ./cosmovisor.nix { }; })
6767
(_: pkgs: {
68-
rly = pkgs.buildGo122Module {
68+
rly = pkgs.buildGo121Module rec {
6969
name = "rly";
7070
src = sources.relayer;
7171
subPackages = [ "." ];
7272
vendorHash = "sha256-dwKZZu9wKOo2u1/8AAWFx89iC9pWZbCxAERMMAOFsts=";
7373
doCheck = false;
74-
env.GOWORK = "off";
74+
GOWORK = "off";
7575
postInstall = ''
7676
mv $out/bin/relayer $out/bin/rly
7777
'';

nix/go_no_vendor_checks-1.23.patch

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go
2+
index a3105b6b6d..0e10154a70 100644
3+
--- a/src/cmd/go/internal/modload/import.go
4+
+++ b/src/cmd/go/internal/modload/import.go
5+
@@ -345,7 +345,7 @@ func importFromModules(ctx context.Context, path string, rs *Requirements, mg *M
6+
// vendor/modules.txt does not exist or the user manually added directories to the vendor directory.
7+
// Go 1.23 and later require vendored packages to be present in modules.txt to be imported.
8+
_, ok := vendorPkgModule[path]
9+
- if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) {
10+
+ if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) || os.Getenv("GO_NO_VENDOR_CHECKS") == "1" {
11+
mods = append(mods, vendorPkgModule[path])
12+
dirs = append(dirs, dir)
13+
roots = append(roots, vendorDir)
14+
diff --git a/src/cmd/go/internal/modload/vendor.go b/src/cmd/go/internal/modload/vendor.go
15+
index b2cb44100e..05bf3829d5 100644
16+
--- a/src/cmd/go/internal/modload/vendor.go
17+
+++ b/src/cmd/go/internal/modload/vendor.go
18+
@@ -159,7 +159,7 @@ func checkVendorConsistency(indexes []*modFileIndex, modFiles []*modfile.File, m
19+
panic(fmt.Errorf("not in workspace mode but number of indexes is %v, not 1", len(indexes)))
20+
}
21+
index := indexes[0]
22+
- if gover.Compare(index.goVersion, "1.14") < 0 {
23+
+ if gover.Compare(index.goVersion, "1.14") < 0 || (os.Getenv("GO_NO_VENDOR_CHECKS") == "1" && len(vendorMeta) == 0) {
24+
// Go versions before 1.14 did not include enough information in
25+
// vendor/modules.txt to check for consistency.
26+
// If we know that we're on an earlier version, relax the consistency check.

nix/sources.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@
9797
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
9898
},
9999
"nixpkgs": {
100-
"branch": "release-24.11",
100+
"branch": "release-24.05",
101101
"description": "Nix Packages collection",
102102
"homepage": "",
103103
"owner": "NixOS",
104104
"repo": "nixpkgs",
105-
"rev": "112c247873ba67732a9dd2563cb3d7b7749a82df",
106-
"sha256": "00ghsa6842lkd0c0k0ln6531inq03y4m0nphczwnhf5n9g72sddh",
105+
"rev": "0da3c44a9460a26d2025ec3ed2ec60a895eb1114",
106+
"sha256": "1n435wya14pbl04g6n4zrqaslpik4xq0fv1i2g2mz8sq3dqg7dk0",
107107
"type": "tarball",
108-
"url": "https://github.com/NixOS/nixpkgs/archive/112c247873ba67732a9dd2563cb3d7b7749a82df.tar.gz",
108+
"url": "https://github.com/NixOS/nixpkgs/archive/0da3c44a9460a26d2025ec3ed2ec60a895eb1114.tar.gz",
109109
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
110110
},
111111
"poetry2nix": {
@@ -114,10 +114,10 @@
114114
"homepage": "",
115115
"owner": "nix-community",
116116
"repo": "poetry2nix",
117-
"rev": "d90f9db68a4bda31c346be16dfd8d3263be4547e",
118-
"sha256": "0yfg51z8giwapc4kxxcrh47xr0zppwxiwaj7iyy6qsfd3a9649yz",
117+
"rev": "4eb2ac54029af42a001c9901194e9ce19cbd8a40",
118+
"sha256": "16fi71fpywiqsya1z99kkb14dansyrmkkrb2clzs3b5qqx673wf4",
119119
"type": "tarball",
120-
"url": "https://github.com/nix-community/poetry2nix/archive/d90f9db68a4bda31c346be16dfd8d3263be4547e.tar.gz",
120+
"url": "https://github.com/nix-community/poetry2nix/archive/4eb2ac54029af42a001c9901194e9ce19cbd8a40.tar.gz",
121121
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
122122
},
123123
"relayer": {

nix/testenv.nix

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ poetry2nix.mkPoetryEnv {
1919
flake8-isort = [ "hatchling" ];
2020
pyunormalize = [ "setuptools" ];
2121
eth-bloom = [ "setuptools" ];
22-
isort = [ "poetry-core" ];
2322
};
2423
in
2524
lib.mapAttrs (

0 commit comments

Comments
 (0)