Skip to content

fix(flake.nix): remove preBuild to fix building on Linux #15259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

coadler
Copy link
Contributor

@coadler coadler commented Oct 28, 2024

On Linux, network access isn't available inside of a build. It seems to build correctly without this preBuild hook.

See: #14728 (comment)
cc @joobisb

$ 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

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
```
@coadler coadler requested a review from dannykopping October 28, 2024 21:00
@coadler coadler self-assigned this Oct 28, 2024
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

On Linux, network access isn't available inside of a build.
@coadler do you have a reference for this?

@coadler
Copy link
Contributor Author

coadler commented Oct 29, 2024

@dannykopping

LGTM

On Linux, network access isn't available inside of a build.
@coadler do you have a reference for this?

I found this which seems to have run into the same issue with OSX vs Linux builds.

@joobisb
Copy link
Contributor

joobisb commented Oct 29, 2024

@coadler Thanks for fixing this!

@coadler coadler merged commit ceb168b into main Oct 29, 2024
26 checks passed
@coadler coadler deleted the colin/nix-flake-linux branch October 29, 2024 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants