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

Ability to pass custom flag to build command #1395

Closed
kunalspathak opened this issue Mar 18, 2020 · 3 comments
Closed

Ability to pass custom flag to build command #1395

kunalspathak opened this issue Mar 18, 2020 · 3 comments
Labels

Comments

@kunalspathak
Copy link
Member

I am trying to build and run BenchmarkDotNet and micro benchmarks on windows arm64 but because of dotnet/roslyn#42393 I need to pass /p:DebugType=portable to build the micro benchmark project. However when I run micro benchmarks on windows ARM64 it triggers build for specific benchmark and it doesn't include the required flag resulting in build failure that looks like this:

Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Build Engine version 16.6.0-preview-20126-02+13cfe7fc5 for .NET Core

// Build Error: Standard output:

 Standard error:
 Time Elapsed 00:00:07.61
    1 Error(s)
    0 Warning(s)
CSC : error CS0041: Unexpected error writing debug information -- 'An attempt was made to load a program with an incorrect format. (0x8007000B)' [D:\Users\dotnet-bot\kpathak\git\performance\artifacts\491570be-f187-4959-8673-8c70cdf2beb9\BenchmarkDotNet.Autogenerated.csproj]
Build FAILED.

Exposing a way for user to pass whatever switch they want depending on their environment will allow the build to work properly.

@adamsitnik
Copy link
Member

Hello @kunalspathak

This can be achieved by using MsBuildArgument type. In your case you should extend the recommended job config in

https://github.com/dotnet/performance/blob/19b34f1f436493dbc808b3ae515c76269235d96a/src/harness/BenchmarkDotNet.Extensions/RecommendedConfig.cs#L24-L29

with:

.With(new Argument[] { new MsBuildArgument("/p:DebugType=portable") })

Please let me know if it helped

@kunalspathak
Copy link
Member Author

Thank you @adamsitnik , that works. Should we make that change inside dotnet/performance as well, possibly under ARM flag or something?

@adamsitnik
Copy link
Member

Should we make that change inside dotnet/performance as well, possibly under ARM flag or something?

If dotnet/roslyn#42393 is not going to get fixed anytime soon then definitely yes. Could you please send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants