-
Notifications
You must be signed in to change notification settings - Fork 391
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
High CPU when target framework is empty #3670
Comments
Pretty sure this is dependency node. This was hit by an MVP. |
@davkean did you look at all? Is this an infinite restore loop? |
just tried this scenario. Its infinite restore. |
It didn't look like infinite restore - it was infinite design-time builds but that will likely be dependency node reinitializing over and over. |
Oh, right - dupe of #3489 then? |
Yep, dup'd it against this one. |
I'm hitting this in To repro:
However, in my scenario I don't see any design-time builds continually happening using the |
Can you collect an ETL trace during this period? https://github.com/dotnet/roslyn/wiki/Recording-performance-traces-with-PerfView |
Yes, I'll get it tomorrow morning. |
I took 2 traces.
I uploaded them to the internal scratch file share: |
@eerhardt Can you verify that you have a TargetFramework to verify if its just another symptom of that? This is slated for 16.0, so won't look at until then if its a dupe. |
Yes, setting The only behavior difference I noticed from the originally described issue is:
I wasn't seeing any design-time builds happening in the |
Thanks. It might be good to sync up on CoreFx's requirements and why you can't use TargetFrameworks/TargetFramework. I've had your situation in the back of my mind, and want to address it and make it work for you out of the box. |
Agreed. @weshaggard would have the best background knowledge. I haven't completely ruled out that we can't use TargetFrameworks/TargetFramework yet. We are setting TargetFramework to workaround this issue. It's just that it is kind of a meaningless concept in the corefx repo's projects. In "normal" projects, it defines which version of netcoreapp/netstandard/netfx you want to reference. In corefx, we aren't referencing a framework. Instead, we are defining the framework. |
Think of "TargetFramework" as simply another open-ended dimension at which you can specialize a configuration like Platform and Configuration, except it's treated slightly different:
You can call your target frameworks "foo" and "bar" if you'd want (assuming you fill in the details, TargetFrameworkIdentifier, TargetFrameworkVersion, etc that we produce from the friendly name) |
Aren't there other assumptions made about those properties as well? For example doesn't Nuget interpret them? |
Barring bugs, TargetFramework is supposed to be treated as a "user value". NuGet gets the full TFM that we auto-generate from TargetFramework, and is supposed to be only using TargetFramework in conditions within the generated props files. |
My ultimate aim is to be able to able to specialize on other things; such as RID. It would be helpful if we could feed your requirements in so that what we develop around this works for you and you can stop working around MSBuild/VS |
This actually won't work because of NuGet validations. When I initially tried to implement multi-RID builds, I attempted it by using/abusing TFM's like |
I made this work today by making the outer loop get the RID's for the TFM and pass that into the inner loop: It works and builds, in VS and the command-line, but the project system/IDE knows nothing about it. So no IntelliSense for that combination (to catch the define's for each RID). |
It's not supposed to be interpreting that value, at least that was the original design - but there's going to be bugs here. I'm rewriting/removing our usage of TFM at the moment, and then I'll start pushing on other teams. |
@davkean it most certainly is interpreting/validating TFM's. Check out this horror for my first attempt at using TFM+RID: I had to rewrite the items that NuGet saw to remove the What I have in that PR is functional, just a lot grosser than the solution based on a discussion with @jeffkl. |
Here's where NuGet Restore (at least) is validating the tfm itself: I would expect that it should be based on a NuGetTargetMoniker value, so I can define my own TFM and say "use netstandard2.0" for it. No dice today. |
We did fully intend for TargetFramework do be open ended, but there are definitely issues. Another place where there's a problem is where we negotiate tfms between project references. It passes the TargetFrameworks to nuget to pick the "nearest" one. It would be prohibitively expensive to get all of the full tfms there in the current design. And even if we could there would cases where you have the same full TFM for different custom TF. I think the only out would be to require such P2Ps to skip the negotiation and manually assign the desired TF. There are bugs around doing that though, IIRC. |
Ah, yeah, forgot about this case - we'd need the same translation logic in the outer build, or call into the inner build - which would be expensive. |
@davkean @nguerrera do either of you know off hand where this logic lives in the targets? Would save me some spelunking time. |
Related: NuGet/Home#5154 |
@ocallesp This is likely the cause: #3670 (comment). |
Have a look inside AggregateCrossTargetProjectContext where it persists the targetfamework. |
@ocallesp feel free to reach out if you would like to discuss this. |
@davkean this issue is only reproducible in VS 2017. Not able to repro in VS 2019/master. |
Opening the following projects causes VS to constantly consume CPU:
or
Design time builds are constantly occurring in the background.
Also hit by #3489 by AWS SDK.
The text was updated successfully, but these errors were encountered: