Skip to content

Commit

Permalink
Introduce a cache system
Browse files Browse the repository at this point in the history
Copying & patching all the DSOs is a time consuming process (~10s on a
slow hard drive computer). We definitely don't want to go through it
for each process start, we need to introduce a cache.

For this cache, we go the concervative way. We're going to "resolve" a
DSO name (ie. find the DSO absolute path) and sha256-hash each DSO.
We're then going to compare the fingerprints to determine whether or
not we need to nuke and rebuild the DSO cache.

The cache state is persisted through a JSON file saved in the cache dir.
  • Loading branch information
picnoir committed Dec 5, 2022
1 parent 494bac3 commit 375148c
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 69 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
9 changes: 6 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ pkgs.stdenvNoCC.mkDerivation {
patchShebangs $out/bin/nixglhost
'';

postCheck = ''
black --check $out/bin/nixglhost
doCheck = true;

checkPhase = ''
black --check src/*.py
nixpkgs-fmt --check *.nix
python src/nixglhost_wrapper_test.py
'';

installPhase = ''
install -D -m0755 nixglhost-wrapper.py $out/bin/nixglhost
install -D -m0755 src/nixglhost_wrapper.py $out/bin/nixglhost
'';
}
Loading

0 comments on commit 375148c

Please sign in to comment.