Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preprocessor to skip recompiling tests on non-interface source file changes #252

Open
wants to merge 57 commits into
base: main
Choose a base branch
from

Conversation

grandizzy
Copy link
Contributor

@grandizzy grandizzy commented Feb 19, 2025

supersedes #198
closes #197

  • rebased with main
  • uses solar instead solang to compute interface representation

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.

TODOs

Depends on

@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from 1c02f7f to 325a627 Compare February 19, 2025 08:03
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from 325a627 to 0f78197 Compare February 19, 2025 08:16
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from b4c0746 to 7d0edb8 Compare February 19, 2025 14:37
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from b5ebece to 4025e5a Compare February 19, 2025 16:56
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from be6c378 to d37cafb Compare February 20, 2025 12:56
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from b605610 to 6a81147 Compare March 26, 2025 09:23
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch 6 times, most recently from 6954c27 to 322e80a Compare March 26, 2025 12:51
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch 5 times, most recently from 2bcd743 to e16fe89 Compare March 26, 2025 18:55
@grandizzy
Copy link
Contributor Author

grandizzy commented Mar 26, 2025

the win panic is related to the fact in compilers we normalize sources when reading but then we read them again from disk in Solar locs get out of sync. e.g. with this commit e16fe89 the preprocessor test that panic before pass (https://github.com/foundry-rs/compilers/actions/runs/14091283691/job/39468341793#step:7:708) however there are some flatten related test failing now
@DaniPopes could you pls suggest a proper fix for this, should we change the parsing logic and pass the sources we already read? CC @klkvr

thanks both!

@DaniPopes
Copy link
Member

You can manually load sources with SourceMap::new_dummy_source_file and add them with ParsingContext::add_file

"dummy" isn't right, it's just a way to intern a source file with a String rather than loading from disk

@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from e16fe89 to 62f2933 Compare March 26, 2025 19:57
@grandizzy grandizzy force-pushed the klkvr/pp-test-rebase branch from 62f2933 to 446a5d8 Compare March 26, 2025 20:06
@grandizzy
Copy link
Contributor Author

You can manually load sources with SourceMap::new_dummy_source_file and add them with ParsingContext::add_file

"dummy" isn't right, it's just a way to intern a source file with a String rather than loading from disk

Awesome, that worked, committed in 446a5d8

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.

feat: optimize compilation through preprocessing and smarter caching
4 participants