Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
06fa327
remove version from rid-specific tool package metadata - all versions…
baronfel Jun 6, 2025
c70bf75
make tool packages publish instead of build
baronfel Jun 6, 2025
d87a4af
use more precise apphost-detection for command entrypoint
baronfel Jun 6, 2025
11ae747
don't use Items for ToolPackageRuntimeIdentifier - use a property ins…
baronfel Jun 6, 2025
0a37671
condition the PackTool targets so that only tool packages get the cha…
baronfel Jun 6, 2025
09e7d95
add RID to RID-specific tool package paths for future-proofing
baronfel Jun 6, 2025
944555c
ensure RID-specific packages get correct entrypoint and package type
baronfel Jun 6, 2025
b7b58e4
don't throw on RID-mismatch
baronfel Jun 6, 2025
5406dc1
handle multi-RID publishing as part of outer-packaging
baronfel Jun 6, 2025
3dcd541
simplify cross-arch packaging
baronfel Jun 6, 2025
bcbd802
re-add error when installing a RID-specific package but no matching R…
baronfel Jun 6, 2025
6dc57ca
remove ResolveToolPackagePaths now that it's computed in the targets …
baronfel Jun 6, 2025
9a15035
Don't have Pack call PackTool unless the package is a tool
baronfel Jun 7, 2025
897c950
only do tool-packaging things during publish if the published project…
baronfel Jun 7, 2025
d3332f9
restore RID-agnostic-only tool packaging
baronfel Jun 7, 2025
89b95d4
some more doc comments
baronfel Jun 7, 2025
3f7212d
WIP: diagnosing why shims are ended up in nested dirs during packaging
baronfel Jun 8, 2025
6f65e7a
fix shim path packaging
baronfel Jun 8, 2025
700a921
ensure inner-RID packing only happens for multi-RID tools, not tools …
baronfel Jun 8, 2025
b68b27d
Fix apphost inclusion in the RID-agnostic tool packages.
baronfel Jun 8, 2025
7d25694
Green up tests around GeneratePackageOnBuild
baronfel Jun 8, 2025
39efc99
update AOT tool test scenario and fix test breaks
baronfel Jun 9, 2025
dc4dca6
temp: add binlogs
baronfel Jun 9, 2025
af4ddb4
try to write binlogs to helix upload root
baronfel Jun 11, 2025
92fb63b
fix lookup path for binlogs
baronfel Jun 11, 2025
2444c06
Add test for the multi-package tool creation
baronfel Jun 11, 2025
578eba8
Fix tool shim output path calculation
baronfel Jun 12, 2025
55e5c4d
Remove now-unused Task
baronfel Jun 12, 2025
e9f8347
Ensure that RID-specific packages set the right package type
baronfel Jun 12, 2025
f37177c
Fix packaging tools that are multi-tfm
baronfel Jun 12, 2025
75b4ee6
Add more documentation comments to Targets files
baronfel Jun 12, 2025
7e9e0cf
React to @nagilson's review feedback
baronfel Jun 12, 2025
227f6b4
fix test case by making it pack as a tool so that the requested targe…
baronfel Jun 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ public class DotNetCliToolRuntimeIdentifierPackage

[XmlAttribute]
public string? Id { get; set; }

[XmlAttribute]
public string? Version { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static ToolConfiguration Deserialize(string pathToXml, IFileSystem fileSy
dotNetCliTool.Commands[0].Runner));
}

var ridSpecificPackages = dotNetCliTool.RuntimeIdentifierPackages?.ToDictionary(p => p.RuntimeIdentifier, p => new PackageIdentity(p.Id, new NuGet.Versioning.NuGetVersion(p.Version)))
var ridSpecificPackages = dotNetCliTool.RuntimeIdentifierPackages?.ToDictionary(p => p.RuntimeIdentifier, p => new PackageIdentity(p.Id, null))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late review: Does this now mean that it's not possible to have different versions for the RID-specific packages? I thought we weren't going to support different version numbers for package production, but we were still going to support consuming packages where the primary package has a different version from the RID-specific packages if someone creates packages like that through some other means.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct - I refactored that out in this pass. We could add it back (you're right that the production-side only supports making a single version across all tools), but I am not convinced that we'll ever actually see that scenario happen: IMO the only time you have separate packages being made now is related to AOT packaging, and even that should be really aligned version-wise.

.AsReadOnly();

// Also error out if there are no RID-specific packages and the runner is empty
Expand Down
24 changes: 13 additions & 11 deletions src/Cli/dotnet/ToolPackage/ToolPackageDownloaderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,14 @@ protected virtual void DownloadTool(
CreateAssetFile(packageId, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, targetFramework);

// Also download RID-specific package if needed
var ridSpecificPackage = ResolveRidSpecificPackage(packageId, packageVersion, packageDownloadDir, assetFileDirectory);
if (ridSpecificPackage != null)
if (ResolveRidSpecificPackage(packageId, packageVersion, packageDownloadDir, assetFileDirectory) is PackageId ridSpecificPackage)
{
if (!IsPackageInstalled(new PackageId(ridSpecificPackage.Id), ridSpecificPackage.Version, packageDownloadDir.Value))
if (!IsPackageInstalled(ridSpecificPackage, packageVersion, packageDownloadDir.Value))
{
DownloadAndExtractPackage(new PackageId(ridSpecificPackage.Id), nugetPackageDownloader, packageDownloadDir.Value, ridSpecificPackage.Version, packageSourceLocation, includeUnlisted: true);
DownloadAndExtractPackage(ridSpecificPackage, nugetPackageDownloader, packageDownloadDir.Value, packageVersion, packageSourceLocation, includeUnlisted: true);
}

CreateAssetFile(new PackageId(ridSpecificPackage.Id), ridSpecificPackage.Version, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, targetFramework);
CreateAssetFile(ridSpecificPackage, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, targetFramework);
}
}

Expand All @@ -301,15 +300,14 @@ public bool TryGetDownloadedTool(
}
CreateAssetFile(packageId, packageVersion, _localToolDownloadDir, Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, targetFramework);

var ridSpecificPackage = ResolveRidSpecificPackage(packageId, packageVersion, _localToolDownloadDir, _localToolAssetDir);
if (ridSpecificPackage != null)
if (ResolveRidSpecificPackage(packageId, packageVersion, _localToolDownloadDir, _localToolAssetDir) is PackageId ridSpecificPackage)
{
if (!IsPackageInstalled(new PackageId(ridSpecificPackage.Id), ridSpecificPackage.Version, _localToolDownloadDir.Value))
if (!IsPackageInstalled(ridSpecificPackage, packageVersion, _localToolDownloadDir.Value))
{
toolPackage = null;
return false;
}
CreateAssetFile(new PackageId(ridSpecificPackage.Id), ridSpecificPackage.Version, _localToolDownloadDir,
CreateAssetFile(ridSpecificPackage, packageVersion, _localToolDownloadDir,
Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, targetFramework);
}

Expand All @@ -322,7 +320,7 @@ public bool TryGetDownloadedTool(

}

private PackageIdentity? ResolveRidSpecificPackage(PackageId packageId,
private PackageId? ResolveRidSpecificPackage(PackageId packageId,
NuGetVersion packageVersion,
DirectoryPath packageDownloadDir,
DirectoryPath assetFileDirectory)
Expand All @@ -341,7 +339,11 @@ public bool TryGetDownloadedTool(

var resolvedPackage = toolConfiguration.RidSpecificPackages[bestRuntimeIdentifier];

return resolvedPackage;
if (resolvedPackage is PackageIdentity p)
{
return new PackageId(p.Id);
}
return null;
}

return null;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ internal static XDocument GenerateDocument(string entryPointRelativePath, string
string ridPackageId = toolPackageId + "." + toolPackageRuntimeIdentifier;
packageNode.Add(new XAttribute("Id", ridPackageId));

string ridPackageVersion = runtimeIdentifierPackage.GetMetadata("Version");
if (string.IsNullOrEmpty(ridPackageVersion))
{
ridPackageVersion = toolPackageVersion;
}
packageNode.Add(new XAttribute("Version", ridPackageVersion));

runtimeIdentifierPackagesNode.Add(packageNode);
}
}
Expand Down
36 changes: 0 additions & 36 deletions src/Tasks/Microsoft.NET.Build.Tasks/RemoveTargetFromList.cs

This file was deleted.

120 changes: 0 additions & 120 deletions src/Tasks/Microsoft.NET.Build.Tasks/ResolveToolPackagePaths.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ Copyright (c) .NET Foundation. All rights reserved.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackTool</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
</Project>
Loading
Loading