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

Secondary inputs are not locked according to their parent input #1141

Open
Hamled opened this issue Apr 17, 2024 · 0 comments
Open

Secondary inputs are not locked according to their parent input #1141

Hamled opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Hamled
Copy link

Hamled commented Apr 17, 2024

Describe the bug
When devenv needs to update an input either because it was added to devenv.yaml or the devenv update command was run, the "secondary" inputs of that input are not always locked in the same way that they are in their parent input's flake.lock.

Apologies for the confusing phrasing, I don't really understand the best terminology to use here.

To reproduce

  1. devenv init
  2. devenv inputs add nixpkgs-python github:cachix/nixpkgs-python

Running the above commands at the time of filing this issue, the following is created in devenv.lock (full set of files):

{
  "nodes": {
    // snip...
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1713145326,
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "53a2c32bc66f5ae41a28d7a9a49d321172af621e",
        "treeHash": "bb82f3be89ba64ef34820189f66e3054cfc4bafd",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-23.11",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    // snip...
  },
  "root": "root",
  "version": 7
}

Revision 53a2c32bc66f5ae41a28d7a9a49d321172af621e is the current HEAD of the nixos-23.11 branch, however the referenced version of the flake.lock file in nixpkgs-python uses a different revision.

When creating a new project with nix flake init and manually adding inputs.nixpkgs-python.url = "github:cachix/nixpkgs-python"; the revision used for the nixpkgs-python.inputs.nixpkgs node in the lock file is the same as from the input's flake lock.

Additionally, if a particular revision for the "secondary" input is in the lock file when devenv update is run, it gets updated to the latest revision in the same way as when the input was originally added. When using nix flake update this does not happen.

Version

devenv 1.0.4 (x86_64-linux)

@Hamled Hamled added the bug Something isn't working label Apr 17, 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

1 participant