-
Notifications
You must be signed in to change notification settings - Fork 354
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
Create targets and tasks for authoring a shared framework #2704
Comments
This is still a draft. Feel free to comment on naming, requirements, scope, etc. |
Cool idea. I see overlap (in concept) with setup authoring. My general comment is that this kind of thing tends to be a "slippery slope" and it starts to take on a life of its own. However, if there's high confidence that the requirements are truly known - than hooray! :) |
Fortunately, this is mostly implemented already. The work for this would mostly be to put code into a shared location, update core-setup and aspnetcore to consume the shared code, and make sure the build output doesn't change as a result. FYI - I'm volunteering myself to do the work to put common code in this repo and update aspnetcore. |
We discussed it in a meeting already and it seems pretty reasonable. 😄 A few things that I see after reading:
|
Updated the requirements. Thanks for the feedback.
Didn't mean to imply a separate project per file. In AspNetCore, we always set RuntimeIdentifier and infer it from the host machine (unless it is explicitly set by build script parameters). I think RuntimeIdentifier should still be required because there is no such thing as an "AnyCPU/AnyOS" shared framework.
Yeah, I think that's a unique requirement of netcoreapp. I'm expecting there will be more than a few things like that because it is the base framework. Can those be out of scope for now? I'm not sure yet if those should remain one-off things that netcoreapp does, or if they need to be supported into the shared targets as opt-in knobs.
Must have missed something. What is this file? AspNetCore is not producing it. |
I'm not very familiar with the built in SDK targets, I'll leave it to you for Agreed on AppHost and For context, I got some hints of |
I'm going to get started on this tomorrow. To avoid having a single massive PR with a bunch of stuff, I was thinking of doing this in a feature branch with PRs for smaller chunks of the work. Sound okay @dagood? |
Good idea, thanks! For posterity: https://github.com/dotnet/arcade/tree/feature/sharedfx-sdk |
I'm going to be out on leave starting in a few days. I think I was overly ambitious in assigning myself to do this work. I think it should still be done, but I won't be able to tackle this one until at least August, maybe later. I'll leave myself assigned, but consider this one up for grabs for the next 2 months. |
FYI - I saved some partially-done work here: https://github.com/natemcmaster/arcade/tree/generate-deps |
Just learned that the Preview 6 SDK includes the ability to crossgen a .NET Core 3 app by setting https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0-preview-6/ |
I think it should be possible if you are driving the shared framework production as a publish. You will likely need dotnet/sdk#3326 (still in PR) |
I'm not. I've reused a few things from the SDK, like the targets for generating a runtimeconfig.json file and ResolveReferences, but pretty much everything else was custom. Here is how we implemented crossgen for the aspnetcore framework: https://github.com/aspnet/AspNetCore/blob/af812f2d898457f3cdf3161703768467c552c9a7/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj#L283-L353. |
Core-Setup uses Publish to make its shared frameworks, but the publish uses the nupkgs that we ship so the crossgen has to happen earlier. Changing this around has been in the back of my mind though--creating a single layout that is crossgen'd and packaged up in various ways. Maybe that initial layout could be produced by Publish and crossgen could run through that. (The layout is probably basically the shared framework with other things mixed in that need to be filtered out in various configurations for various types of packages. I haven't thought it through very far.) |
Still might be possible, but not as straight forward. I'm working on sharing more between crossgen feature and dotnet store and that might help too. |
@natemcmaster just pointed me to this. As neither @ericstj nor I knew about this, please make sure to cc us on such issues moving forward :) EDIT: Oh I see, @ericstj was tagged on this. This is a great idea! Composing a shared framework version isn't straight-forward. You usually plug-in additional required stuff when something breaks in the sdk. In example we recently enabled project restore for our test projects and had to work around a couple of issue as we don't restore the targeting pack. |
FWIW I was expecting this work to happen early in 3.0 based on the spec that @rakeshsinghranchi put together last year that covered most of what's listed here, but I think folks ended up with a more reactive approach in their respective repos. I believe right now @dagood is working on generalizing as much of the shared-fx building in core-setup and then will eventually move as much to arcade so that it can be shared. @natemcmaster's template above is a reasonable strategy but will need to reconcile all the requirements/behavior of existing solutions. First priority is make it work for NETCoreApp, ASP.NET, and WindowsDesktop. Where we can make it help CoreFx testing, we should, but that's a slightly different problem since it needs to support inner-loop testing. |
@dagood - should we start tracking the work you're doing, close this issue, and reference so that @natemcmaster input is maintained? |
The work I'm planning to do is tracked at https://github.com/dotnet/core-setup/issues/4787. I don't see a reason to close this issue--it's a good, well-documented incremental step towards completing https://github.com/dotnet/core-setup/issues/4787, which has much broader scope. If you'd like to get this issue out of the Arcade repo, I wouldn't object to transferring it to Core-Setup. (And transfer again if it turns out not to make sense.) |
Unassigning myself. I'm not going to get to this in the near future, but I think this is still worth doing. |
Makes sense @dagood . I think the goal is to make sure this doesn't get lost and stays top of mind. Is core-setup the best place for that or arcade in your opinion? |
It seems to me people are more likely to stumble upon it in Arcade than Core-Setup, since it makes sense to look in dotnet/arcade for Arcade feature tracking issues. Moving it to Core-Setup would only put it in front of my own face more often, and I'm already keenly aware of it. 😄 |
Assigned this to you @dagood for whenver you get to it. |
I've started working on this, using lessons learned from the shared framework SDK used by dotnet/runtime and dotnet/windowsdesktop and the proposed UX in the start of this issue as a starting point. |
If anyone wants to review the PR for this, it's at #5714 |
There are 3 different shared frameworks built by .NET teams - NETCore.App, AspNetCore.App, and WindowsDesktop.App. We share similar requirements and similar code. I think we should commonize these into a shared package to reduce the maintenance burden of building shared frameworks 'the right way.'
Desired usage
Projects which need to author a framework can create two project files, one for the targeting pack and another for the runtime packs. Both projects use a custom MSBuild SDK, "Microsoft.NET.SharedFramework.Sdk" and set some well-known properties which will inform the custom SDK how to build a shared framework.
Requirements
Configuration == Release
Out of scope
Project file API
Example usage for the runtime project
Example usage for the targeting pack project
cc @ericstj @dagood
The text was updated successfully, but these errors were encountered: