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

0.14.0-deva list outdated #2510

Closed
djgoku opened this issue Feb 11, 2025 · 1 comment · Fixed by #2511
Closed

0.14.0-deva list outdated #2510

djgoku opened this issue Feb 11, 2025 · 1 comment · Fixed by #2511
Labels
bug Something isn't working triage Issue needs triage

Comments

@djgoku
Copy link
Contributor

djgoku commented Feb 11, 2025

What happened?

Was testing out devbox ls —outdated and it error on 0.14.0-deva

Steps to reproduce

  1. cd /tmp/devbox-0.14.0-deva
  2. devbox add enchant.dev
  3. devbox ls —outdated errors with Error: failed to fetch resolved package: enchant.out@latest: package not found

Command

No response

devbox.json

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

Devbox version

0.14.0-deva

Nix version

nix (Nix) 2.18.6

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

onfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2025-02-10T22:52:23.439-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2025-02-10T22:52:23.439-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/tmp/devbox/devbox.json dur=44.5µs
time=2025-02-10T22:52:23.439-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=enchant.out mode=auto
time=2025-02-10T22:52:23.459-06:00 level=DEBUG source=go.jetpack.io/devbox/nix/nix.go:143 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug"
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/nix/nix.go:143 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' --version --debug" cmd.path=/nix/var/nix/profiles/default/bin/nix cmd.pid=27364 cmd.code=0 cmd.dur=44.965333ms
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/tmp/devbox/devbox.json dur=122.875µs
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=enchant.out mode=auto
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=enchant.out mode=auto
time=2025-02-10T22:52:23.504-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=enchant.out mode=auto
Error: failed to fetch resolved package: enchant.out@latest: package not found

time=2025-02-10T22:52:24.031-06:00 level=ERROR source=go.jetpack.io/devbox/internal/boxcli/midcobra/debug.go:70 msg="command error" execid=bf5d83deb45144fb8ba13edaaad2c3c4 stack="package not found\ngo.jetpack.io/devbox/internal/nix.init\n\t<autogenerated>:1\nruntime.doInit1\n\truntime/proc.go:7278\nruntime.doInit\n\truntime/proc.go:7245\nruntime.main\n\truntime/proc.go:254\nruntime.goexit\n\truntime/asm_arm64.s:1223"
time=2025-02-10T22:52:24.031-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:125 msg="searching for config file (including parent directories)" path=.
time=2025-02-10T22:52:24.031-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:146 msg="trying config file" path=devbox.json
time=2025-02-10T22:52:24.032-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devconfig/config.go:133 msg="config file found" path=/tmp/devbox/devbox.json dur=590.334µs
time=2025-02-10T22:52:24.032-06:00 level=DEBUG source=go.jetpack.io/devbox/internal/devpkg/package.go:204 msg="package doesn't need patching" pkg=enchant.out mode=auto
@djgoku djgoku added bug Something isn't working triage Issue needs triage labels Feb 11, 2025
@Lagoja
Copy link
Contributor

Lagoja commented Feb 11, 2025

Thanks for reporting! looks like the ls --outdated command is not properly handling packages with the <package>.<output> format. This is because we don't actually have version data for a package named enchant.dev.

A better way to add the package you need is probably devbox add enchant -o dev, which uses Nixpkgs to find the enchant package and then adds the dev output to your project. The resulting devbox.json looks like this:

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

Adding the package in this format should work with devbox ls --outdated

That said, there are some other packages and cases that can't be added this way, so I'll try to add error handling for this case

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

Successfully merging a pull request may close this issue.

2 participants