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
Compute source roots in a rule. #9888
Conversation
Previously we computed the source root for a path outside the engine, via a utillity method. However we want to support marking source roots using a sentinel file, and this requires filesystem access in the computation, meaning that has to be done in a rule. This change introduces a set of rules for finding the source root for a path, and converts all v2 code to use those rules. [ci skip-rust-tests] [ci skip-jvm-tests]
cc3e0db
to
c2ce30c
Compare
Reviewers: This isn't just boilerplate, please double-check my logic. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
[ci skip-rust-tests] [ci skip-jvm-tests]
[ci skip-rust-tests] [ci skip-jvm-tests]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Previously we computed the source root for a path outside the engine, via a utility method.
However we want to support marking source roots using a sentinel file, and this requires source root computation to have filesystem access, meaning it has to be done in a rule.
This change introduces a set of rules for finding the source root for a path, and converts all v2 code to use those rules.
Note that this change introduces a new field,
root_to_relfiles
, onSourceRootStrippedSources
, which maps from each found source root to the list of files under that source root. This allows us to re-use source root stripping logic in places where we previously replicated it. V2 Engine FTW!A future change will leverage this change to support sentinel files.
[ci skip-rust-tests]
[ci skip-jvm-tests]