Repository navigation
Perf: Windows cmd.exe /D to avoid registry check - #2852
Conversation
rainersigwald
left a comment
There was a problem hiding this comment.
Thanks!
This is definitely How It Should Have Been, for reliability as well as performance reasons. See Raymond Chen on autoruns.
Unfortunately, I could envision a scenario where someone has an autorun that is actually critical to their build--they might execute a tool by tool.exe in an <Exec> that depends on having PATH set by an autorun command.
I don't know how to judge the risk of that theoretical break. @Microsoft/msbuild-maintainers ?
|
Could we add this under an escape hatch perhaps? So if someone's build breaks they can turn it back off? |
|
RE: cmd line switch to turn off: Not enough of a perf win to complexify the command line IMO. I'll withdraw the PR. |
|
We have other ways to do escape hatches, namely environment variables. That's what I meant, and not necessarily a command line switch. |
|
https://github.com/dotnet/cli/issues/8331 was root-caused to a user having autoruns and would have been fixed by this, as a data point. |
|
Yeah, I didn’t mean to scare this PR away ;) |
|
Easy to bring back, and if there is support overhead from autorun it seems worth it. |
|
@Erikma can you please re-publish your branch? I can then re-open this PR and then I will push a commit that contains the escape hatch. |
|
Reopened with pushed branch. @jeffkl If we need to restore old logic I need to know which env var you'd like (or push a new commit if you'd like) |
|
I'm almost done. I've added an escape hatch and some unit tests for good measure. I will push after local testing is complete. |
|
Looks good, except for the compile issue with the test and the conflict :) |
|
@AndyGerlicher So you think we should take this potentially-breaking change? |
…ter to avoid the overhead of checking the autorun configuration in the registry
|
We'll merge this in master once we've branched for 15.6 so that this won't go out until 15.7 preview 1 |
|
Thanks for the contribution @Erikma! |
When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry Also included escape hatch via MSBUILDUSERAUTORUNINCMD environment variable to bring back the functionality.
When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry Also included escape hatch via MSBUILDUSERAUTORUNINCMD environment variable to bring back the functionality.
When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry