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
18 changes: 18 additions & 0 deletions eng/build-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,21 @@ function Unsubst-TempDir() {
$env:TMP=$originalTemp
}
}

function EnablePreviewSdks() {
$vsInfo = LocateVisualStudio
if ($vsInfo -eq $null) {
# Preview SDKs are allowed when no Visual Studio instance is installed
Write-Host "No Visual Studio installation found; skipping enabling preview SDKs"
return
}

$vsId = $vsInfo.instanceId
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]

$instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId"
Create-Directory $instanceDir
$sdkFile = Join-Path $instanceDir "sdk.txt"
Write-Host "Enabling preview SDKs by writing to $sdkFile"
'UsePreviews=True' | Set-Content $sdkFile
}
16 changes: 0 additions & 16 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -541,22 +541,6 @@ function TestUsingRunTests() {
}
}

function EnablePreviewSdks() {
$vsInfo = LocateVisualStudio
if ($vsInfo -eq $null) {
# Preview SDKs are allowed when no Visual Studio instance is installed
return
}

$vsId = $vsInfo.instanceId
$vsMajorVersion = $vsInfo.installationVersion.Split('.')[0]

$instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId"
Create-Directory $instanceDir
$sdkFile = Join-Path $instanceDir "sdk.txt"
'UsePreviews=True' | Set-Content $sdkFile
}

# Deploy our core VSIX libraries to Visual Studio via the Roslyn VSIX tool. This is an alternative to
# deploying at build time.
function Deploy-VsixViaTool() {
Expand Down
6 changes: 6 additions & 0 deletions eng/enable-preview-sdks.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"

. (Join-Path $PSScriptRoot "build-utils.ps1")

EnablePreviewSdks
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected static ProcessResult RunCommandLineCompiler(
/// <param name="overrideToolExe">
/// Setting ToolExe to "csc.exe" should use the built-in compiler regardless of apphost being used or not.
/// </param>
[Theory(Skip = "https://github.com/dotnet/roslyn/issues/80991"), CombinatorialData]
[Theory, CombinatorialData]
[WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2615118")]
public void SdkBuild_Csc(bool useSharedCompilation, bool overrideToolExe, bool useAppHost)
{
Expand Down Expand Up @@ -195,7 +195,7 @@ class Program { static void Main() { System.Console.WriteLine("Hello from file")
/// <param name="overrideToolExe">
/// Setting ToolExe to "vbc.exe" should use the built-in compiler regardless of apphost being used or not.
/// </param>
[Theory(Skip = "https://github.com/dotnet/roslyn/issues/80991"), CombinatorialData]
[Theory, CombinatorialData]
[WorkItem("https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2615118")]
public void SdkBuild_Vbc(bool useSharedCompilation, bool overrideToolExe, bool useAppHost)
{
Expand Down
9 changes: 9 additions & 0 deletions src/Tools/Source/RunTests/HelixTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ static void AppendHelixWorkItemProject(
Path.Combine(workItemPayloadDir, rspFileName),
GetRspFileContent(assemblyRelativeFilePaths, helixWorkItem.TestMethodNames, platform));

Directory.CreateSymbolicLink(
path: Path.Combine(workItemPayloadDir, "eng"),
pathToTarget: Path.Combine(artifactsDir, "..", "eng"));
File.CreateSymbolicLink(
path: Path.Combine(workItemPayloadDir, "global.json"),
pathToTarget: Path.Combine(artifactsDir, "..", "global.json"));

var (commandFileName, commandContent) = GetHelixCommandContent(assemblyRelativeFilePaths, rspFileName, testOS);
File.WriteAllText(Path.Combine(workItemPayloadDir, commandFileName), commandContent);

Expand Down Expand Up @@ -283,6 +290,8 @@ static void AppendHelixWorkItemProject(

command.AppendLine(isUnix ? "env | sort" : "set");

command.AppendLine("powershell -ExecutionPolicy ByPass -NoProfile -File ./eng/enable-preview-sdks.ps1");

// Rehydrate assemblies that we need to run as part of this work item.
foreach (var assemblyRelativeFilePath in assemblyRelativeFilePaths)
{
Expand Down
Loading