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
C#: Implement correct behavior for dotnet build tracing
#9705
base: main
Are you sure you want to change the base?
Conversation
For proper C# tracing, `dotnet build` needs the parameter /p:UseSharedCompilation=false. However, we can't pass that to the other subcommands of `dotnet`, therefore we need to figure out which subcommand of `dotnet` is being invoked.
| -- The dotnet CLI has the following usage instructions: | ||
| -- dotnet [sdk-options] [command] [command-options] [arguments] | ||
| -- we are interested in dotnet build, which has the following usage instructions: | ||
| -- dotnet [options] build [<PROJECT | SOLUTION>...] | ||
| -- however, `dotnet -h build`, although documented, does not work | ||
| -- For now, parse the command line as follows: | ||
| -- Everything that starts with `-` will be ignored. | ||
| -- The first non-option argument is treated as the command. | ||
| -- if that's `build`, we append `/p:UseSharedCompilation=false` to the command line, | ||
| -- otherwise we do nothing. |
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.
Passing -d before the build command works. But I think ignoring everything that starts with- is correct and will handle this case too.
| -- dotnet [options] build [<PROJECT | SOLUTION>...] | ||
| -- however, `dotnet -h build`, although documented, does not work | ||
| -- For now, parse the command line as follows: | ||
| -- Everything that starts with `-` will be ignored. |
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.
This line could also state that anything prefixed / will be ignored.
For proper C# tracing,
dotnet buildneeds the parameter/p:UseSharedCompilation=false. However, we can't pass that to the othersubcommands of
dotnet, therefore we need to figure out which subcommandof
dotnetis being invoked.