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

[darc/maestro++] Update global.json with any SDK package depended on in Version.Details.xml #4015

Closed
dagood opened this issue Sep 26, 2019 · 7 comments

Comments

@dagood
Copy link
Member

dagood commented Sep 26, 2019

It looks like the global.json SDK package update functionality is limited to only a few hardcoded SDKs:

https://github.com/dotnet/arcade-services/blob/876268d727c0a5d3ec0a3f2840e9db35e20b467e/src/Microsoft.DotNet.Darc/src/DarcLib/DependencyOperations.cs

        public static readonly Dictionary<string, KnownDependencyType> _knownAssetNames =
            new Dictionary<string, KnownDependencyType>
            {
                {"Microsoft.DotNet.Arcade.Sdk", KnownDependencyType.GlobalJson},
                {"Microsoft.DotNet.Helix.Sdk", KnownDependencyType.GlobalJson},
                {"dotnet", KnownDependencyType.GlobalJson}
            };
// ...
            var dependencyMapping = new Dictionary<string, string>
            {
                {"Microsoft.DotNet.Arcade.Sdk", "msbuild-sdks"},
                {"Microsoft.DotNet.Helix.Sdk", "msbuild-sdks"},
                {"dotnet", "tools"}
            };

I was looking at creating an SDK package ("normal" MSBuild packages seem to have some limitations, especially during NuGet restore), but I noticed this hard-coded list that seems to be in the way.

Is there a reason these package IDs are hard-coded? Or am I mistaken?

@mmitche @JohnTortugo @riarenas

@dagood
Copy link
Member Author

dagood commented Sep 26, 2019

I guess it's not a big deal if it's easy to add them preemptively... the potential IDs I have in mind are:

  • Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk
    • Attempt to indicate similarity to Microsoft.DotNet.Build.Tasks.Packaging. (This SDK depends on that package.) This is a very rough SDK that is a min bar attempt to get WindowsDesktop out of Core-Setup.
  • Microsoft.NET.SharedFramework.Sdk
  • Microsoft.DotNet.SharedFramework.Sdk
    • In case NET is too official.

@mmitche
Copy link
Member

mmitche commented Sep 26, 2019

Microsoft.DotNet.SharedFramework.Sdk

I like this one the best.

As far as why they are hard coded...I think primarily because there was originally one element to update. Feel free to add others. I'm not entirely sure where we would specify them that wouldn't end up being hard-coded in some fashion.

@dagood
Copy link
Member Author

dagood commented Sep 26, 2019

Microsoft.DotNet.SharedFramework.Sdk

I like this one the best.

Any objection to adding all three to avoid lag time later on?

My current plan is only to create Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk, then later I will create one of the other two because there will be no compatibility between them.

I'm not entirely sure where we would specify them that wouldn't end up being hard-coded in some fashion.

Have publish metadata that specifies that a package is an SDK with a new attribute in BAR, enabled via a property in the SDK's csproj?

GlobalJsonMSBuildSdk="true" in Version.Details.xml?

@alexperovich
Copy link
Member

The csproj for an sdk should just have <PackageType>MSBuildSdk</PackageType> that adds the right metadata into the nuspec. The BAR publishing stuff can read that.

@dagood
Copy link
Member Author

dagood commented Sep 26, 2019

I'm not too clear on the true classifications here, but the Packaging project has that and isn't what I think of as something that would go in the global.json:

But maybe that's harmless--I think it would only allow the package to be in a global.json, not prevent it from being used as an MSBuild tool package as well.

@dagood
Copy link
Member Author

dagood commented Sep 26, 2019

Adding the potential SDK names to the list is merged (dotnet/arcade-services#662), so I'm comfortable going ahead with my SDK package plans as is.

If it doesn't seem reasonable/worthwhile to implement generic SDK package global.json upgrade support (no big deal as far as I'm concerned, now that I got my IDs 😉), I suppose this issue can track the rollout of dotnet/arcade-services#662 and get closed after that.

@markwilkie
Copy link
Member

Closing at 662 is merged.

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

4 participants