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

[automated] Merge branch 'release/8.0.3xx' => 'main' #39786

Merged
merged 153 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 151 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
c1376fe
Create a new label with the base image's digest when publishing
baronfel Mar 3, 2024
b3ae277
Add test to confirm behavior
baronfel Mar 3, 2024
3a2a80e
Add test to confirm digest behavior
baronfel Mar 3, 2024
b7273ed
fix incorrect string value
baronfel Mar 4, 2024
a743b97
fix test baseline
baronfel Mar 5, 2024
abac232
Update src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewI…
baronfel Mar 5, 2024
1adff27
detect and flow through the manifest digest from the registry or mani…
baronfel Mar 5, 2024
ad133d5
remove unused serialization changes
baronfel Mar 5, 2024
919385e
address ContainerBuilder visibility
baronfel Mar 5, 2024
bd63619
log message in confusing resource state
baronfel Mar 7, 2024
7c710cb
fix test
baronfel Mar 7, 2024
c55692c
fix numbering typo
baronfel Mar 7, 2024
bd03e2f
trimmed applications can use -extras images too
baronfel Mar 8, 2024
8d97cd8
FDD jammy apps with globalization that opt into chiseled need -extra
baronfel Mar 8, 2024
df146e6
do some truth table tests
baronfel Mar 8, 2024
4af7d86
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 15, 2024
2073b5c
Update dependencies from https://github.com/dotnet/roslyn build
dotnet-maestro[bot] Mar 15, 2024
c2d085d
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39553)
JL03-Yue Mar 15, 2024
9927abb
Use workload sets as per user request (#37681)
Forgind Mar 15, 2024
97b0514
Add MSI installer tests
dsplaisted Dec 12, 2023
9e6c454
WIP
dsplaisted Jan 26, 2024
06bac1a
WIP
dsplaisted Jan 29, 2024
88b20e6
WIP
dsplaisted Jan 31, 2024
95ed966
WIP
dsplaisted Jan 31, 2024
7c0c393
WIP
dsplaisted Feb 2, 2024
1559a39
WIP
dsplaisted Feb 2, 2024
4cd59df
WIP
dsplaisted Feb 6, 2024
5f90bb6
Support getting remote directory, and commands that don't change state
dsplaisted Feb 7, 2024
97ef42a
Add WithDescription
dsplaisted Feb 7, 2024
403a5a5
Refactor ReadOnly actions, cache their results, and use them for Remo…
dsplaisted Feb 8, 2024
faf1b4c
Port workload installation / GC test to new APIs
dsplaisted Feb 8, 2024
eb837e4
Improve assertion message formatting
dsplaisted Feb 8, 2024
dff6463
Trim deleted snapshots, better logging for grouped actions
dsplaisted Feb 12, 2024
9454ac2
Add tests for install state removal and repeated rollback
dsplaisted Feb 12, 2024
547312a
Add sanity check for wasm workload
dsplaisted Feb 12, 2024
ef2ddc1
Add InstallWithRollback test
dsplaisted Feb 13, 2024
15e7a52
Doc WIP
dsplaisted Feb 13, 2024
a14ce4d
WIP
dsplaisted Feb 13, 2024
5d64292
WIP
dsplaisted Feb 13, 2024
747f47c
WIP docs
dsplaisted Feb 14, 2024
7632c42
WIP
dsplaisted Feb 14, 2024
061f974
Add VM Test settings
dsplaisted Feb 14, 2024
96e8f7e
Doc update
dsplaisted Feb 14, 2024
0325624
Apply suggestions from code review
dsplaisted Mar 1, 2024
5b39400
Check images into repo
dsplaisted Mar 1, 2024
d87cb46
Fix pack error for MSI installation tests
dsplaisted Mar 1, 2024
3d5259a
Don't run MSI installation tests in Helix / CI
dsplaisted Mar 4, 2024
922beea
Apply suggestions from code review
dsplaisted Mar 8, 2024
6d7bdbb
Add images to repo
dsplaisted Mar 8, 2024
b314451
Improving virtual machine setup instructions
dsplaisted Mar 8, 2024
9effdac
Update test to work whether or not VS is pre-installed on VM
dsplaisted Mar 8, 2024
0ebc055
Comment cleanup
dsplaisted Mar 11, 2024
2b79b4b
Apply code review feedback
dsplaisted Mar 15, 2024
a8d57fd
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 16, 2024
e22f0bd
Update dependencies from https://github.com/dotnet/roslyn build
dotnet-maestro[bot] Mar 16, 2024
ed52c41
Update dependencies from https://github.com/dotnet/arcade build
dotnet-maestro[bot] Mar 16, 2024
2e7c585
Add MSI Installation Tests (#38782)
dsplaisted Mar 17, 2024
fdc5921
Update dependencies from https://github.com/nuget/nuget.client build
dotnet-maestro[bot] Mar 17, 2024
c8b0a12
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 17, 2024
855b129
Update dependencies from https://github.com/dotnet/roslyn build
dotnet-maestro[bot] Mar 17, 2024
56ab9fb
Update dependencies from https://github.com/dotnet/arcade build
dotnet-maestro[bot] Mar 17, 2024
d0fc590
[release/8.0.3xx] Update dependencies from nuget/nuget.client (#39570)
v-wuzhai Mar 18, 2024
ed5a1b0
[release/8.0.3xx] Update dependencies from dotnet/arcade (#39567)
v-wuzhai Mar 18, 2024
70b64ce
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39566)
v-wuzhai Mar 18, 2024
291ad6b
[release/8.0.3xx] Update dependencies from dotnet/razor (#39552)
v-wuzhai Mar 18, 2024
f1534e9
Update dependencies from https://github.com/dotnet/fsharp build
dotnet-maestro[bot] Mar 18, 2024
2d73d5d
Update dependencies from https://github.com/dotnet/roslyn build
dotnet-maestro[bot] Mar 18, 2024
b1b2ada
Update dependencies from https://github.com/dotnet/templating build
dotnet-maestro[bot] Mar 18, 2024
b71f249
[release/8.0.3xx] Update dependencies from dotnet/fsharp (#39577)
JL03-Yue Mar 18, 2024
a87c6b8
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39578)
JL03-Yue Mar 18, 2024
e33d9e6
[release/8.0.3xx] Update dependencies from dotnet/templating (#39579)
JL03-Yue Mar 18, 2024
ef46918
Tell MSBuild to fail when enumerating a drive
Forgind Mar 18, 2024
a0ce729
Add nuget.localization to codeflow
marcpopMSFT Mar 18, 2024
25e052e
Update dependencies from https://github.com/dotnet/fsharp build
dotnet-maestro[bot] Mar 19, 2024
515b07a
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 19, 2024
a220610
Update dependencies from https://github.com/dotnet/roslyn build
dotnet-maestro[bot] Mar 19, 2024
a871ba2
Update dependencies from https://github.com/dotnet/source-build-exter…
dotnet-maestro[bot] Mar 19, 2024
1c25e55
Add an image digest label to generated containers (#39160)
baronfel Mar 19, 2024
8ed3fc7
Enhance base image inference for trimmed applications - use -extras w…
baronfel Mar 19, 2024
a32dc34
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 19, 2024
4cdac46
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 19, 2024
4496643
Add nuget.localization to codeflow (#39593)
marcpopMSFT Mar 19, 2024
5a9a5a3
No drive enumerations Fixes #38050 (#38436)
marcpopMSFT Mar 19, 2024
30b9590
[release/8.0.3xx] Update dependencies from dotnet/source-build-extern…
v-wuzhai Mar 20, 2024
d9fd142
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39611)
v-wuzhai Mar 20, 2024
7f8b852
[release/8.0.3xx] Update dependencies from dotnet/fsharp (#39609)
v-wuzhai Mar 20, 2024
516f435
[release/8.0.3xx] Update dependencies from dotnet/razor (#39610)
v-wuzhai Mar 20, 2024
1595cec
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 20, 2024
37bafb7
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 20, 2024
4584706
Update dependencies from https://github.com/dotnet/msbuild build
dotnet-maestro[bot] Mar 20, 2024
ff3c6c3
Update dependencies from https://github.com/microsoft/vstest build
dotnet-maestro[bot] Mar 20, 2024
6026519
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 20, 2024
c8f5cea
[release/8.0.3xx] Update dependencies from dotnet/razor (#39633)
v-wuzhai Mar 21, 2024
b4d072a
[release/8.0.3xx] Update dependencies from microsoft/vstest (#39632)
v-wuzhai Mar 21, 2024
7fc0f87
Update dependencies from https://github.com/dotnet/msbuild build
dotnet-maestro[bot] Mar 21, 2024
e7fee11
Update dependencies from https://github.com/microsoft/vstest build
dotnet-maestro[bot] Mar 21, 2024
27bc946
add allowthousands to NumberStyles in DotnetNewSearchTests
JL03-Yue Mar 21, 2024
080f012
add a fix for namecomparer for DotnetNewSearchTests
JL03-Yue Mar 22, 2024
0f4c6e5
[release/8.0.3xx] Update dependencies from microsoft/vstest (#39656)
JL03-Yue Mar 22, 2024
7c6a6d9
add allowthousands to NumberStyles in DotnetNewSearchTests
JL03-Yue Mar 21, 2024
25ac3a3
add a fix for namecomparer for DotnetNewSearchTests
JL03-Yue Mar 22, 2024
37deb25
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 22, 2024
5c9f5a7
Merge branch 'release/8.0.3xx' of https://github.com/dotnet/sdk into …
v-wuzhai Mar 22, 2024
666492f
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39634)
dotnet-maestro[bot] Mar 22, 2024
e4511a1
[release/8.0.3xx] Update dependencies from dotnet/razor (#39657)
dotnet-maestro[bot] Mar 22, 2024
fcede49
[release/8.0.3xx] Update dependencies from dotnet/msbuild (#39631)
JL03-Yue Mar 22, 2024
2860178
Update dependencies from https://github.com/dotnet/fsharp build
dotnet-maestro[bot] Mar 22, 2024
ba8e3e9
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 22, 2024
cf7e3df
Update dependencies from https://github.com/dotnet/templating build
dotnet-maestro[bot] Mar 22, 2024
24e0589
Update dependencies from https://github.com/dotnet/arcade build
dotnet-maestro[bot] Mar 22, 2024
b7cbd39
[release/8.0.3xx] Update dependencies from dotnet/fsharp (#39691)
JL03-Yue Mar 22, 2024
6796dc4
[release/8.0.3xx] Update dependencies from dotnet/razor (#39692)
JL03-Yue Mar 22, 2024
d1679b7
[release/8.0.3xx] Update dependencies from dotnet/templating (#39694)
JL03-Yue Mar 22, 2024
6b5f92d
[release/8.0.3xx] Update dependencies from dotnet/arcade (#39695)
JL03-Yue Mar 22, 2024
862fc12
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 22, 2024
58e38a5
Update dependencies from https://github.com/dotnet/fsharp build
dotnet-maestro[bot] Mar 23, 2024
5a0a213
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 23, 2024
d07aedb
Update dependencies from https://github.com/dotnet/fsharp build
dotnet-maestro[bot] Mar 24, 2024
ccf4536
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 24, 2024
c763091
[release/8.0.3xx] Update dependencies from dotnet/razor (#39719)
v-wuzhai Mar 25, 2024
7350125
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
dotnet-bot Mar 25, 2024
b0a41e2
[release/8.0.3xx] Update dependencies from dotnet/fsharp (#39718)
v-wuzhai Mar 25, 2024
8099562
Update dependencies from https://github.com/dotnet/razor build
dotnet-maestro[bot] Mar 25, 2024
faef54f
Update dependencies from https://github.com/dotnet/arcade build
dotnet-maestro[bot] Mar 25, 2024
9ca7778
[release/8.0.3xx] Update dependencies from dotnet/arcade (#39741)
v-wuzhai Mar 26, 2024
c28f2a1
[release/8.0.3xx] Update dependencies from dotnet/razor (#39740)
v-wuzhai Mar 26, 2024
be4043e
skip CanSortByDownloadCountAndThenByName because it's blocking
baronfel Mar 26, 2024
5157609
[release/8.0.3xx] skip CanSortByDownloadCountAndThenByName because it…
baronfel Mar 26, 2024
e0b5b44
Localized file check-in by OneLocBuild Task: Build definition ID 140:…
marcpopMSFT Mar 26, 2024
f2f59be
Create a new label with TFM of the app and the SDK used to build the …
baronfel Mar 26, 2024
5014b43
[release/8.0.3xx] Update dependencies from dotnet/arcade (#39813)
dotnet-maestro[bot] Mar 27, 2024
dd132d5
[release/8.0.3xx] Update dependencies from dotnet/source-build-extern…
dotnet-maestro[bot] Mar 27, 2024
e009bf6
[release/8.0.3xx] Update dependencies from dotnet/razor (#39811)
dotnet-maestro[bot] Mar 27, 2024
a35de7a
[release/8.0.3xx] Update dependencies from dotnet/fsharp (#39810)
dotnet-maestro[bot] Mar 27, 2024
aaa4eba
[release/8.0.3xx] Update dependencies from dotnet/msbuild (#39809)
dotnet-maestro[bot] Mar 27, 2024
4162c31
[release/8.0.3xx] Update dependencies from nuget/nuget.client (#39808)
dotnet-maestro[bot] Mar 27, 2024
049918f
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39693)
dotnet-maestro[bot] Mar 27, 2024
67b09cf
Update dependencies from https://github.com/dotnet/msbuild build 2024…
dotnet-maestro[bot] Mar 28, 2024
b624db4
Update dependencies from https://github.com/microsoft/vstest build 20…
dotnet-maestro[bot] Mar 28, 2024
157204b
Update dependencies from https://github.com/dotnet/roslyn build 20240…
dotnet-maestro[bot] Mar 28, 2024
948474b
Update dependencies from https://github.com/dotnet/arcade build 20240…
dotnet-maestro[bot] Mar 28, 2024
dba01f7
[release/8.0.3xx] Update dependencies from dotnet/templating (#39720)
dotnet-maestro[bot] Mar 28, 2024
59d899b
[release/8.0.3xx] Update dependencies from dotnet/roslyn (#39861)
v-wuzhai Mar 29, 2024
2111c01
[release/8.0.3xx] Update dependencies from microsoft/vstest (#39858)
v-wuzhai Mar 29, 2024
692aff4
[release/8.0.3xx] Update dependencies from dotnet/msbuild (#39857)
v-wuzhai Mar 29, 2024
68118be
[release/8.0.3xx] Update dependencies from dotnet/razor (#39860)
dotnet-maestro[bot] Mar 29, 2024
f4961de
[release/8.0.3xx] Update dependencies from dotnet/arcade (#39862)
v-wuzhai Mar 29, 2024
43f3248
Merge branch 'release/8.0.3xx'
v-wuzhai Apr 1, 2024
d188440
Fixed Nullability Type Mismatch
v-wuzhai Apr 1, 2024
ec860f4
Merge branch 'main' of https://github.com/dotnet/sdk into merge/relea…
v-wuzhai Apr 2, 2024
265272a
Updated link in Workload MSI Installation Tests’ README.md
v-wuzhai Apr 2, 2024
f0c2afc
Merge branch 'main' of https://github.com/dotnet/sdk into merge/relea…
v-wuzhai Apr 19, 2024
a147448
Skip the test ItCanBuildWithMicrosoftBuildArtifactsSdk
v-wuzhai Apr 19, 2024
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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="$(MicrosoftNETCoreAppRefPackageVersion)"/>
<PackageVersion Include="Microsoft.FSharp.Compiler" Version="$(MicrosoftFSharpCompilerPackageVersion)" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset.Framework" Version="$(MicrosoftNetCompilersToolsetVersion)" />
<PackageVersion Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
<PackageVersion Include="Microsoft.NET.HostModel" Version="$(MicrosoftNETHostModelVersion)" />
<PackageVersion Include="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="$(MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion)" />
<PackageVersion Include="Microsoft.NETCore.DotNetHostResolver" Version="$(MicrosoftNETCoreDotNetHostResolverPackageVersion)" />
Expand Down
1 change: 1 addition & 0 deletions documentation/general/workloads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Other documentation for workloads is in this repo:
- [Grouping multiple packs into one MSI](https://github.com/dotnet/sdk/issues/21741)
- [Handling workload assets across major .NET versions](cross-version-workloads.md)
- [Workload Clean Command](workload-clean.md)
- [Workload MSI Installation Tests](/test/dotnet-MsiInstallation.Tests/README.md)
7 changes: 7 additions & 0 deletions sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Build.Contain
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDDLTests", "test\SDDLTests\SDDLTests.csproj", "{FEA8B7B5-901B-4A3A-948F-7E5F54F09FF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-MsiInstallation.Tests", "test\dotnet-MsiInstallation.Tests\dotnet-MsiInstallation.Tests.csproj", "{36975025-857B-45F0-AB39-904B521A6713}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{44E564E1-AE0D-4313-A4E9-CBF2109397E3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{3AD322BF-405B-4A53-9858-51CF66E8509F}"
Expand Down Expand Up @@ -913,6 +915,10 @@ Global
{D7495CE7-64E5-4715-9304-799A41EC1D71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7495CE7-64E5-4715-9304-799A41EC1D71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7495CE7-64E5-4715-9304-799A41EC1D71}.Release|Any CPU.Build.0 = Release|Any CPU
{36975025-857B-45F0-AB39-904B521A6713}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36975025-857B-45F0-AB39-904B521A6713}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36975025-857B-45F0-AB39-904B521A6713}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36975025-857B-45F0-AB39-904B521A6713}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1081,6 +1087,7 @@ Global
{85A01ACB-CC90-45EF-8F6C-AFC2B9F31126} = {3AD322BF-405B-4A53-9858-51CF66E8509F}
{7382A1CB-AA9A-4136-A548-17D7A67C6B0C} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
{D7495CE7-64E5-4715-9304-799A41EC1D71} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
{36975025-857B-45F0-AB39-904B521A6713} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}
Expand Down
1 change: 1 addition & 0 deletions src/Cli/Microsoft.DotNet.Cli.Utils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ public static class Constants
public static readonly string AnyRid = "any";

public static readonly string RestoreInteractiveOption = "--interactive";
public static readonly string workloadSetVersionFileName = "workloadVersion.txt";
}
}
24 changes: 24 additions & 0 deletions src/Cli/Microsoft.DotNet.Cli.Utils/PathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@ public static bool TryDeleteDirectory(string directoryPath)
}
}

/// <summary>
/// Deletes the provided file. Then deletes the parent directory if empty
/// and continues to its parent until it fails. Returns whether it succeeded
/// in deleting the file it was intended to delete.
/// </summary>
public static bool DeleteFileAndEmptyParents(string path)
{
if (!File.Exists(path))
{
return false;
}

File.Delete(path);
var dir = Path.GetDirectoryName(path);

while (!Directory.EnumerateFileSystemEntries(dir).Any())
{
Directory.Delete(dir);
dir = Path.GetDirectoryName(dir);
}

return !File.Exists(path);
}

/// <summary>
/// Returns childItem relative to directory, with Path.DirectorySeparatorChar as separator
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions src/Cli/dotnet/Installer/Windows/InstallMessageDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,21 @@ public InstallResponseMessage SendUpdateWorkloadModeRequest(SdkFeatureBand sdkFe
UseWorkloadSets = newMode,
});
}

/// <summary>
/// Send an <see cref="InstallRequestMessage"/> to adjust the workload set version used for installing and updating workloads
/// </summary>
/// <param name="sdkFeatureBand">The SDK feature band of the install state file to write</param>
/// <param name="newVersion">The workload set version</param>
/// <returns></returns>
public InstallResponseMessage SendUpdateWorkloadSetRequest(SdkFeatureBand sdkFeatureBand, string newVersion)
{
return Send(new InstallRequestMessage
{
RequestType = InstallRequestType.AdjustWorkloadSetVersion,
SdkFeatureBand = sdkFeatureBand.ToString(),
WorkloadSetVersion = newVersion,
});
}
}
}
8 changes: 8 additions & 0 deletions src/Cli/dotnet/Installer/Windows/InstallRequestMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ public bool UseWorkloadSets
get; set;
}

/// <summary>
/// The workload set version
/// </summary>
public string WorkloadSetVersion
{
get; set;
}

/// <summary>
/// Converts a deserialized array of bytes into an <see cref="InstallRequestMessage"/>.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Cli/dotnet/Installer/Windows/InstallRequestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,10 @@ public enum InstallRequestType
/// Changes the workload mode
/// </summary>
AdjustWorkloadMode,

/// <summary>
/// Changes the workload set version
/// </summary>
AdjustWorkloadSetVersion,
}
}
5 changes: 5 additions & 0 deletions src/Cli/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public static int Main(string[] args)

bool perfLogEnabled = Env.GetEnvironmentVariableAsBool("DOTNET_CLI_PERF_LOG", false);

if (string.IsNullOrEmpty(Env.GetEnvironmentVariable("MSBUILDFAILONDRIVEENUMERATINGWILDCARD")))
{
Environment.SetEnvironmentVariable("MSBUILDFAILONDRIVEENUMERATINGWILDCARD", "1");
}

// Avoid create temp directory with root permission and later prevent access in non sudo
if (SudoEnvironmentDirectoryOverride.IsRunningUnderSudo())
{
Expand Down
53 changes: 53 additions & 0 deletions src/Cli/dotnet/commands/InstallingWorkloadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal abstract class InstallingWorkloadCommand : WorkloadCommandBase
protected readonly SdkFeatureBand _sdkFeatureBand;
protected readonly ReleaseVersion _targetSdkVersion;
protected readonly string _fromRollbackDefinition;
protected string _workloadSetVersion;
protected readonly PackageSourceLocation _packageSourceLocation;
protected readonly IWorkloadResolverFactory _workloadResolverFactory;
protected IWorkloadResolver _workloadResolver;
Expand Down Expand Up @@ -96,6 +97,53 @@ protected static Dictionary<string, string> GetInstallStateContents(IEnumerable<
manifestVersionUpdates.Select(update => new WorkloadManifestInfo(update.ManifestId.ToString(), update.NewVersion.ToString(), /* We don't actually use the directory here */ string.Empty, update.NewFeatureBand))
).ToDictionaryForJson();

public static bool ShouldUseWorkloadSetMode(SdkFeatureBand sdkFeatureBand, string dotnetDir)
{
string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json");
var installStateContents = File.Exists(path) ? InstallStateContents.FromString(File.ReadAllText(path)) : new InstallStateContents();
return installStateContents.UseWorkloadSets ?? false;
}

protected IEnumerable<ManifestVersionUpdate> HandleWorkloadUpdateFromVersion(ITransactionContext context, DirectoryPath? offlineCache)
{
// Ensure workload set mode is set to 'workloadset'
// Do not skip checking the mode first, as setting it triggers
// an admin authorization popup for MSI-based installs.
if (!ShouldUseWorkloadSetMode(_sdkFeatureBand, _dotnetPath))
{
_workloadInstaller.UpdateInstallMode(_sdkFeatureBand, true);
}

_workloadManifestUpdater.DownloadWorkloadSet(_workloadSetVersion, offlineCache);
return InstallWorkloadSet(context);
}

public IEnumerable<ManifestVersionUpdate> InstallWorkloadSet(ITransactionContext context)
{
var advertisingPackagePath = Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString(), "microsoft.net.workloads");
if (File.Exists(Path.Combine(advertisingPackagePath, Constants.workloadSetVersionFileName)))
{
// This file isn't created in tests.
PrintWorkloadSetTransition(File.ReadAllText(Path.Combine(advertisingPackagePath, Constants.workloadSetVersionFileName)));
}
var workloadSetPath = _workloadInstaller.InstallWorkloadSet(context, advertisingPackagePath);
var files = Directory.EnumerateFiles(workloadSetPath, "*.workloadset.json");
return _workloadManifestUpdater.ParseRollbackDefinitionFiles(files);
}

private void PrintWorkloadSetTransition(string newVersion)
{
var currentVersion = _workloadResolver.GetWorkloadVersion();
if (currentVersion == null)
{
Reporter.WriteLine(string.Format(Strings.NewWorkloadSet, newVersion));
}
else
{
Reporter.WriteLine(string.Format(Strings.WorkloadSetUpgrade, currentVersion, newVersion));
}
}

protected async Task<List<WorkloadDownload>> GetDownloads(IEnumerable<WorkloadId> workloadIds, bool skipManifestUpdate, bool includePreview, string downloadFolder = null,
IReporter reporter = null, INuGetPackageDownloader packageDownloader = null)
{
Expand Down Expand Up @@ -204,6 +252,11 @@ internal static class InstallingWorkloadCommandParser
Hidden = true
};

public static readonly CliOption<string> WorkloadSetVersionOption = new("--version")
{
Description = Strings.WorkloadSetVersionOptionDescription
};

public static readonly CliOption<bool> PrintDownloadLinkOnlyOption = new("--print-download-link-only")
{
Description = Strings.PrintDownloadLinkOnlyDescription,
Expand Down
14 changes: 11 additions & 3 deletions src/Cli/dotnet/commands/dotnet-workload/InstallStateContents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Text.Json;
using System.Text.Json.Serialization;

#pragma warning disable CS8632

namespace Microsoft.DotNet.Workloads.Workload
{
internal class InstallStateContents
Expand All @@ -12,17 +14,21 @@ internal class InstallStateContents
public bool? UseWorkloadSets { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string> Manifests { get; set; }
public Dictionary<string, string>? Manifests { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? WorkloadVersion { get; set; }

private static readonly JsonSerializerOptions s_options = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
WriteIndented = true,
AllowTrailingCommas = true,
};

public static InstallStateContents FromString(string contents)
{
return JsonSerializer.Deserialize<InstallStateContents>(contents, s_options);
return JsonSerializer.Deserialize<InstallStateContents>(contents, s_options) ?? new InstallStateContents();
}

public static InstallStateContents FromPath(string path)
Expand All @@ -35,4 +41,6 @@ public override string ToString()
return JsonSerializer.Serialize<InstallStateContents>(this, s_options);
}
}
}
}

#pragma warning restore CS8632
7 changes: 4 additions & 3 deletions src/Cli/dotnet/commands/dotnet-workload/WorkloadInfoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal class WorkloadInfoHelper : IWorkloadInfoHelper
{
public readonly SdkFeatureBand _currentSdkFeatureBand;
private readonly string _targetSdkVersion;
public string DotnetPath { get; }

public WorkloadInfoHelper(
bool isInteractive,
Expand All @@ -30,20 +31,20 @@ public WorkloadInfoHelper(
string userProfileDir = null,
IWorkloadResolver workloadResolver = null)
{
string dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
ReleaseVersion currentSdkReleaseVersion = new(currentSdkVersion ?? Product.Version);
_currentSdkFeatureBand = new SdkFeatureBand(currentSdkReleaseVersion);

_targetSdkVersion = targetSdkVersion;
userProfileDir ??= CliFolderPathCalculator.DotnetUserProfileFolderPath;
ManifestProvider =
new SdkDirectoryWorkloadManifestProvider(dotnetPath,
new SdkDirectoryWorkloadManifestProvider(DotnetPath,
string.IsNullOrWhiteSpace(_targetSdkVersion)
? currentSdkReleaseVersion.ToString()
: _targetSdkVersion,
userProfileDir, SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory));
WorkloadResolver = workloadResolver ?? NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(
ManifestProvider, dotnetPath,
ManifestProvider, DotnetPath,
currentSdkReleaseVersion.ToString(), userProfileDir);

var restoreConfig = new RestoreActionConfig(Interactive: isInteractive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public override int Execute()

private void ExecuteGarbageCollection()
{
_workloadInstaller.GarbageCollect(workloadSetVersion => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, workloadSetVersion),
_workloadInstaller.GarbageCollect(workloadVersion => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, workloadVersion),
cleanAllPacks: _cleanAll);

DisplayUninstallableVSWorkloads();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using NuGet.Common;
using NuGet.Versioning;
using static Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver;

using PathUtility = Microsoft.DotNet.Tools.Common.PathUtility;

namespace Microsoft.DotNet.Workloads.Workload.Install
{
Expand Down Expand Up @@ -85,6 +85,31 @@ IEnumerable<PackInfo> GetPacksInWorkloads(IEnumerable<WorkloadId> workloadIds)
return packs;
}

public string InstallWorkloadSet(ITransactionContext context, string advertisingPackagePath)
{
var workloadVersion = File.ReadAllText(Path.Combine(advertisingPackagePath, Constants.workloadSetVersionFileName));
var workloadSetPath = Path.Combine(_dotnetDir, "sdk-manifests", _sdkFeatureBand.ToString(), "workloadsets", workloadVersion);
context.Run(
action: () =>
{
Directory.CreateDirectory(workloadSetPath);

foreach (var file in Directory.EnumerateFiles(advertisingPackagePath))
{
File.Copy(file, Path.Combine(workloadSetPath, Path.GetFileName(file)), overwrite: true);
}
},
rollback: () =>
{
foreach (var file in Directory.EnumerateFiles(workloadSetPath))
{
PathUtility.DeleteFileAndEmptyParents(file);
}
});

return workloadSetPath;
}

public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null)
{
var packInfos = GetPacksInWorkloads(workloadIds);
Expand Down Expand Up @@ -452,6 +477,15 @@ public void GarbageCollect(Func<string, IWorkloadResolver> getResolverForWorkloa

}

public void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion)
{
string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _dotnetDir), "default.json");
Directory.CreateDirectory(Path.GetDirectoryName(path));
var installStateContents = InstallStateContents.FromPath(path);
installStateContents.WorkloadVersion = workloadVersion;
File.WriteAllText(path, installStateContents.ToString());
}

public void RemoveManifestsFromInstallState(SdkFeatureBand sdkFeatureBand)
{
string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _dotnetDir), "default.json");
Expand Down Expand Up @@ -509,7 +543,14 @@ public void Shutdown()

public PackageId GetManifestPackageId(ManifestId manifestId, SdkFeatureBand featureBand)
{
return new PackageId($"{manifestId}.Manifest-{featureBand}");
if (manifestId.ToString().Equals("Microsoft.NET.Workloads", StringComparison.OrdinalIgnoreCase))
{
return new PackageId($"{manifestId}.{featureBand}");
}
else
{
return new PackageId($"{manifestId}.Manifest-{featureBand}");
}
}

public async Task ExtractManifestAsync(string nupkgPath, string targetPath)
Expand Down
4 changes: 4 additions & 0 deletions src/Cli/dotnet/commands/dotnet-workload/install/IInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ internal interface IInstaller : IWorkloadManifestInstaller
{
int ExitCode { get; }

string InstallWorkloadSet(ITransactionContext context, string advertisingPackagePath);

void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null);

void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null);
Expand All @@ -25,6 +27,8 @@ internal interface IInstaller : IWorkloadManifestInstaller

IEnumerable<WorkloadDownload> GetDownloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, bool includeInstalledItems);

void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion);

/// <summary>
/// Replace the workload resolver used by this installer. Typically used to call <see cref="GetDownloads(IEnumerable{WorkloadId}, SdkFeatureBand, bool)"/>
/// for a set of workload manifests that isn't currently installed
Expand Down
Loading
Loading