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

shellgen: delete flake.lock if flake.nix changes #2388

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Oct 28, 2024

Fix a bug where .devbox/gen/flake gets locked on old versions of .devbox/gen/flake/glibc-patch by deleting the flake.lock file.

We only delete the lock file when the generated flake changes so that Nix isn't forced to re-evaluate it every time.

The repro steps are:

  1. Add a package that gets auto-patched (devbox add [email protected]).
  2. .devbox/gen/flake gets locked on the patch flake.
  3. Change the patched package (devbox add [email protected]).
  4. The new patch flake isn't used because of .devbox/gen/flake/flake.lock. Instead, the old version is used (from the Nix store).

Fixes #2316.
Fixes #2370.

Fix a bug where `.devbox/gen/flake` gets locked on old versions of
`.devbox/gen/flake/glibc-patch` by deleting the `flake.lock` file.

We only delete the lock file when the generated flake changes so that
Nix isn't forced to re-evaluate it every time.

The repro steps are:

1. Add a package that gets auto-patched (`devbox add [email protected]`).
2. `.devbox/gen/flake` gets locked on the patch flake.
3. Change the patched package (`devbox add [email protected]`).
4. The new patch flake isn't used because of
   `.devbox/gen/flake/flake.lock`. Instead, the old version is used
  (from the Nix store).

Fixes #2316.
Fixes #2370.
@gcurtis gcurtis merged commit 2f38449 into main Oct 28, 2024
29 checks passed
@gcurtis gcurtis deleted the gcurtis/flake-lock branch October 28, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[email protected] error creating shell (NixOS) python3 on macOS explodes
2 participants