Skip to content

Commit

Permalink
Merge pull request #1639 from cachix/cache-bust-env
Browse files Browse the repository at this point in the history
eval-cache: track `builtins.getEnv` when caching
  • Loading branch information
sandydoo authored Jan 30, 2025
2 parents cf1d4aa + f1011bf commit 8b611a1
Show file tree
Hide file tree
Showing 11 changed files with 507 additions and 303 deletions.
10 changes: 6 additions & 4 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Used by https://direnv.net
set -euo pipefail

# Use our own last built devenv/nix in CLI
nix build --print-out-paths --accept-flake-config || echo "nix build failed, using previous build"
PATH_add "result/bin"

# External users should eval `devenv direnvrc` or use `source_url` to load this file
source_env ./direnvrc

# Use our own last built devenv/nix in CLI
log_status "building dev devenv..."
nix build --print-out-paths --accept-flake-config || log_status "nix build failed, using previous build"
PATH_add "result/bin"

log_status "evaluating shell..."
use devenv
16 changes: 16 additions & 0 deletions devenv-eval-cache/migrations/20241210011111_create-env-input.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Rename table for file inputs
ALTER TABLE file_path
RENAME TO file_input;

ALTER TABLE cmd_input_path
RENAME COLUMN file_path_id TO file_input_id;

CREATE TABLE env_input (
id INTEGER NOT NULL PRIMARY KEY,
cached_cmd_id INTEGER NOT NULL,
name TEXT NOT NULL,
content_hash CHAR(64) NOT NULL,
updated_at INTEGER NOT NULL DEFAULT (strftime ('%s', 'now')),
FOREIGN KEY (cached_cmd_id) REFERENCES cached_cmd (id) ON DELETE CASCADE,
UNIQUE (cached_cmd_id, name)
);
Loading

0 comments on commit 8b611a1

Please sign in to comment.