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 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
Copy link
Member

Choose a reason for hiding this comment

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

Does the script work as is for local helix execution or are changes needed to the instructions here: https://github.com/dotnet/sdk/blob/main/documentation/project-docs/repro-helix-failure.md

We don't do this often but that means it's fragile to changes if we're not careful.

Copy link
Member Author

@jjonescz jjonescz Aug 27, 2024

Choose a reason for hiding this comment

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

Didn't know about this doc, thanks.

I've followed the instructions and they seem to work, in particular the nuget source is added correctly:

C:\temp\helix\payload-dir>if exist C:\Users\janjones\AppData\Local\Temp\dotnetSdkTests\jxi5tacr.5hi\Testpackages dotnet nuget add source C:\Users\janjones\AppData\Local\Temp\dotnetSdkTests\jxi5tacr.5hi\Testpackages --name testpackages --configfile C:\Users\janjones\AppData\Local\Temp\dotnetSdkTests\jxi5tacr.5hi\nuget.config
Package source with Name: testpackages added successfully.


dotnet nuget remove source dotnet6-transport --configfile %TestExecutionDirectory%\nuget.config
dotnet nuget remove source dotnet6-internal-transport --configfile %TestExecutionDirectory%\nuget.config
Expand Down
Copy link
Member Author

@jjonescz jjonescz Aug 27, 2024

Choose a reason for hiding this comment

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

btw, this PR is targeting branch release/9.0.1xx, let me know if that's not correct

Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup Condition="'$(BuildWithNetFrameworkHostedCompiler)' == 'true' and '$(OS)' == 'Windows_NT'">
<RoslynTargetsPath>$(NuGetPackageRoot)\microsoft.net.sdk.compilers.toolset\$(NETCoreSdkVersion)</RoslynTargetsPath>
<_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage>true</_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage>
<!-- Workaround for https://github.com/dotnet/sdk/issues/43016. -->
<_SkipCheckMicrosoftNetSdkCompilersToolsetPackageExists Condition="'$(NuGetPackageRoot)' == ''">true</_SkipCheckMicrosoftNetSdkCompilersToolsetPackageExists>
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment/link to the issues/discussions that triggered this check? I expect future-us to forget and having some record of why this was necessary would be helpful.

</PropertyGroup>

<!-- NOTE: Keep in sync with https://github.com/dotnet/msbuild/blob/main/src/Tasks/Microsoft.Common.tasks -->
Expand All @@ -254,7 +256,7 @@ Copyright (c) .NET Foundation. All rights reserved.
</Target>

<Target Name="_CheckMicrosoftNetSdkCompilersToolsetPackageExists"
Condition="'$(_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage)' == 'true' and '$(DesignTimeBuild)' != 'true'"
Condition="'$(_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage)' == 'true' and '$(DesignTimeBuild)' != 'true' and '$(_SkipCheckMicrosoftNetSdkCompilersToolsetPackageExists)' != 'true'"
BeforeTargets="CoreCompile">
<!-- If users did not run restore or it failed to download the Microsoft.Net.Sdk.Compilers.Toolset package
(but they proceeded to build, e.g., in Visual Studio), display an error with suggestions how to fix the problem. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public void It_downloads_Microsoft_Net_Compilers_Toolset_Framework_when_MSBuild_

testAsset.GetRestoreCommand(Log, relativePath: testProjectName)
.WithEnvironmentVariable("NUGET_PACKAGES", customPackagesDir)
.WithEnvironmentVariable("BuildWithNetFrameworkHostedCompiler", "")
.Execute().Should().Pass();

var toolsetPackageDir = Path.Combine(customPackagesDir, "microsoft.net.sdk.compilers.toolset");
Expand All @@ -77,7 +76,6 @@ public void It_downloads_Microsoft_Net_Compilers_Toolset_Framework_when_MSBuild_

new BuildCommand(testAsset)
.WithEnvironmentVariable("NUGET_PACKAGES", customPackagesDir)
.WithEnvironmentVariable("BuildWithNetFrameworkHostedCompiler", "")
.Execute().Should().Pass().And
.HaveStdOutContaining(Path.Combine(toolsetPackageDir, toolsetPackageVersion, "csc.exe") + " /noconfig");
}
Expand Down