-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Reduce noisy log messages from @rule
params
#10658
Conversation
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. This doesn't completely fix the issue, but it goes a long way to ameliorate it.
src/rust/engine/src/nodes.rs
Outdated
@@ -1248,7 +1248,11 @@ impl Display for NodeKey { | |||
&NodeKey::Scandir(ref s) => write!(f, "Scandir({})", (s.0).0.display()), | |||
&NodeKey::Select(ref s) => write!(f, "{}", s.product), | |||
&NodeKey::Task(ref task) => { | |||
write!(f, "@rule {}({})", task.task.display_info.name, task.params) | |||
//TODO cf. https://github.com/pantsbuild/pants/issues/7907 , we probably |
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.
Nit: The convention is TODO(#7907)
. Would be good to fix so that people can find it via Grep.
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.
Also I think each comment is supposed to have a single space between the //
and the message.
src/rust/engine/src/nodes.rs
Outdated
//want to include some kind of representation of the Params of an @rule when | ||
//we stringify the @rule. But we need to make sure we don't naively dump | ||
//the string representation of a Key, which could get gigantic. | ||
write!(f, "@rule {}", task.task.display_info.name) |
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.
Maybe @rule(my_rule_name)
, rather than @rule my_rule_name
. This would fit with the repr for the other node types a bit better.
[ci skip-build-wheels]
[ci skip-build-wheels]
4a6160a
to
596122e
Compare
Does #10665 mean that this could be reverted or cleaned up? |
Problem
cf. #10518 , it's possible for pants to emit extremely large log messages whenever it prints a long containing the string representation of large Python types. In the above issue, the large Python types are
FieldSet
subclasses (which can include lots of e.g. file path names) in their Python__str__
representation. These types appear as theparams
field on aTask
, and are part of the RustDisplay
representation of aTask
, which is part of the log message when a node is invalidated because of a file system change, and might more generally show up in any pants log message.Solution
A quick fix for the above problem is to simply remove the
Params
from theDisplay
implementation of an@rule
's task, and only include the name of the Python function corresponding to the rule. cf. #7907 , we probably want to eventually implement a more sophisticated way of deciding what Python type information we do and do not need to include in useful pants logs from Rust.