Skip to content

Commit 33da64d

Browse files
committed
fix(flake.nix): remove preBuild to fix building on Linux
On Linux, network access isn't available inside of a build. It seems to build correctly without this `preBuild` hook. See: #14728 (comment) ``` $ nix develop warning: Git tree '/home/colin/Projects/coder/coder' is dirty error: builder for '/nix/store/wg14v4ylmjrf2krlxbk6a049nvc23zad-protoc-gen-go.drv' failed with exit code 1; last 10 log lines: > calling 'postUnpack' function hook '_updateSourceDateEpochFromSourceRoot' > Running phase: patchPhase > Running phase: updateAutotoolsGnuConfigScriptsPhase > Running phase: configurePhase > calling 'preConfigure' function hook '_multioutConfig' > Running phase: buildPhase > evaling implicit 'preBuild' string hook > go: github.com/golang/protobuf@v1.5.0: Get "https://proxy.golang.org/github.com/golang/protobuf/@v/v1.5.0.info": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:33535->[::1]:53: read: connection refused > go: github.com/google/go-cmp@v0.5.5: Get "https://proxy.golang.org/github.com/google/go-cmp/@v/v0.5.5.info": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:54889->[::1]:53: read: connection refused > /nix/store/5r0df66ikad3xw06azlqvswcvncll8wa-stdenv-linux/setup: line 193: pop_var_context: head of shell_variables not a function context For full logs, run 'nix log /nix/store/wg14v4ylmjrf2krlxbk6a049nvc23zad-protoc-gen-go.drv'. error: 1 dependencies of derivation '/nix/store/z9ik49f82idmhi99ra9zvd3q38cqsg9s-nix-shell-env.drv' failed to build ```
1 parent 742413e commit 33da64d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

flake.nix

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
name = "protoc-gen-go";
4545
owner = "protocolbuffers";
4646
repo = "protobuf-go";
47-
rev = "v1.30.0";
47+
rev = "v1.30.0";
4848
src = pkgs.fetchFromGitHub {
4949
owner = "protocolbuffers";
5050
repo = "protobuf-go";
@@ -54,11 +54,6 @@
5454
};
5555
subPackages = [ "cmd/protoc-gen-go" ];
5656
vendorHash = null;
57-
proxyVendor = true;
58-
preBuild = ''
59-
export GOPROXY=https://proxy.golang.org,direct
60-
go mod download
61-
'';
6257
};
6358

6459
# The minimal set of packages to build Coder.
@@ -172,7 +167,7 @@
172167
'';
173168
};
174169
packages = {
175-
proto_gen_go = proto_gen_go_1_30;
170+
proto_gen_go = proto_gen_go_1_30;
176171
all = pkgs.buildEnv {
177172
name = "all-packages";
178173
paths = devShellPackages;

0 commit comments

Comments
 (0)