Skip to content

Commit

Permalink
fix(pg): Do not force recompile during propose or deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Mar 19, 2024
1 parent a7e7ca6 commit 4cc6c75
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-pans-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sphinx-labs/plugins': patch
---

Do not force recompile
15 changes: 5 additions & 10 deletions packages/plugins/src/cli/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,15 @@ export const deploy = async (

/**
* Run the compiler. It's necessary to do this before we read any contract interfaces.
* We force recompile and request the build info here. We need to build info to generate
* the compiler config.
* We request the build info here which we need to build info to generate the compiler
* config.
*
* The current behavior of Foundry is to disregard the cache when compiling with the build info.
* This causes the users entire project to be rebuilt when the build info file is requested. So
* since we have to rebuild the entire project anyway, we also use force which will remove any
* previous build info files making our later logic for reading the build info files more performant.
*
* If/when Foundry fixes this so that the cache is used when the build info file is requested, we should
* remove force here for the best performance.
* We do not force recompile here because the user may have a custom compilation pipeline
* that yields additional artifacts which the standard forge compiler does not.
*/
compile(
silent,
true, // Force recompile
false, // Do not force recompile
true // Generate build info
)

Expand Down
15 changes: 5 additions & 10 deletions packages/plugins/src/cli/propose/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,15 @@ export const propose = async (

/**
* Run the compiler. It's necessary to do this before we read any contract interfaces.
* We force recompile and request the build info here. We need to build info to generate
* the compiler config.
* We request the build info here which we need to build info to generate the compiler
* config.
*
* The current behavior of Foundry is to disregard the cache when compiling with the build info.
* This causes the users entire project to be rebuilt when the build info file is requested. So
* since we have to rebuild the entire project anyway, we also use force which will remove any
* previous build info files making our later logic for reading the build info files more performant.
*
* If/when Foundry fixes this so that the cache is used when the build info file is requested, we should
* remove force here for the best performance.
* We do not force recompile here because the user may have a custom compilation pipeline
* that yields additional artifacts which the standard forge compiler does not.
*/
compile(
silent,
true, // Force recompile
false, // Do not force recompile
true // Generate build info
)

Expand Down

0 comments on commit 4cc6c75

Please sign in to comment.