Skip to content
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

--generateBinlog working incorrectly: not building due to msbuild error. #2569

Open
DoctorVanGogh opened this issue May 17, 2024 · 0 comments

Comments

@DoctorVanGogh
Copy link

I'm trying to track down an issue where a benchmark (using EtwProfiler) will not run (turns out, some things are missing from the app.config in the second order builds). To narrow down the issue I tried specifying --generateBinlog on the command line. Sadly that brought about more issues 😞

MSBuild error with --generateBinlog

Specifying --generateBinlog on my .Net Framework 4.7.2 project will cause the entire second order builds not to run with a msbuild error:

...
start dotnet  restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true -bl:.NET Framework 4.7.2-restore.binlog in ***\bin\Release\net472\.NET Framework 4.7.2
MSBUILD : error MSB1008: Only one project can be specified.
    Full command line: 'C:\Program Files\dotnet\sdk\8.0.204\MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore --property:UseSharedCompilation=false --property:BuildInParallel=false --property:Deterministic=true --property:Optimize=true /m:1 -bl:.NET Framework 4.7.2-restore.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll'
  Switches appended by response files:
Switch: 4.7.2-restore.binlog
// Build Error: Standard output:

 Standard error:
 MSBUILD : error MSB1008: Only one project can be specified.
    Full command line: 'C:\Program Files\dotnet\sdk\8.0.204\MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore --property:UseSharedCompilation=false --property:BuildInParallel=false --property:Deterministic=true --property:Optimize=true /m:1 -bl:.NET Framework 4.7.2-restore.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll'
  Switches appended by response files:
Switch: 4.7.2-restore.binlog
For switch syntax, type "MSBuild -help"

// command took 0.16 sec and exited with 1
// ***** Done, took 00:00:01 (1.21 sec)   *****
// Found 1 benchmarks:
//   Foo.Bar: .NET Framework 4.7.2(Runtime=.NET Framework 4.7.2) [wiz=bang]
...
// Build Error: Standard output:

 Standard error:
 MSBUILD : error MSB1008: Only one project can be specified.
    Full command line: 'C:\Program Files\dotnet\sdk\8.0.204\MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore --property:UseSharedCompilation=false --property:BuildInParallel=false --property:Deterministic=true --property:Optimize=true /m:1 -bl:.NET Framework 4.7.2-restore.binlog -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\8.0.204\dotnet.dll'
  Switches appended by response files:
Switch: 4.7.2-restore.binlog
For switch syntax, type "MSBuild -help"

// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
// It can be found in [***]\bin\Release\net472\.NET Framework 4.7.2
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html

It seems the response file for the added switches does not properly quote its arguments. Specifically it should be -bl:'. NET Framework 4.7.2-restore.binlog', not -bl:. NET Framework 4.7.2-restore.binlog.

Secondary issue: --keepFiles does not in fact keep all files 😉

It seems there are some response files in use that contain options. Alas, those response files seem not to be kept even when using --keepFiles.

...
Switches appended by response files:
Switch: 4.7.2-restore.binlog
...

The build artefact directory contains a .bat file, a .notcsfile and a .csproj. No .rsp ☹️

@DoctorVanGogh DoctorVanGogh changed the title --generateBinlog working incorrectly: not building due to mcbuild error. --generateBinlog working incorrectly: not building due to msbuild error. May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant