Skip to content
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 NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-dotnet -->
<add key="darc-pub-dotnet-dotnet-f009a93" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-f009a930/nuget/v3/index.json" />
<add key="darc-pub-dotnet-dotnet-60018d8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-60018d88/nuget/v3/index.json" />
<add key="darc-int-dotnet-dotnet-f7d9079" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-dotnet-f7d90799/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-dotnet -->
<!-- Begin: Package sources from microsoft-testfx -->
Expand Down
8 changes: 8 additions & 0 deletions build/RunTestsOnHelix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ export PATH=$DOTNET_ROOT:$PATH

export TestExecutionDirectory=$(realpath "$(mktemp -d "${TMPDIR:-/tmp}"/dotnetSdkTests.XXXXXXXX)")

# Helix Linux work items have no systemd-logind session, so /run/user/<uid> does not exist and the dotnet CLI
# cannot create the vstest artifacts directory there. Use a directory inside the work item instead.
if [ "$(uname -s)" = "Linux" ] && [ ! -d "/run/user/$(id -u)" ]; then
export VSTEST_ARTIFACTS_BASE_DIRECTORY="$TestExecutionDirectory/vstest-artifacts"
mkdir -p "$VSTEST_ARTIFACTS_BASE_DIRECTORY"
chmod 0700 "$VSTEST_ARTIFACTS_BASE_DIRECTORY"
fi

# Azure Linux 3 is missing zlib-devel, so the linker can't find -lz for NativeAOT.
# Create a symlink in a local directory and add it to LIBRARY_PATH so clang/ld finds it.
if [ -f /etc/azurelinux-release ]; then
Expand Down
270 changes: 135 additions & 135 deletions eng/Version.Details.props

Large diffs are not rendered by default.

548 changes: 274 additions & 274 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<VersionMajor>10</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionSDKMinor>4</VersionSDKMinor>
<VersionSDKMinorPatch>3</VersionSDKMinorPatch>
<VersionSDKMinorPatch>5</VersionSDKMinorPatch>
<VersionFeature>$([System.String]::Copy('$(VersionSDKMinorPatch)').PadLeft(2, '0'))</VersionFeature>
<!-- This property powers the SdkAnalysisLevel property in end-user MSBuild code.
It should always be the hundreds-value of the current SDK version, never any
Expand Down
2 changes: 1 addition & 1 deletion eng/common/core-templates/job/onelocbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
outputVariableName: 'GitHubAppInstallationToken'
condition: ${{ parameters.condition }}

- task: OneLocBuild@2
- task: OneLocBuild@3
displayName: OneLocBuild
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Expand Down
4 changes: 2 additions & 2 deletions eng/common/core-templates/job/publish-build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ jobs:
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
is1ESPipeline: ${{ parameters.is1ESPipeline }}

# Darc is targeting 8.0, so make sure it's installed
# Darc is targeting 10.0, so make sure it's installed
- task: UseDotNet@2
inputs:
version: 8.0.x
version: 10.0.x

- task: AzureCLI@2
displayName: Publish Using Darc
Expand Down
4 changes: 2 additions & 2 deletions eng/common/core-templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ stages:

- template: /eng/common/templates/steps/enable-internal-runtimes.yml

# Darc is targeting 8.0, so make sure it's installed
# Darc is targeting 10.0, so make sure it's installed
- task: UseDotNet@2
inputs:
version: 8.0.x
version: 10.0.x

- task: AzureCLI@2
displayName: Publish Using Darc
Expand Down
5 changes: 3 additions & 2 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
[bool]$warnAsError = if (Test-Path variable:warnAsError) { $warnAsError } else { $true }

# Specifies semi-colon delimited list of warning codes that should not be treated as errors.
[string]$warnNotAsError = if (Test-Path variable:warnNotAsError) { $warnNotAsError } else { '' }
# Defaults to NuGet Audit warning codes NU1901-NU1904.
[string]$warnNotAsError = if ((Test-Path variable:warnNotAsError) -and $warnNotAsError) { $warnNotAsError } else { 'NU1901;NU1902;NU1903;NU1904' }

# Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json).
[string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null }
Expand Down Expand Up @@ -517,7 +518,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
})

if (!(Test-Path $packagePath)) {
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1074/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild"
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1857/Operations/FR/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild"
throw
}
Unzip $packagePath $packageDir
Expand Down
3 changes: 2 additions & 1 deletion eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ fi
warn_as_error=${warn_as_error:-true}

# Specifies semi-colon delimited list of warning codes that should not be treated as errors.
warn_not_as_error=${warn_not_as_error:-''}
# Defaults to NuGet Audit warning codes NU1901-NU1904.
warn_not_as_error="${warn_not_as_error:-NU1901;NU1902;NU1903;NU1904}"

# True to attempt using .NET Core already that meets requirements specified in global.json
# installed on the machine instead of downloading one.
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"$host$"
],
"errorMessage": "The .NET SDK is not installed or is not configured correctly. Please run ./build to install the correct SDK version locally.",
"version": "10.0.401"
"version": "10.0.404"
},
"tools": {
"dotnet": "10.0.401",
"dotnet": "10.0.404",
"runtimes": {
"dotnet": [
"$(MicrosoftNETCorePlatformsPackageVersion)"
Expand All @@ -22,8 +22,8 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26512.108",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26512.108",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26566.127",
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26566.127",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.WixToolset.Sdk": "6.0.3-dotnet.6"
Expand Down
7 changes: 6 additions & 1 deletion src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ public override int Execute()
try
{
// Set environment variables.
foreach (var (key, value) in MSBuildForwardingAppWithoutLogging.GetMSBuildRequiredEnvironmentVariables())
Dictionary<string, string?> environmentVariables = MSBuildForwardingAppWithoutLogging.GetMSBuildRequiredEnvironmentVariables();
if (!NoRestore && !evalOnly)
{
NuGetSignatureVerificationEnabler.ConditionallyEnable(environmentVariables);
}
foreach (var (key, value) in environmentVariables)
{
savedEnvironmentVariables[key] = Environment.GetEnvironmentVariable(key);
Environment.SetEnvironmentVariable(key, value);
Expand Down
63 changes: 43 additions & 20 deletions src/Cli/dotnet/Commands/Test/VSTest/TestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ public static int Run(ParseResult parseResult)
// When we have settings, we want to exclude the '--' as it doesn't end up in unmatched tokens, so we pass settings.Length - 1
if (ContainsBuiltTestSources(parseResult, GetSettingsCount(settings)))
{
return ForwardToVSTestConsole(parseResult, args, settings, testSessionCorrelationId);
int exitCode = ForwardToVSTestConsole(parseResult, args, settings, testSessionCorrelationId);

// Reached only when the invocation completed, whether the tests passed or failed. An invocation that
// throws or is interrupted deliberately leaves the artifacts on disk for diagnosis.
VSTestArtifactsDirectory.Delete();
return exitCode;
}

return ForwardToMsbuild(parseResult, settings, testSessionCorrelationId);
int msbuildExitCode = ForwardToMsbuild(parseResult, settings, testSessionCorrelationId);

VSTestArtifactsDirectory.Delete();
return msbuildExitCode;
}

internal /*internal for testing*/ static (string[] Args, string[] Settings) SeparateSettingsFromArgs(string[] args)
Expand Down Expand Up @@ -272,6 +280,15 @@ private static TestCommand FromParseResult(ParseResult result, string[] settings
VSTestTrace.SafeWriteTrace(() => $"Root variable set {rootVariableName}:{rootValue}");
}

// vstest.console is started by the VSTest MSBuild task in this code path rather than by the SDK, so the
// artifacts directory is set on the MSBuild process and inherited from there. The variable is not one
// MSBuild itself acts on, so this has no effect on the build.
if (VSTestArtifactsDirectory.GetOrCreate() is { } artifactsDirectory)
{
testCommand.EnvironmentVariable(VSTestArtifactsDirectory.EnvironmentVariableName, artifactsDirectory);
VSTestTrace.SafeWriteTrace(() => $"Artifacts directory variable set {VSTestArtifactsDirectory.EnvironmentVariableName}:{artifactsDirectory}");
}

VSTestTrace.SafeWriteTrace(() => $"Starting test using MSBuild with arguments '{testCommand.GetArgumentsToMSBuild()}' custom MSBuild path '{msbuildPath}' norestore '{noRestore}'");
return testCommand;
}
Expand All @@ -283,9 +300,9 @@ internal static int RunArtifactPostProcessingIfNeeded(string testSessionCorrelat
return 0;
}

// VSTest runner will save artifacts inside a temp folder if needed.
string expectedArtifactDirectory = Path.Combine(Path.GetTempPath(), testSessionCorrelationId);
if (!Directory.Exists(expectedArtifactDirectory))
// vstest.console saves the artifacts of the session in a subdirectory of the artifacts directory the SDK
// gave it, named after the correlation id. Its absence means the session produced nothing to process.
if (!TryFindArtifactDirectory(testSessionCorrelationId, out string? expectedArtifactDirectory))
{
VSTestTrace.SafeWriteTrace(() => "No artifact found, post-processing won't run.");
return 0;
Expand All @@ -300,25 +317,31 @@ internal static int RunArtifactPostProcessingIfNeeded(string testSessionCorrelat
artifactsPostProcessArgs.Add($"--diag:{diag}");
}

try
{
return new VSTestForwardingApp(artifactsPostProcessArgs).Execute();
}
finally
// The post-processing run receives the same artifacts directory as the collecting run did, so it resolves
// the same session subdirectory. The whole directory is removed once the invocation completes, so there is
// nothing to clean up here.
return new VSTestForwardingApp(artifactsPostProcessArgs).Execute();
}

/// <summary>
/// Locates the subdirectory vstest.console saved the artifacts of the session in. Returns
/// <see langword="false"/> when the artifacts directory was never created, which is the case when no
/// vstest.console was started at all.
/// </summary>
internal /*internal for testing*/ static bool TryFindArtifactDirectory(string testSessionCorrelationId, [NotNullWhen(true)] out string? artifactDirectory)
{
if (VSTestArtifactsDirectory.Current is { } artifactsDirectory)
{
if (Directory.Exists(expectedArtifactDirectory))
string candidate = Path.Combine(artifactsDirectory, testSessionCorrelationId);
if (Directory.Exists(candidate))
{
VSTestTrace.SafeWriteTrace(() => $"Cleaning artifact directory '{expectedArtifactDirectory}'.");
try
{
Directory.Delete(expectedArtifactDirectory, true);
}
catch (Exception ex)
{
VSTestTrace.SafeWriteTrace(() => $"Exception during artifact cleanup: \n{ex}");
}
artifactDirectory = candidate;
return true;
}
}

artifactDirectory = null;
return false;
}

internal /*internal for testing*/ static bool ContainsBuiltTestSources(ParseResult parseResult, int settingsLength)
Expand Down
Loading
Loading