-
Notifications
You must be signed in to change notification settings - Fork 424
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
Refactor rustc_compile_action to construct CrateInfo internally #2188
Merged
scentini
merged 9 commits into
bazelbuild:main
from
daivinhtran:refactor-rustc_compile_action
Oct 17, 2023
Merged
Refactor rustc_compile_action to construct CrateInfo internally #2188
scentini
merged 9 commits into
bazelbuild:main
from
daivinhtran:refactor-rustc_compile_action
Oct 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daivinhtran
force-pushed
the
refactor-rustc_compile_action
branch
from
October 9, 2023 15:01
a7dcbe0
to
2950a8f
Compare
daivinhtran
force-pushed
the
refactor-rustc_compile_action
branch
from
October 9, 2023 15:06
2950a8f
to
6e10715
Compare
daivinhtran
force-pushed
the
refactor-rustc_compile_action
branch
4 times, most recently
from
October 9, 2023 20:39
186c9c2
to
5fad717
Compare
daivinhtran
force-pushed
the
refactor-rustc_compile_action
branch
from
October 9, 2023 20:51
5fad717
to
51d7052
Compare
daivinhtran
changed the title
Move output_hash creation upstream
Refactor rustc_compile_action to construct CrateInfo internally
Oct 9, 2023
daivinhtran
commented
Oct 9, 2023
@@ -849,68 +849,3 @@ def _symlink_for_non_generated_source(ctx, src_file, package_root): | |||
return src_symlink | |||
else: | |||
return src_file | |||
|
|||
def create_crate_info_dict(ctx, toolchain, crate_type): |
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.
The logic of this function differs significantly across the rules and aspects so it's not sharable anymore.
daivinhtran
force-pushed
the
refactor-rustc_compile_action
branch
from
October 9, 2023 21:17
50ab022
to
87be14c
Compare
This was referenced Oct 9, 2023
scentini
approved these changes
Oct 17, 2023
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!
scentini
pushed a commit
that referenced
this pull request
Oct 18, 2023
#2188's follow-up PR to remove unused `_rustc_env_attr` field in `CrateInfo` provider. We can rely on `skip_expanding_rustc_env` to determine whether `rustc_env` is already expanded or not.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #2161, I anticipated to make create_crate_info_dict reusable across all rules and aspects.
The logic to construct
crate_info
is significantly different among the rules and aspects. As I tried to to expand the arguments to makecreate_crate_info_dict
universally reusable, the arguments grow which make it not worth anymore. This PR changes the refactoring approach.Before (result from #2161)
After (result from this PR)
Instead of creating
crate_info_dict
at the beginning ofrustc_compile_action
, this PR lifted the creation logic to the rules and aspects completely so that they can add any custom logic without caring about therustc_compile_action
's implementation.