jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
8.66k stars 201 forks source link

[Bug]: Updating to 0.20 -> 0.21 installs 0.20 #1691

Open jskulski opened 10 months ago

jskulski commented 10 months ago

Hello!

Current Behavior (bug)

I have received a message to update the launcher to 0.21. When I run the update command, it is successful, but reports that 0.20 is installed. The next time I enter into a devbox shell (via generated .envrc), I get the same upgrade to 0.21 message.

I've tried a few times, with the same results.

Current version:

❯ devbox version
Info: New launcher available: v0.2.0 -> v0.2.1. Please run `devbox version update`.
0.8.4

Trying to update:

❯ cd ~/Code/prj
direnv: loading ~/Code/prj
Info: New launcher available: v0.2.0 -> v0.2.1. Please run `devbox version update`.
direnv: using devbox
direnv: export ...

❯ devbox version update
Devbox 📦 by jetpack.io
  Instant and predictable development environments and containers.

  This script downloads and installs the latest devbox binary.

Confirm Installation Details
  Location:     /usr/local/bin/devbox
  Download URL: https://releases.jetpack.io/devbox

? Install devbox to /usr/local/bin (requires sudo)? [Y/n] y

Downloading and Installing
✓ Downloading devbox binary... [DONE]
→ Installing in /usr/local/bin/devbox (requires sudo)...
Confirm Execution: This Sudo Command requires admin rights. Are you sure you wish to proceed?
✓ Installing in /usr/local/bin/devbox... [DONE]
✓ Successfully installed devbox 🚀

Next Steps
  1. Learn how to use devbox
     Run devbox help or read the docs at https://github.com/jetpack-io/devbox
  2. Get help and give feedback
     Join our community at https://discord.gg/jetpack-io

Info: New launcher available: v0.2.0 -> v0.2.1. Please run `devbox version update`.

Version:     0.8.4
Platform:    darwin_arm64
Commit:      209c8391a92eadb16b8df3243da25d2132a5d00d
Commit Time: 2023-12-08T18:16:10Z
Go Version:  go1.21.4
Launcher:    0.2.0
Success: already at Launcher version 0.2.0
Success: already at Devbox version 0.8.4

❯ cd -
direnv: loading ~/Code/prj
Info: New launcher available: v0.2.0 -> v0.2.1. Please run `devbox version update`.

Expected Behavior (fix)

The update should update the launcher to 0.21 and the message to update would go away.

Additional context

One note, this started happening after a (successful upgrade) from devbox 0.81 to 0.84.

Please include the output of devbox version -v

❯ devbox version -v
Info: New launcher available: v0.2.0 -> v0.2.1. Please run `devbox version update`.
Version:     0.8.4
Platform:    darwin_arm64
Commit:      209c8391a92eadb16b8df3243da25d2132a5d00d
Commit Time: 2023-12-08T18:16:10Z
Go Version:  go1.21.4
Launcher:    0.2.0

a copy of your devbox.json file.

This happens in any project, but a sample:

❯ cat prj/devbox.json 
{
  "packages": [
    "nodejs@latest",
    "yarn@latest"
  ],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}
jskulski commented 10 months ago

Perhaps relevant context, I ran into an error last time I updated (unknown flag: --update-devbox-symlink), so perhaps something was missed there and put me in this state.