-
-
Notifications
You must be signed in to change notification settings - Fork 286
unify all of the default info phases implementations #958
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ def phase_runfiles_scalatest(ctx, p): | |
|
||
args = struct( | ||
transitive_files = depset( | ||
[p.declare_executable, p.java_wrapper] + ctx.files._java_runtime + runfiles_ext, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the below comment. |
||
[p.java_wrapper] + ctx.files._java_runtime + runfiles_ext, | ||
transitive = [p.compile.rjars], | ||
), | ||
args_file = args_file, | ||
|
@@ -38,7 +38,7 @@ def _phase_runfiles_default(ctx, p, _args = struct()): | |
return _phase_runfiles( | ||
ctx, | ||
_args.transitive_files if hasattr(_args, "transitive_files") else depset( | ||
[p.declare_executable, p.java_wrapper] + ctx.files._java_runtime, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Last I check, the DefaultInfo's executable field is assumed part of the overall runfiles output. So this wasn't needed here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think we can validate it somehow? Do you think tests should have been broken? Maybe it's good enough, not sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO it's good enough because otherwise most of the tests covering binary and test rules would have broken! Additionally, I wouldn't have been able to iterate on #959 which incorporates these changes. If you want, I can test this against our codebase at Stripe to be extra safe. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that’s a good idea (though you’re probably right) |
||
[p.java_wrapper] + ctx.files._java_runtime, | ||
transitive = [p.compile.rjars], | ||
), | ||
_args.args_file if hasattr(_args, "args_file") else None, | ||
|
@@ -49,10 +49,7 @@ def _phase_runfiles( | |
transitive_files, | ||
args_file): | ||
return struct( | ||
runfiles = ctx.runfiles( | ||
transitive_files = transitive_files, | ||
collect_data = True, | ||
), | ||
runfiles = transitive_files, | ||
args_file = args_file, | ||
) | ||
|
||
|
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.
having a depset here is probably not the best idea since depsets have their cost and especially since you want to customize this in other phases then you might have depsets which are nested for no reason.
Maybe pass array?
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.
I'm not sure. In some case we may wind up passing along existing depsets, but in many others we have just a few files that need to be added in. It's not clear to me which is more common and the impact to analysis time.
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.
Are you replying in general or about files and runfiles? What we have now in these cases are arrays. If you’ll want to override these then you’ll need to have a nested depset.
In general I think it will depend on the case.