Commit 209c839
authored
[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.1 parent 6b61988 commit 209c839
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
| 972 | + | |
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
292 | 299 | | |
293 | 300 | | |
294 | 301 | | |
| |||
0 commit comments