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

Unable to add cargo pkg #2441

Open
guerinoni opened this issue Dec 8, 2024 · 2 comments
Open

Unable to add cargo pkg #2441

guerinoni opened this issue Dec 8, 2024 · 2 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@guerinoni
Copy link

What happened?

  1. devbox is started with direnv eval "$(devbox generate direnv --print-envrc)"
  2. devbox add [email protected] with this output
Error: There was an error installing nix packages
source: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35): exit code 1
  1. DEVBOX_DEBUG=1 devbox add [email protected]
time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.                                                                                                                                           time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json         time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=177.833µs                                                                                                                                 time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.                                                                                                                                           time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json         time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=40.583µs
time=2024-12-08T22:36:58.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:342 msg="nix --version --debug output" out="nix (Nix) 2.18.8\nSystem type: aarch64-darwin\nAdditional system types: x86_64-darwin\nFeatures: gc, signed-caches\nSystem configuration file: /etc/nix/nix.conf\nUser configuration files: /Users/guerra/.config/nix/nix.conf:/etc/xdg/nix/nix.conf\nStore directory: /nix/store\nState directory: /nix/var/nix\nData directory: /nix/store/7wr913d7zdn899ggl9p48gas243znipa-nix-2.18.8/share\n"
time=2024-12-08T22:36:58.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/usr/local/bin/nix cmd.pid=3043 cmd.code=0 cmd.dur=36.57625ms
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=96.041µs
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.097+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store ping --store daemon --json" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:59.175+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store ping --store daemon --json" cmd.path=/usr/local/bin/nix cmd.pid=3045 cmd.code=0 cmd.dur=77.394416ms
time=2024-12-08T22:36:59.175+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devbox/providers/nixcache/setup.go:86 msg="nixcache: running setup: first time setup"
Info: Adding package "[email protected]" to devbox.json
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/arsxsvbjmappgjrxviayspqnjm1nhrma-cargo-1.82.0" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/arsxsvbjmappgjrxviayspqnjm1nhrma-cargo-1.82.0" cmd.path=/usr/local/bin/nix cmd.pid=3048 cmd.code=0 cmd.dur=68.534375ms
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
⣾ Computing the Devbox environment...
time=2024-12-08T22:36:59.332+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:85 msg="running print-dev-env cmd" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake"
time=2024-12-08T22:36:59.332+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen⣽ Computing the Devbox environment...
time=2024-12-08T22:37:04.374+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake" cmd.path=/usr/local/bin/nix cmd.stderr="unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35)" cmd.pid=3051 cmd.code=1 cmd✓ Computed the Devbox environment.

Error: There was an error installing nix packages
source: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35): exit code 1

time=2024-12-08T22:37:04.374+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:68 msg="command error" stderr="trace: downloading [email protected]\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 311 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 501 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 1355 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 2019 ms\nerror:\n       … while calling the 'derivationStrict' builtin\n\n         at /builtin/derivation.nix:9:12: (source not available)\n\n       … while evaluating derivation 'nix-shell'\n         whose name attribute is located at /nix/store/j0jlb33bm31w347w43051hbffgh616jr-source/pkgs/stdenv/generic/make-derivation.nix:300:7\n\n       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'\n\n         at /nix/store/j0jlb33bm31w347w43051hbffgh616jr-source/pkgs/stdenv/generic/make-derivation.nix:347:7:\n\n          346|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;\n          347|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;\n             |       ^\n          348|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;\n\n       error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35)\n" execid=0992ab895fc54c63bcd51d57ef2ef50a stack=<nil>
time=2024-12-08T22:37:04.375+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:70 msg="command error" execid=0992ab895fc54c63bcd51d57ef2ef50a stack=<nil>
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=318.042µs

Steps to reproduce

Already provided above, another notable thing is I have in the same system devbox and flox don't know if those are in "conflict" between them, should be only wrapper of nix

Command

No response

devbox.json

{
    "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
    "packages": [],
    "shell": {
      "init_hook": [
        "echo 'Welcome to devbox!' > /dev/null"
      ],
      "scripts": {
        "test": [
          "echo \"Error: no test specified\" && exit 1"
        ]
      }
    }
  }

Devbox version

0.13.7

Nix version

nix (Nix) 2.18.8

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=. time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=177.833µs time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=. time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json time=2024-12-08T22:36:58.808+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=40.583µs
time=2024-12-08T22:36:58.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:342 msg="nix --version --debug output" out="nix (Nix) 2.18.8\nSystem type: aarch64-darwin\nAdditional system types: x86_64-darwin\nFeatures: gc, signed-caches\nSystem configuration file: /etc/nix/nix.conf\nUser configuration files: /Users/guerra/.config/nix/nix.conf:/etc/xdg/nix/nix.conf\nStore directory: /nix/store\nState directory: /nix/var/nix\nData directory: /nix/store/7wr913d7zdn899ggl9p48gas243znipa-nix-2.18.8/share\n"
time=2024-12-08T22:36:58.858+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' eval --impure --raw --expr builtins.currentSystem" cmd.path=/usr/local/bin/nix cmd.pid=3043 cmd.code=0 cmd.dur=36.57625ms
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=96.041µs
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:58.895+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.097+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store ping --store daemon --json" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:59.175+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' store ping --store daemon --json" cmd.path=/usr/local/bin/nix cmd.pid=3045 cmd.code=0 cmd.dur=77.394416ms
time=2024-12-08T22:36:59.175+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devbox/providers/nixcache/setup.go:86 msg="nixcache: running setup: first time setup"
Info: Adding package "[email protected]" to devbox.json
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.262+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/arsxsvbjmappgjrxviayspqnjm1nhrma-cargo-1.82.0" cmd.path=/usr/local/bin/nix
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' path-info --offline --json /nix/store/arsxsvbjmappgjrxviayspqnjm1nhrma-cargo-1.82.0" cmd.path=/usr/local/bin/nix cmd.pid=3048 cmd.code=0 cmd.dur=68.534375ms
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
time=2024-12-08T22:36:59.331+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:200 msg="package doesn't need patching" pkg=cargo mode=auto
⣾ Computing the Devbox environment...
time=2024-12-08T22:36:59.332+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/nix.go:85 msg="running print-dev-env cmd" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake"
time=2024-12-08T22:36:59.332+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:60 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen⣽ Computing the Devbox environment...
time=2024-12-08T22:37:04.374+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/nix/command.go:67 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake" cmd.path=/usr/local/bin/nix cmd.stderr="unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35)" cmd.pid=3051 cmd.code=1 cmd✓ Computed the Devbox environment.

Error: There was an error installing nix packages
source: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/Users/guerra/clementine/.devbox/gen/flake: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35): exit code 1

time=2024-12-08T22:37:04.374+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:68 msg="command error" stderr="trace: downloading [email protected]\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 311 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 501 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 1355 ms\nwarning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 2019 ms\nerror:\n … while calling the 'derivationStrict' builtin\n\n at /builtin/derivation.nix:9:12: (source not available)\n\n … while evaluating derivation 'nix-shell'\n whose name attribute is located at /nix/store/j0jlb33bm31w347w43051hbffgh616jr-source/pkgs/stdenv/generic/make-derivation.nix:300:7\n\n … while evaluating attribute 'buildInputs' of derivation 'nix-shell'\n\n at /nix/store/j0jlb33bm31w347w43051hbffgh616jr-source/pkgs/stdenv/generic/make-derivation.nix:347:7:\n\n 346| depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0;\n 347| buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1;\n | ^\n 348| depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0;\n\n error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35)\n" execid=0992ab895fc54c63bcd51d57ef2ef50a stack=
time=2024-12-08T22:37:04.375+01:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:70 msg="command error" execid=0992ab895fc54c63bcd51d57ef2ef50a stack=
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2024-12-08T22:37:04.375+01:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/Users/guerra/clementine/devbox.json dur=318.042µs

@guerinoni guerinoni added bug Something isn't working triage Issue needs triage labels Dec 8, 2024
@pinage404
Copy link
Contributor

Hi,

To know if it's related to #2420, can you try to replace eval "$(devbox generate direnv --print-envrc)" with eval "$(devbox shellenv --init-hook --install --no-refresh-alias --omit-nix-env)" ?

@guerinoni
Copy link
Author

Now it works, it is something messed up with nix, flox/devbox should be wrapper on top of nix, but apparently they do something that can screw everything :| I'll try to reproduce those situation, but is tricky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

2 participants