Skip to content
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

devenv container build processes fails with unexpected buildGoModule error #1083

Closed
jab opened this issue Mar 30, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@jab
Copy link

jab commented Mar 30, 2024

Describe the bug

I just followed the https://devenv.sh/containers/ docs to try to build a container for (essentially a "hello world") Python webapp using devenv for the first time. Though devenv up works as expected (it starts my server process and I can verify it's successfully serving requests), devenv container build processes fails with a "buildGoModule" error deep in github:NixOS/nixpkgs/.../lib/strings.nix:

❯ devenv processes up -d
• Building processes ...
• Failed to get cachix caches due to evaluation error
✔ Building processes in 5.7s.
• Starting processes ...• Building shell ...
• Failed to get cachix caches due to evaluation error
✔ Building shell in 5.6s.
• PID is 119314
• See logs:  $ tail -f /home/jab/src/hello-nix-image-py-webapp/.devenv/processes.log
• Stop:      $ devenv processes stop
✔ Starting processes in 5.6s.

❯ curl localhost:8000  # prove the server process is up and running
2024-03-29 23:55:24⏎

❯ devenv container build processes  # wat:
• Building processes container ...
• Failed to get cachix caches due to evaluation error
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'image-processes.json'
         whose name attribute is located at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'image-processes.json'
         at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/pkgs/build-support/trivial-builders/default.nix:68:16:
           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'nix2container-1.0.0'
         whose name attribute is located at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'configurePhase' of derivation 'nix2container-1.0.0'
         at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/pkgs/build-support/go/module.nix:172:5:
          171|
          172|     configurePhase = args.configurePhase or (''
             |     ^
          173|       runHook preConfigure

       … from call site
         at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/pkgs/build-support/go/module.nix:180:10:
          179|       cd "$modRoot"
          180|     '' + lib.optionalString (vendorHash != null) ''
             |          ^
          181|       ${if proxyVendor then ''

       … while calling 'optionalString'
         at «github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d»/lib/strings.nix:256:5:
          255|     # String to return if condition is true
          256|     string: if cond then string else "";
             |     ^
          257|

       error:
       error: buildGoModule: Expect vendorHash instead of vendorSha256

✖ Command produced the following output:


✔ Building processes container in 1.5s.
Error:   × Command `/nix/store/l24rmcpdnachwhz4rjwb9d89m3gxfy5n-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes
  │ --option warn-dirty false --option eval-cache false --keep-going --max-jobs 1 build --print-out-paths --no-link .#devenv.containers.processes.derivation` failed with
  │ with exit code 1



Reproducing

Please see https://github.com/jab/hello-nix-image-py-webapp for the code I used to reproduce this.

Version

devenv 1.0.1 (x86_64-linux)

@jab jab added the bug Something isn't working label Mar 30, 2024
@jab
Copy link
Author

jab commented Mar 30, 2024

In case it's relevant, I changed my devenv.yaml to use a nixpkgs url of github:NixOS/nixpkgs/nixpkgs-unstable (as suggested in #1071 (comment)) just so I could get as far as devenv up working. Not sure if this has anything to do with this nix2container stuff not working though.

@nlewo
Copy link
Contributor

nlewo commented Mar 31, 2024

The nix2container issue has been fixed by nlewo/nix2container#126.

@MaxDaten
Copy link

@nlewo awesome, thank you very much!

jab added a commit to jab/hello-nix-image-py-webapp that referenced this issue Mar 31, 2024
@jab
Copy link
Author

jab commented Mar 31, 2024

Thanks @nlewo, after running devenv update, I can now run devenv container build processes successfully.

Closing this, but unfortunately I immediately hit a new issue when trying devenv container run processes, so I've opened a new issue to track that.

@jab jab closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants