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

No way to set RuntimeFrameworkVersion in multiple-version config #535

Closed
JosephTremoulet opened this Issue Aug 30, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@JosephTremoulet

JosephTremoulet commented Aug 30, 2017

I'm interested in comparing disassembly from specific preview drops of .NET Core against each other and .NET Core 2.0, so I tried using a config like this:

    public class MyConfig : ManualConfig
    {
        public MyConfig()
        {
            // RyuJit for .NET Core 2.0
            Add(Job.ShortRun.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Core).With(CsProjCoreToolchain.NetCoreApp20));
            // RyuJit for .NET Core 2.1
            Add(Job.ShortRun.With(Jit.RyuJit).With(Platform.X64).With(Runtime.Core).With(CsProjCoreToolchain.From(new NetCoreAppSettings("netcoreapp2.1", "2.1.0-preview2-25628-01", ".NET Core 2.1"))));

            Add(DisassemblyDiagnoser.Create(new DisassemblyDiagnoserConfig(printAsm: true, recursiveDepth: 2)));
        }
    }

Then when running the benchmark, I see this:

  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
  Job-XQOYPV : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
  Job-XHPTDD : .NET Core 2.1.0-preview2-25616-02 (Framework 4.6.00001.0), 64bit RyuJIT

Job-XHPTDD ran on a different preview build of NET Core 2.1 than what I requested (I have both installed).

It seems the MicrosoftNETCoreAppVersion set on the NetCoreAppSettings object isn't actually used in the .NET Core csproj toolchain; what I'd need is a <RuntimeFrameworkVersion>2.1.0-preview2-25628-01</RuntimeFrameworkVersion> element inserted in the generated csproj, but I can't seem to find an extensibility point that would make it easy for me to add one.

That element does get copied over from the found csproj to the generated csproj in GetSettingsThatNeedsToBeCopied, and if I put it in my csproj and target the csproj against 2.1, then the 2.1 run does indeed work with the desired version, but I can't do the cross-version comparison runs.

It would be great to have an easy way to target specific versions. (Or, if I'm just overlooking one, then it would be great to have a more easily discoverable way :) )

@adamsitnik adamsitnik self-assigned this Aug 30, 2017

@adamsitnik

This comment has been minimized.

Show comment
Hide comment
@adamsitnik

adamsitnik Aug 30, 2017

Member

Hi @JosephTremoulet

I have just pushed the fix. The two fields of NetCoreAppSettings that were previously used to generate project.json got now removed. I just forgot to remove them after project.json abandon.

I have added new property, called RuntimeFrameworkVersion which generates the right thing.

You should be able to try it in 30 minutes when this build finishes.

Please let me know if it works now.

Member

adamsitnik commented Aug 30, 2017

Hi @JosephTremoulet

I have just pushed the fix. The two fields of NetCoreAppSettings that were previously used to generate project.json got now removed. I just forgot to remove them after project.json abandon.

I have added new property, called RuntimeFrameworkVersion which generates the right thing.

You should be able to try it in 30 minutes when this build finishes.

Please let me know if it works now.

@adamsitnik adamsitnik added this to the v0.10.10 milestone Aug 30, 2017

@AndreyAkinshin

This comment has been minimized.

Show comment
Hide comment
@AndreyAkinshin

AndreyAkinshin Aug 30, 2017

Member

@adamsitnik, thanks for the quick fix. Could you also update the docs and describe the new property? It can be useful for other people who try to work with different .NET Core versions.

Member

AndreyAkinshin commented Aug 30, 2017

@adamsitnik, thanks for the quick fix. Could you also update the docs and describe the new property? It can be useful for other people who try to work with different .NET Core versions.

@JosephTremoulet

This comment has been minimized.

Show comment
Hide comment
@JosephTremoulet

JosephTremoulet Aug 30, 2017

@adamsitnik, yes, it works just like I'd hoped, thanks!

JosephTremoulet commented Aug 30, 2017

@adamsitnik, yes, it works just like I'd hoped, thanks!

@adamsitnik

This comment has been minimized.

Show comment
Hide comment
@adamsitnik

adamsitnik Sep 2, 2017

Member

@AndreyAkinshin I added the docs for toolchains, link

Member

adamsitnik commented Sep 2, 2017

@AndreyAkinshin I added the docs for toolchains, link

@AndreyAkinshin

This comment has been minimized.

Show comment
Hide comment
@AndreyAkinshin

AndreyAkinshin Sep 2, 2017

Member

@adamsitnik, awesome, thanks!
I guess it makes sense to release v0.10.10 on the next week.

Member

AndreyAkinshin commented Sep 2, 2017

@adamsitnik, awesome, thanks!
I guess it makes sense to release v0.10.10 on the next week.

@adamsitnik

This comment has been minimized.

Show comment
Hide comment
@adamsitnik

adamsitnik Sep 2, 2017

Member

I guess it makes sense to release v0.10.10 on the next week.

Good idea!

Member

adamsitnik commented Sep 2, 2017

I guess it makes sense to release v0.10.10 on the next week.

Good idea!

alinasmirnova added a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment