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

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

grandizzy
Copy link
Contributor

@grandizzy grandizzy commented Feb 19, 2025

supersedes #198

  • 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

  • opt-in caching changes
  • use solar HIR
  • additional testing

@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
|| visibility == Visibility::Public
})
}
solar_parse::ast::FunctionKind::Constructor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please import ast instead of using crate name::

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, done, will clean more imports when moving to use solar HIR 594c09b

}
}

impl Visitor for BytecodeDependencyCollector<'_> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use solar HIR, requires patching to latest git

Copy link
Contributor Author

@grandizzy grandizzy Feb 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaniPopes I am having some difficulties figuring out how to use HIR API (trying smth like below), could you please shed some light? thank you!

        sess.enter_parallel(|| -> solar_parse::interface::Result {
            let sources = sources.into_iter().map(|(path, _)| path);
            let mut parsing_context = ParsingContext::new(&sess);
            parsing_context.load_files(sources)?;
            parsing_context.parse_and_resolve()?;
            /// Do something with parsed sources, access HIR
            Ok(())
        });

@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
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