devbox icon indicating copy to clipboard operation
devbox copied to clipboard

[Bug]: Devbox is inconsistent about adding `plugin_version` into devbox.lock

Open mdwn opened this issue 2 years ago • 1 comments

Current Behavior (bug) When adding certain dependencies to the devbox.lock file, devbox is inconsistent about adding the plugin_version field depending on the current state of both the .devbox directory and the devbox.lock file.

To see this behavior, try the following from a devbox enabled project with both the .devbox directory and the devbox.lock file present:

Description Command Result
Remove both devbox.lock and .devbox rm -rf devbox.lock .devbox && devbox install No plugin line.
Leave .devbox directory intact rm devbox.lock && devbox install No plugin line.
Leave devbox.lock intact rm -rf .devbox && devbox install Plugin line appears.

Expected Behavior (fix) The plugin_version line should be consistently applied regardless of the current state of the .devbox directory and the devbox.lock file.

Additional context

$ devbox version -v
Version:     0.5.4
Platform:    darwin_arm64
Commit:      92bb293af46fe6869648c20e4a6476dc83df0092
Commit Time: 2023-06-01T21:35:06Z
Go Version:  go1.20.4
Launcher:    0.2.0
$ cat devbox.json
{
  "packages": [
    "[email protected]",
    "bash",
    "[email protected]",
    "github:nixos/nixpkgs/d7f28652048b3bed6a512542e62ea1a50691e349#buf",
    "[email protected]",
    "[email protected]",
    "git",
    "github:nixos/nixpkgs/757a0d107c238d031652a8c09d1f6bf1b6f523a3#go",
    "github:nixos/nixpkgs/3a785fc61f9d2960970bdce4fa86eb634c86b9d6#golangci-lint",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "github:nixos/nixpkgs/b39bfdc033e1d79f2b58e1630530e5d54b19e698#openssl",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "path:build.assets/flake#conditional",
    "path:build.assets/flake#grpc-tools",
    "path:build.assets/flake#helm",
    "path:build.assets/flake#libpcsclite",
    "path:build.assets/flake#node-protoc-ts",
    "path:build.assets/flake#protoc-gen-gogo",
    "path:build.assets/flake#rust",
    "path:build.assets/flake#yarn"
  ],
  "shell": {
    "init_hook": [
      "export TELEPORT_DEVBOX=1",
      "unset GOROOT"
    ]
  },
  "nixpkgs": {
    "commit": "f91ee3065de91a3531329a674a45ddcb3467a650"
  }
}

mdwn avatar Jun 20 '23 13:06 mdwn

Did this get fixed? It is causing issues with the way github actions caching works as it uses the lock file in the cache hash

mike-prefix avatar Aug 19 '24 01:08 mike-prefix