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.
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 did turn these on on purpose, because in a parallel rustc we'll be unable to pick apart the tracing messages otherwise. One alternative would be to only turn them on if there's a
RUSTC_LOG_THREADS
env var set. So by default we would not emit these for now. What do you think?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.
Is there a way to tell if the parallel compiler is enabled? Maybe with a
cfg
? It would be nice for this to be enabled/disabled automatically.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.
it's a command line flag, which we don't have access to at this stage. I think we can cross that bridge when parallel compiling and debugging parallel compilers becomes more common.
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.
@oli-obk are you sure? I see a lot of
cfg(parallel_compiler)
around the code base - do you have to both build the parallel compiler and opt into it with a command line flag?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.
There's two bits of parallel compiler: query-level support in compiled code (e.g. using a mutex), and separately how many threads we actually end up using (-Zthreads). The latter only has any effect if the first is enabled, which is indeed cfg paralllel_compiler.
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.
Ok, it sounds like a) the question only matters when
parallel_compiler
is set, and then separately b) it might be nice to disable thread-based logging whencfg(parallel_compiler)
is set but-Z threads
isn't passed. I implemented a) and I think I'll leave b) for when parallel_compiler is better maintained - how does that sound?