Skip to content

Commit

Permalink
Turbo dependencies for gpcircuits (#1904)
Browse files Browse the repository at this point in the history
Fixed some cases I saw where Turbo caching wasn't effective. The
observed behavior was that gpcircuits tests had to run an extra time
before "settling" and using the cache. This seems to have been due to
the generated circuit files in circuits/main and circuits/test.
Including or excluding those in inputs/outputs appropriately seems to
have solved the problem.
  • Loading branch information
artwyman committed Sep 27, 2024
1 parent b95f74e commit 898afef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/lib/gpcircuits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clean": "rm -rf dist node_modules *.tsbuildinfo build circuits/test ptau && yarn clean-test-artifacts",
"gen-circuit-parameters": "npx tsx scripts/gen-circuit-parameters.ts",
"gen-test-artifacts": "npx tsx scripts/gen-test-artifacts.ts",
"clean-test-artifacts": "rm -rf artifacts/test",
"clean-test-artifacts": "rm -rf artifacts/test circuits/main",
"copy-test-to-snark-artifacts": "./scripts/copy-test-to-snark-artifacts.sh"
},
"dependencies": {
Expand Down
14 changes: 12 additions & 2 deletions packages/lib/gpcircuits/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"../../../node_modules/@zk-kit/circuits/**",
"scripts/gen-test-artifacts.ts",
"circuits/**",
"!circuits/test/**",
"!circuits/main/**",
"circomkit.json",
"circuits.json"
],
"outputs": ["artifacts/**"],
"outputs": ["artifacts/**", "circuits/main/**"],
"outputLogs": "new-only",
"cache": true
},
Expand All @@ -23,6 +25,8 @@
"$TURBO_DEFAULT$",
"src/**",
"circuits/**",
"!circuits/test/**",
"!circuits/main/**",
"circomkit.json",
"circuits.json"
],
Expand All @@ -31,7 +35,13 @@
},
"test": {
"dependsOn": ["build", "^gen-test-artifacts", "gen-test-artifacts"],
"inputs": ["$TURBO_DEFAULT$", "test/**", "artifacts/**"],
"inputs": [
"$TURBO_DEFAULT$",
"test/**",
"artifacts/**",
"circuits/**",
"!circuits/test/**"
],
"outputs": [],
"cache": true
}
Expand Down

0 comments on commit 898afef

Please sign in to comment.