-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
In relation to dotnet/sdk#3121
We need a way to:
- Have a ToolTask implementor to specify a custom response file path (via a property override for example)
- Boolean property to enable the logging of the tool command using the @"rspfile" format (Ex: mytool.exe @"temppath\myrsp.rsp") instead of the default list of raw arguments.
Regarding the first point, there are some cases where we need to keep the response file around in the obj intermediates. This is especially useful in repros, where we need to quickly reproduce a tool failure for investigation, and it has proven useful when we ask our customers to submit us repros for external bug investigations.
Regarding the second point, there are 2 aspects here:
- Aesthetic aspect: there are some tools that require huge commands, and can make it very hard to read the msbuild log. I'm not talking about enabling/disabling the logging here, which can be controlled by the msbuild logging verbosity (that's a different thing). I'm talking about logging the exact command that is being executed, which is based on a response file instead of the huge list of raw arguments. Not just would it be easier to copy/paste that command from the msbuild log for a targeted repro, but it would make the log so much easier to read. On another note, given that we can split various raw arguments over multiple lines in the response file, it makes the response file so much easier to read with a human eye compared to a huge string of concatenated raw arguments. Best example: all the /r arguments for the C# compiler.
- Correctness aspect: we need to know exactly the command that executed. If a tool fails because of a bug in response file argument parsing, there would be no way of easily reproducing that just by copying/pasting the raw arguments logged in the msbuild log.
An example of a tool where we really benefitted from keeping the rsp files and logging the rsp-based command can be found here: dotnet/sdk#3121
sbomer and jtschuster