Skip to content

Conversation

@klkvr
Copy link
Member

@klkvr klkvr commented Sep 13, 2024

ref #197

Implements preprocessor allowing us to skip recompiling tests on non-interface source file changes. Still testing, but looks like it's working correctly, decreasing single-change build times from ~1 minute to 5s in some cases.

Implementation needed some hacks to correctly handle constructor arguments, tried to document it clearly -

pub fn build_helper(&self) -> Result<Option<String>> {

still WIP as caching changes are not opt-in yet (preprocessor is), and I want to do more testing

	modified:   crates/compilers/src/preprocessor.rs
	modified:   crates/compilers/src/preprocessor.rs
@DaniPopes
Copy link
Member

#252

@DaniPopes DaniPopes closed this Mar 25, 2025
mattsse pushed a commit that referenced this pull request Apr 7, 2025
Implements a preprocessor allowing us to skip recompiling tests on
non-interface source file changes. See the companion Foundry PR
foundry-rs/foundry#10010 for benchmarks and more
details.

Supersedes #198:
- uses solar AST instead solang-parser to compute interface
representation
- uses solar HIR instead of solc AST to find bytecode dependencies
- handles more edge cases, like deploying with salt/value

Closes #197.

### TODO
- [x] use solar HIR (deps to review and include
paradigmxyz/solar#210)
- [x] unit tests
- [x] opt-in caching changes
- [x] autodetect mocks
- [x] figure out how to parse when building from different dir
- [x] additional testing (tested with uniswap v4-core and simpler
projects)

### Depends on
- [x] merge solar PR (paradigmxyz/solar#210)
- [x] solar release

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
alexandergrey33 added a commit to alexandergrey33/compilers that referenced this pull request Sep 17, 2025
Implements a preprocessor allowing us to skip recompiling tests on
non-interface source file changes. See the companion Foundry PR
foundry-rs/foundry#10010 for benchmarks and more
details.

Supersedes foundry-rs/compilers#198:
- uses solar AST instead solang-parser to compute interface
representation
- uses solar HIR instead of solc AST to find bytecode dependencies
- handles more edge cases, like deploying with salt/value

Closes #197.

### TODO
- [x] use solar HIR (deps to review and include
paradigmxyz/solar#210)
- [x] unit tests
- [x] opt-in caching changes
- [x] autodetect mocks
- [x] figure out how to parse when building from different dir
- [x] additional testing (tested with uniswap v4-core and simpler
projects)

### Depends on
- [x] merge solar PR (paradigmxyz/solar#210)
- [x] solar release

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
bug-knightxmiu70 added a commit to bug-knightxmiu70/compilers that referenced this pull request Sep 28, 2025
Implements a preprocessor allowing us to skip recompiling tests on
non-interface source file changes. See the companion Foundry PR
foundry-rs/foundry#10010 for benchmarks and more
details.

Supersedes foundry-rs/compilers#198:
- uses solar AST instead solang-parser to compute interface
representation
- uses solar HIR instead of solc AST to find bytecode dependencies
- handles more edge cases, like deploying with salt/value

Closes #197.

### TODO
- [x] use solar HIR (deps to review and include
paradigmxyz/solar#210)
- [x] unit tests
- [x] opt-in caching changes
- [x] autodetect mocks
- [x] figure out how to parse when building from different dir
- [x] additional testing (tested with uniswap v4-core and simpler
projects)

### Depends on
- [x] merge solar PR (paradigmxyz/solar#210)
- [x] solar release

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: zerosnacks <[email protected]>
Co-authored-by: DaniPopes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants