Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[print-dev-env] Skip cache if lockfile has changed (#1674)
## Summary We need to skip the PrintDevEnvCache in ComputeNixEnv if lockfile is stale. `ensurePackagesAreInstalledAndComputeEnv` had made an assumption that `ensurePackagesAreInstalled` will have called `computeNixEnv` already to ensure the PrintDevEnvCache was updated. However, after some recent refactoring, we no longer call `computeNixEnv` within `ensurePackagesAreInstalled`. So, we now need to check the lockfile status, and skip the PrintDevEnvCache if lockfile is stale. ## How was it tested? 1. Had `patch_glibc:true` for `hello` package. Did `devbox shell` and then saw that `which hello` points to the patch-glibc flake's hello. 2. exited devbox shell, and edited devbox.json to `patch_glibc:false` 3. re-started `devbox shell` and `which hello` now shows the regular nix `hello`. Previously, it would still show the patch-glibc hello since `PATH` would not have been updated to omit that.
- Loading branch information