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

Bump SdkVersionForWorkloadTesting to use a 200 band SDK #63450

Merged
merged 3 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<SdkVersionForWorkloadTesting>6.0.100-rtm.21480.21</SdkVersionForWorkloadTesting>
<SdkVersionForWorkloadTesting>6.0.200-preview.22055.18</SdkVersionForWorkloadTesting>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>6.0.0-preview-20211019.1</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
Expand Down
13 changes: 10 additions & 3 deletions src/libraries/workloads-testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@
<MakeDir Directories="$(SdkWithNoWorkloadForTestingPath)" />

<PropertyGroup>
<_DotNetInstallScriptPath Condition="!$([MSBuild]::IsOSPlatform('windows'))">$(DOTNET_INSTALL_DIR)/dotnet-install.sh</_DotNetInstallScriptPath>
<_DotNetInstallScriptPath Condition=" $([MSBuild]::IsOSPlatform('windows'))">$(RepoRoot).dotnet\dotnet-install.ps1</_DotNetInstallScriptPath>
</PropertyGroup>
<_DotNetInstallScriptName Condition="!$([MSBuild]::IsOSPlatform('windows'))">dotnet-install.sh</_DotNetInstallScriptName>
<_DotNetInstallScriptName Condition=" $([MSBuild]::IsOSPlatform('windows'))">dotnet-install.ps1</_DotNetInstallScriptName>

<_DotNetInstallScriptPath>$(ArtifactsObjDir)$(_DotNetInstallScriptName)</_DotNetInstallScriptPath>
</PropertyGroup>

<DownloadFile SourceUrl="https://dot.net/v1/$(_DotNetInstallScriptName)"
DestinationFolder="$(ArtifactsObjDir)"
Retries="3"
Condition="!Exists($(_DotNetInstallScriptPath))"/>

<Exec Condition="!$([MSBuild]::IsOSPlatform('windows'))"
Command="chmod +x $(_DotNetInstallScriptPath); $(_DotNetInstallScriptPath) -i $(SdkWithNoWorkloadForTestingPath) -v $(SdkVersionForWorkloadTesting)" />
Expand Down
12 changes: 10 additions & 2 deletions src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public override bool Execute()

private bool InstallWorkloadManifest(string name, string version, string nugetConfigContents, bool stopOnMissing)
{
Log.LogMessage(MessageImportance.High, $"Installing workload manifest for {name}/{version}");
Log.LogMessage(MessageImportance.High, $"Installing workload manifest for {name}/{version} for sdk band {VersionBand}");

// Find any existing directory with the manifest name, ignoring the case
// Multiple directories for a manifest, differing only in case causes
Expand Down Expand Up @@ -145,7 +145,15 @@ private bool InstallWorkloadManifest(string name, string version, string nugetCo
{
if (!InstallWorkloadManifest(depName, depVersion, nugetConfigContents, stopOnMissing: false))
{
Log.LogWarning($"Could not install manifest {depName}/{depVersion}. This can be ignored if the workload {WorkloadId.ItemSpec} doesn't depend on it.");
Log.LogMessage(MessageImportance.High,
$" ***** warning ******{Environment.NewLine}" +
Environment.NewLine +
$"Could not install a dependent manifest {depName}/{depVersion} for sdk band {VersionBand}.{Environment.NewLine}" +
$"If this is because this manifest doesn't have a package for sdk band {VersionBand}, " +
$"then the workload resolver will automatically fallback to the older one, and this message can be ignored.{Environment.NewLine}" +
$"This can also be safely ignored if the workload {WorkloadId.ItemSpec} doesn't use the dependency.{Environment.NewLine}" +
Environment.NewLine +
$" ********************{Environment.NewLine}");
continue;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/tasks/WorkloadBuildTasks/PackageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private bool InstallActual(PackageReference[] references, bool stopOnMissing)
(int exitCode, string output) = Utils.TryRunProcess(_logger, "dotnet", args, silent: false, debugMessageImportance: MessageImportance.Low);
if (exitCode != 0)
{
LogErrorOrWarning($"Restoring packages failed with exit code: {exitCode}. Output:{Environment.NewLine}{output}", stopOnMissing);
LogFailure($"Restoring packages failed with exit code: {exitCode}. Output:{Environment.NewLine}{output}", stopOnMissing);
return false;
}

Expand All @@ -76,7 +76,7 @@ private bool InstallActual(PackageReference[] references, bool stopOnMissing)
{
_logger.LogMessage(MessageImportance.Normal, output);
foreach ((PackageReference pkgRef, string pkgDir) in failedToRestore)
LogErrorOrWarning($"Could not restore {pkgRef.Name}/{pkgRef.Version} (can't find {pkgDir})", stopOnMissing);
LogFailure($"Could not restore {pkgRef.Name}/{pkgRef.Version} (can't find {pkgDir})", stopOnMissing);

return false;
}
Expand All @@ -91,7 +91,7 @@ private bool LayoutPackages(IEnumerable<PackageReference> references, bool stopO
var source = Path.Combine(_packagesDir, pkgRef.Name.ToLower(), pkgRef.Version, pkgRef.relativeSourceDir);
if (!Directory.Exists(source))
{
LogErrorOrWarning($"Failed to restore {pkgRef.Name}/{pkgRef.Version} (could not find {source})", stopOnMissing);
LogFailure($"Failed to restore {pkgRef.Name}/{pkgRef.Version} (could not find {source})", stopOnMissing);
if (stopOnMissing)
return false;
}
Expand Down Expand Up @@ -152,12 +152,12 @@ private bool CopyDirectoryAfresh(string srcDir, string destDir)
}
}

private void LogErrorOrWarning(string msg, bool stopOnMissing)
private void LogFailure(string msg, bool asError)
{
if (stopOnMissing)
if (asError)
_logger.LogError(msg);
else
_logger.LogWarning(msg);
_logger.LogMessage(MessageImportance.High, $"warning: {msg}");
}
}
}