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/9.0.1xx' => 'main' #43065

Merged
merged 66 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f1b61ba
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 12, 2024
6d83909
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 12, 2024
9e98c56
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 12, 2024
636a95e
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 13, 2024
7770249
Merged PR 41053: [internal/release/8.0.4xx] Update dependencies from …
Jul 15, 2024
9f498c3
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 16, 2024
feb9dbe
Merged PR 41114: [internal/release/8.0.4xx] Update dependencies from …
Jul 16, 2024
b44b82f
Merge commit 'f2fb0a9a01b23bec6680ff9c11f8a694222542e8'
Jul 17, 2024
5a68704
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 17, 2024
5dde9d8
Merged PR 41133: [internal/release/8.0.4xx] Update dependencies from …
Jul 17, 2024
9dc04da
Merge commit '1788b1bca65c7d36c82f73048615faa355c39658'
Jul 17, 2024
791ba21
Update dependencies from https://dev.azure.com/dnceng/internal/_git/d…
dotnet-bot Jul 20, 2024
b272e9d
Merged PR 41236: [internal/release/8.0.4xx] Update dependencies from …
Jul 20, 2024
5f41a95
Updated Version.Details.xml - fix released package shas
vseanreesermsft Jul 22, 2024
9952265
Merged PR 41255: Updated Version.Details.xml - fix released package shas
vseanreesermsft Jul 22, 2024
375e494
Merged PR 41305: Added new set of credential env variables to be used…
baronfel Jul 24, 2024
45f1596
Merge commit '375e4940f138725b41a8a1b75a7ceec82fe426cc' into internal…
vseanreesermsft Aug 13, 2024
e6fe4f5
Merge branch 'release/8.0.4xx' into internal-merge-8.0.4xx-2024-08-13…
Forgind Aug 14, 2024
948731f
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Aug 15, 2024
f66097b
Merge branch 'release/8.0.4xx' into internal-merge-8.0.4xx-2024-08-13…
vseanreesermsft Aug 15, 2024
28f6579
[release/8.0.4xx] Update dependencies from dotnet/source-build-refere…
dotnet-maestro[bot] Aug 15, 2024
ed588c9
[release/8.0.4xx] Update dependencies from dotnet/templating (#42761)
v-wuzhai Aug 16, 2024
61dbec4
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Aug 16, 2024
3825353
trust the http dev-cert
baronfel Aug 16, 2024
bd8927e
skip containers test and add item to reenable
baronfel Aug 17, 2024
61135b6
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Aug 19, 2024
4a1371a
Merging internal commits for release/8.0.4xx (#42701)
marcpopMSFT Aug 19, 2024
32da20b
[release/8.0.4xx] Update dependencies from dotnet/templating (#42792)
marcpopMSFT Aug 19, 2024
d1715f6
Revert disabling the toolset package in Helix
jjonescz Aug 20, 2024
c5e8a24
Include Testpackages in Helix
jjonescz Aug 20, 2024
b0acfed
Avoid using unset `NuGetPackageRoot`
jjonescz Aug 21, 2024
f21eab1
Update dependencies from https://github.com/dotnet/razor build 202408…
dotnet-maestro[bot] Aug 21, 2024
729de94
[release/8.0.4xx] Update dependencies from dotnet/razor (#42905)
marcpopMSFT Aug 21, 2024
e8bb7f8
Link tracking issue
jjonescz Aug 27, 2024
0320fa1
Update dependencies from https://github.com/dotnet/roslyn build 20240…
dotnet-maestro[bot] Aug 27, 2024
648f1c8
Update dependencies from https://github.com/dotnet/windowsdesktop bui…
dotnet-maestro[bot] Aug 27, 2024
525fe1a
Update dependencies from https://github.com/dotnet/msbuild build 2024…
dotnet-maestro[bot] Aug 27, 2024
96cfa85
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Aug 27, 2024
22e914a
Update dependencies from https://github.com/dotnet/windowsdesktop bui…
dotnet-maestro[bot] Aug 27, 2024
946a8e4
Update dependencies from https://github.com/dotnet/razor build 202408…
dotnet-maestro[bot] Aug 27, 2024
5ba3e14
Update dependencies from https://github.com/dotnet/windowsdesktop bui…
dotnet-maestro[bot] Aug 28, 2024
8e34a24
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Aug 28, 2024
1aa09ad
Merge branch 'release/8.0.4xx' into release/9.0.1xx
v-wuzhai Aug 28, 2024
5bb55cd
Update the System.Formats.Asn1 package version
v-wuzhai Aug 28, 2024
1009af2
Update dependencies from https://github.com/dotnet/roslyn build 20240…
dotnet-maestro[bot] Aug 28, 2024
f507dc8
Update dependencies from https://github.com/dotnet/sourcelink build 2…
dotnet-maestro[bot] Aug 28, 2024
abd3cee
Update dependencies from https://github.com/dotnet/runtime build 2024…
dotnet-maestro[bot] Aug 28, 2024
515a5f2
Update dependencies from https://github.com/dotnet/source-build-refer…
dotnet-maestro[bot] Aug 28, 2024
aaa9dbc
Update dependencies from https://github.com/dotnet/windowsdesktop bui…
dotnet-maestro[bot] Aug 28, 2024
b6eba64
Update dependencies from https://github.com/nuget/nuget.client build …
dotnet-maestro[bot] Aug 28, 2024
b35db9c
Permit workload restore to work with new global.json (#42606)
Forgind Aug 28, 2024
0030622
Revert disabling the toolset package in Helix (#42860)
marcpopMSFT Aug 28, 2024
a75cd17
Update dependencies from https://github.com/dotnet/razor build 202408…
dotnet-maestro[bot] Aug 28, 2024
6bbd70c
Update dependencies from https://github.com/dotnet/razor build 202408…
dotnet-maestro[bot] Aug 28, 2024
9e5607e
[release/9.0.1xx] Update dependencies from dotnet/msbuild (#43025)
v-wuzhai Aug 29, 2024
8e17fb3
[release/9.0.1xx] Update dependencies from dotnet/razor (#43043)
v-wuzhai Aug 29, 2024
ef81fcf
[release/9.0.1xx] Update dependencies from dotnet/runtime (#43055)
v-wuzhai Aug 29, 2024
09b1bfe
[release/9.0.1xx] Update dependencies from dotnet/sourcelink (#43054)
v-wuzhai Aug 29, 2024
b899f4e
[release/9.0.1xx] Update dependencies from dotnet/templating (#43047)
v-wuzhai Aug 29, 2024
867b64a
[release/9.0.1xx] Update dependencies from dotnet/windowsdesktop (#43…
v-wuzhai Aug 29, 2024
a11c051
[release/9.0.1xx] Update dependencies from dotnet/roslyn (#43023)
v-wuzhai Aug 29, 2024
6dbe16c
Merge branch 'release/9.0.1xx' of https://github.com/dotnet/sdk into …
v-wuzhai Aug 29, 2024
be7d237
[release/9.0.1xx] Update dependencies from dotnet/source-build-refere…
v-wuzhai Aug 29, 2024
a127dff
Merge branch 'release/8.0.4xx' => 'release/9.0.1xx' (#43052)
v-wuzhai Aug 29, 2024
89d6f5a
[release/9.0.1xx] Update dependencies from nuget/nuget.client (#43059)
v-wuzhai Aug 29, 2024
225cec2
Merge branch 'main' of https://github.com/dotnet/sdk into merge/relea…
v-wuzhai Aug 29, 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
2 changes: 1 addition & 1 deletion build/RunTestsOnHelix.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set DOTNET_ROOT=%HELIX_CORRELATION_PAYLOAD%\d
set PATH=%DOTNET_ROOT%;%PATH%
set DOTNET_MULTILEVEL_LOOKUP=0
set TestFullMSBuild=%1
set BuildWithNetFrameworkHostedCompiler=false

set TestExecutionDirectory=%CD%\testExecutionDirectory
mkdir %TestExecutionDirectory%
Expand Down Expand Up @@ -38,6 +37,7 @@ REM We downloaded a special zip of files to the .nuget folder so add that as a s
dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config
PowerShell -ExecutionPolicy ByPass "dotnet nuget locals all -l | ForEach-Object { $_.Split(' ')[1]} | Where-Object{$_ -like '*cache'} | Get-ChildItem -Recurse -File -Filter '*.dat' | Measure"
dotnet nuget add source %DOTNET_ROOT%\.nuget --configfile %TestExecutionDirectory%\nuget.config
if exist %TestExecutionDirectory%\Testpackages dotnet nuget add source %TestExecutionDirectory%\Testpackages --name testpackages --configfile %TestExecutionDirectory%\nuget.config

dotnet nuget remove source dotnet6-transport --configfile %TestExecutionDirectory%\nuget.config
dotnet nuget remove source dotnet6-internal-transport --configfile %TestExecutionDirectory%\nuget.config
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/dotnet/commands/InstallingWorkloadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected void UpdateWorkloadManifests(WorkloadHistoryRecorder recorder, ITransa
_workloadInstaller.UpdateInstallMode(_sdkFeatureBand, true);
}

if (SpecifiedWorkloadSetVersionInGlobalJson)
if (SpecifiedWorkloadSetVersionInGlobalJson && recorder is not null)
{
recorder.HistoryRecord.GlobalJsonVersion = _workloadSetVersionFromGlobalJson;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ public WorkloadInstallCommand(
INuGetPackageDownloader nugetPackageDownloader = null,
IWorkloadManifestUpdater workloadManifestUpdater = null,
string tempDirPath = null,
IReadOnlyCollection<string> workloadIds = null)
IReadOnlyCollection<string> workloadIds = null,
bool? skipWorkloadManifestUpdate = null)
: base(parseResult, reporter: reporter, workloadResolverFactory: workloadResolverFactory, workloadInstaller: workloadInstaller,
nugetPackageDownloader: nugetPackageDownloader, workloadManifestUpdater: workloadManifestUpdater,
tempDirPath: tempDirPath)
{
_skipManifestUpdate = parseResult.GetValue(WorkloadInstallCommandParser.SkipManifestUpdateOption);
_skipManifestUpdate = skipWorkloadManifestUpdate ?? parseResult.GetValue(WorkloadInstallCommandParser.SkipManifestUpdateOption);
_workloadIds = workloadIds ?? parseResult.GetValue(WorkloadInstallCommandParser.WorkloadIdArgument).ToList().AsReadOnly();
var resolvedReporter = _printDownloadLinkOnly ? NullReporter.Instance : Reporter;

Expand Down Expand Up @@ -126,91 +127,22 @@ public override int Execute()
}
else
{
WorkloadHistoryRecorder recorder = new WorkloadHistoryRecorder(_workloadResolver, _workloadInstaller, () => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, null));
recorder.HistoryRecord.CommandName = IsRunningRestore ? "restore" : "install";

try
{
recorder.Run(() =>
if (!IsRunningRestore)
{
// Normally we want to validate that the workload IDs specified were valid. However, if there is a global.json file with a workload
// set version specified, and we might install that workload version, then we don't do that check here, because we might not have the right
// workload set installed yet, and trying to list the available workloads would throw an error
if (_skipManifestUpdate || string.IsNullOrEmpty(_workloadSetVersionFromGlobalJson))
{
ValidateWorkloadIdsInput();
}
WorkloadHistoryRecorder recorder = new(_workloadResolver, _workloadInstaller, () => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, null));
recorder.HistoryRecord.CommandName = "install";

Reporter.WriteLine();

DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption);

if (!_skipManifestUpdate)
recorder.Run(() =>
{
var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json");
if (string.IsNullOrWhiteSpace(_fromRollbackDefinition) &&
!SpecifiedWorkloadSetVersionOnCommandLine &&
!SpecifiedWorkloadSetVersionInGlobalJson &&
InstallStateContents.FromPath(installStateFilePath) is InstallStateContents installState &&
(installState.Manifests != null || installState.WorkloadVersion != null))
{
// If the workload version is pinned in the install state, then we don't want to automatically update workloads when a workload is installed
// To update to a new version, the user would need to run "dotnet workload update"
_skipManifestUpdate = true;
}
}

RunInNewTransaction(context =>
{
if (!_skipManifestUpdate)
{
if (Verbosity != VerbosityOptions.quiet && Verbosity != VerbosityOptions.q)
{
Reporter.WriteLine(LocalizableStrings.CheckForUpdatedWorkloadManifests);
}
UpdateWorkloadManifests(recorder, context, offlineCache);
}

// Add workload Ids that already exist to our collection to later trigger an update in those installed workloads
var workloadIds = _workloadIds.Select(id => new WorkloadId(id));
var installedWorkloads = _workloadInstaller.GetWorkloadInstallationRecordRepository().GetInstalledWorkloads(_sdkFeatureBand);
var previouslyInstalledWorkloads = installedWorkloads.Intersect(workloadIds);
if (previouslyInstalledWorkloads.Any())
{
Reporter.WriteLine(string.Format(LocalizableStrings.WorkloadAlreadyInstalled, string.Join(" ", previouslyInstalledWorkloads)).Yellow());
}
workloadIds = workloadIds.Concat(installedWorkloads).Distinct();
workloadIds = WriteSDKInstallRecordsForVSWorkloads(workloadIds);

_workloadInstaller.InstallWorkloads(workloadIds, _sdkFeatureBand, context, offlineCache);

// Write workload installation records
var recordRepo = _workloadInstaller.GetWorkloadInstallationRecordRepository();
var newWorkloadInstallRecords = workloadIds.Except(recordRepo.GetInstalledWorkloads(_sdkFeatureBand));
context.Run(
action: () =>
{
foreach (var workloadId in newWorkloadInstallRecords)
{
recordRepo.WriteWorkloadInstallationRecord(workloadId, _sdkFeatureBand);
}
},
rollback: () =>
{
foreach (var workloadId in newWorkloadInstallRecords)
{
recordRepo.DeleteWorkloadInstallationRecord(workloadId, _sdkFeatureBand);
}
});

TryRunGarbageCollection(_workloadInstaller, Reporter, Verbosity, workloadSetVersion => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, workloadSetVersion), offlineCache);

Reporter.WriteLine();
Reporter.WriteLine(string.Format(LocalizableStrings.InstallationSucceeded, string.Join(" ", newWorkloadInstallRecords)));
Reporter.WriteLine();

InstallWorkloads(recorder);
});
});
}
else
{
InstallWorkloads(null);
}
}
catch (Exception e)
{
Expand All @@ -225,6 +157,87 @@ public override int Execute()
return _workloadInstaller.ExitCode;
}

private void InstallWorkloads(WorkloadHistoryRecorder recorder)
{
// Normally we want to validate that the workload IDs specified were valid. However, if there is a global.json file with a workload
// set version specified, and we might install that workload version, then we don't do that check here, because we might not have the right
// workload set installed yet, and trying to list the available workloads would throw an error
if (_skipManifestUpdate || string.IsNullOrEmpty(_workloadSetVersionFromGlobalJson))
{
ValidateWorkloadIdsInput();
}

Reporter.WriteLine();

DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption);

if (!_skipManifestUpdate)
{
var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json");
if (string.IsNullOrWhiteSpace(_fromRollbackDefinition) &&
!SpecifiedWorkloadSetVersionOnCommandLine &&
!SpecifiedWorkloadSetVersionInGlobalJson &&
InstallStateContents.FromPath(installStateFilePath) is InstallStateContents installState &&
(installState.Manifests != null || installState.WorkloadVersion != null))
{
// If the workload version is pinned in the install state, then we don't want to automatically update workloads when a workload is installed
// To update to a new version, the user would need to run "dotnet workload update"
_skipManifestUpdate = true;
}
}

RunInNewTransaction(context =>
{
if (!_skipManifestUpdate)
{
if (Verbosity != VerbosityOptions.quiet && Verbosity != VerbosityOptions.q)
{
Reporter.WriteLine(LocalizableStrings.CheckForUpdatedWorkloadManifests);
}
UpdateWorkloadManifests(recorder, context, offlineCache);
}

// Add workload Ids that already exist to our collection to later trigger an update in those installed workloads
var workloadIds = _workloadIds.Select(id => new WorkloadId(id));
var installedWorkloads = _workloadInstaller.GetWorkloadInstallationRecordRepository().GetInstalledWorkloads(_sdkFeatureBand);
var previouslyInstalledWorkloads = installedWorkloads.Intersect(workloadIds);
if (previouslyInstalledWorkloads.Any())
{
Reporter.WriteLine(string.Format(LocalizableStrings.WorkloadAlreadyInstalled, string.Join(" ", previouslyInstalledWorkloads)).Yellow());
}
workloadIds = workloadIds.Concat(installedWorkloads).Distinct();
workloadIds = WriteSDKInstallRecordsForVSWorkloads(workloadIds);

_workloadInstaller.InstallWorkloads(workloadIds, _sdkFeatureBand, context, offlineCache);

// Write workload installation records
var recordRepo = _workloadInstaller.GetWorkloadInstallationRecordRepository();
var newWorkloadInstallRecords = workloadIds.Except(recordRepo.GetInstalledWorkloads(_sdkFeatureBand));
context.Run(
action: () =>
{
foreach (var workloadId in newWorkloadInstallRecords)
{
recordRepo.WriteWorkloadInstallationRecord(workloadId, _sdkFeatureBand);
}
},
rollback: () =>
{
foreach (var workloadId in newWorkloadInstallRecords)
{
recordRepo.DeleteWorkloadInstallationRecord(workloadId, _sdkFeatureBand);
}
});

TryRunGarbageCollection(_workloadInstaller, Reporter, Verbosity, workloadSetVersion => _workloadResolverFactory.CreateForWorkloadSet(_dotnetPath, _sdkVersion.ToString(), _userProfileDir, workloadSetVersion), offlineCache);

Reporter.WriteLine();
Reporter.WriteLine(string.Format(LocalizableStrings.InstallationSucceeded, string.Join(" ", newWorkloadInstallRecords)));
Reporter.WriteLine();

});
}

internal static void TryRunGarbageCollection(IInstaller workloadInstaller, IReporter reporter, VerbosityOptions verbosity, Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using Microsoft.Build.Execution;
using Microsoft.Build.Logging;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.NuGetPackageDownloader;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Workloads.Workload.Install;
using Microsoft.DotNet.Workloads.Workload.Update;
using Microsoft.Extensions.EnvironmentAbstractions;
using Microsoft.NET.Sdk.WorkloadManifestReader;

Expand All @@ -31,15 +33,38 @@ public WorkloadRestoreCommand(

public override int Execute()
{
var allProjects = DiscoverAllProjects(Directory.GetCurrentDirectory(), _slnOrProjectArgument).Distinct();
List<WorkloadId> allWorkloadId = RunTargetToGetWorkloadIds(allProjects);
Reporter.WriteLine(string.Format(LocalizableStrings.InstallingWorkloads, string.Join(" ", allWorkloadId)));
var workloadResolverFactory = new WorkloadResolverFactory();
var creationResult = workloadResolverFactory.Create();
var workloadInstaller = WorkloadInstallerFactory.GetWorkloadInstaller(NullReporter.Instance, new SdkFeatureBand(creationResult.SdkVersion),
creationResult.WorkloadResolver, Verbosity, creationResult.UserProfileDir, VerifySignatures, PackageDownloader,
creationResult.DotnetPath, TempDirectoryPath, null, RestoreActionConfiguration, elevationRequired: true);
var recorder = new WorkloadHistoryRecorder(
creationResult.WorkloadResolver,
workloadInstaller,
() => workloadResolverFactory.CreateForWorkloadSet(
creationResult.DotnetPath,
creationResult.SdkVersion.ToString(),
creationResult.UserProfileDir,
null));
recorder.HistoryRecord.CommandName = "restore";

recorder.Run(() =>
{
// First update manifests and install a workload set as necessary
new WorkloadUpdateCommand(_result, recorder: recorder).Execute();

var workloadInstallCommand = new WorkloadInstallCommand(_result,
workloadIds: allWorkloadId.Select(a => a.ToString()).ToList().AsReadOnly());
workloadInstallCommand.IsRunningRestore = true;
var allProjects = DiscoverAllProjects(Directory.GetCurrentDirectory(), _slnOrProjectArgument).Distinct();
List<WorkloadId> allWorkloadId = RunTargetToGetWorkloadIds(allProjects);
Reporter.WriteLine(string.Format(LocalizableStrings.InstallingWorkloads, string.Join(" ", allWorkloadId)));

workloadInstallCommand.Execute();
new WorkloadInstallCommand(_result,
workloadIds: allWorkloadId.Select(a => a.ToString()).ToList().AsReadOnly(),
skipWorkloadManifestUpdate: true)
{
IsRunningRestore = true
}.Execute();
});

return 0;
}

Expand Down
Loading
Loading