Skip to content

Commit aac62da

Browse files
authored
Re-enable MacOS Arm64 PR runs (#46243)
2 parents feb621b + 57cf333 commit aac62da

File tree

37 files changed

+350
-109
lines changed

37 files changed

+350
-109
lines changed

.vsts-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ parameters:
1818
- name: enableArm64Job
1919
displayName: Enables the ARM64 job
2020
type: boolean
21-
default: false
21+
default: true
2222

2323
variables:
2424
- template: /eng/pipelines/templates/variables/sdk-defaults.yml

test/EndToEnd.Tests/GivenDotNetUsesMSBuild.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public void ItCanNewRestoreBuildRunCleanMSBuildProject()
4141
binDirectory.Should().NotHaveFilesMatching("*.dll", SearchOption.AllDirectories);
4242
}
4343

44-
[RequiresMSBuildVersionFact("16.8.0")]
44+
// https://github.com/dotnet/sdk/issues/49665
45+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
4546
public void ItCanRunToolsInACSProj()
4647
{
4748
var testInstance = _testAssetsManager.CopyTestAsset("MSBuildTestApp")
@@ -73,7 +74,9 @@ public void ItCanRunToolsInACSProj()
7374
.And.HaveStdOutContaining("Hello Portable World!");
7475
}
7576

76-
[RequiresMSBuildVersionFact("16.8.0")]
77+
// https://github.com/dotnet/sdk/issues/49665
78+
// Failed to load /private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/A452091E/p/d/shared/Microsoft.NETCore.App/9.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
79+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
7780
public void ItCanRunToolsThatPrefersTheCliRuntimeEvenWhenTheToolItselfDeclaresADifferentRuntime()
7881
{
7982
var testInstance = _testAssetsManager.CopyTestAsset("MSBuildTestApp")

test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public void InstallAndRunToolGlobal()
4545
.And.HaveStdOutContaining("Hello Tool!");
4646
}
4747

48-
[Fact]
48+
// https://github.com/dotnet/sdk/issues/49665
49+
// The tool does not support the current architecture or operating system (osx-arm64). Supported runtimes: win-x64 win-x86 osx-x64 linux-x64 linux-musl-x64
50+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
4951
public void InstallAndRunNativeAotGlobalTool()
5052
{
5153
var toolSettings = new TestToolBuilder.TestToolSettings()
@@ -105,7 +107,9 @@ public void InstallAndRunToolLocal()
105107
.And.HaveStdOutContaining("Hello Tool!");
106108
}
107109

108-
[Fact]
110+
// https://github.com/dotnet/sdk/issues/49665
111+
// The tool does not support the current architecture or operating system (osx-arm64). Supported runtimes: win-x64 win-x86 osx-x64 linux-x64 linux-musl-x64
112+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
109113
public void InstallAndRunNativeAotLocalTool()
110114
{
111115
var toolSettings = new TestToolBuilder.TestToolSettings()

test/Microsoft.NET.Build.Tests/DesignTimeBuildTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public void DesignTimeBuildSucceedsAfterRuntimeIdentifierIsChanged()
7676
}
7777

7878
// Regression test for https://github.com/dotnet/sdk/issues/13513
79-
[Fact]
79+
// https://github.com/dotnet/sdk/issues/49665
80+
// error : NETSDK1056: Project is targeting runtime 'osx-arm64' but did not resolve any runtime-specific packages. This runtime may not be supported by the target framework.
81+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
8082
public void DesignTimeBuildSucceedsWhenTargetingNetCore21WithRuntimeIdentifier()
8183
{
8284
var testProject = new TestProject()

test/Microsoft.NET.Build.Tests/GivenFrameworkReferences.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_mult
7373
[InlineData(ToolsetInfo.CurrentTargetFramework, true)]
7474
public void Multiple_frameworks_are_written_to_runtimeconfig_for_self_contained_apps(string tfm, bool shouldHaveIncludedFrameworks)
7575
{
76+
if (tfm == "netcoreapp3.0" &&
77+
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
78+
{
79+
// https://github.com/dotnet/sdk/issues/49665
80+
// error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'osx-arm64'.
81+
return;
82+
}
83+
7684
var testProject = new TestProject()
7785
{
7886
Name = "MultipleFrameworkReferenceTest",

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ public void It_restores_only_ridless_tfm()
263263
[InlineData(ToolsetInfo.CurrentTargetFramework)]
264264
public void It_runs_the_app_from_the_output_folder(string targetFramework)
265265
{
266+
if ((targetFramework == "net6.0" || targetFramework == "net7.0") &&
267+
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
268+
{
269+
// https://github.com/dotnet/sdk/issues/49665
270+
// Failed to load /private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (no such file), '/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
271+
return;
272+
}
266273
RunAppFromOutputFolder("RunFromOutputFolder_" + targetFramework, false, false, targetFramework);
267274
}
268275

@@ -281,6 +288,13 @@ public void It_runs_a_rid_specific_app_from_the_output_folder(string targetFrame
281288
[InlineData(ToolsetInfo.CurrentTargetFramework)]
282289
public void It_runs_the_app_with_conflicts_from_the_output_folder(string targetFramework)
283290
{
291+
if ((targetFramework == "net6.0" || targetFramework == "net7.0") &&
292+
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
293+
{
294+
// https://github.com/dotnet/sdk/issues/49665
295+
// Failed to load /private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib, error: dlopen(/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib, 0x0001): tried: '/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (no such file), '/private/tmp/helix/working/B3F609DC/p/d/shared/Microsoft.NETCore.App/6.0.0/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
296+
return;
297+
}
284298
RunAppFromOutputFolder("RunFromOutputFolderConflicts_" + targetFramework, false, true, targetFramework);
285299
}
286300

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public GivenThatWeWantToBuildAnAppWithLibrariesAndRid(ITestOutputHelper log) : b
1616
// Libuv version used by LibraryWithRid/LibraryWithRids
1717
private const string LibuvVersion = "1.10.0";
1818

19-
[Fact]
19+
// https://github.com/dotnet/sdk/issues/49665
20+
// Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libuv' or one of its dependencies.
21+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
2022
public void It_builds_a_RID_specific_runnable_output()
2123
{
2224
var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier;
@@ -56,7 +58,9 @@ public void It_builds_a_RID_specific_runnable_output()
5658
.And.NotHaveStdErr();
5759
}
5860

59-
[Fact]
61+
// https://github.com/dotnet/sdk/issues/49665
62+
// Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libuv' or one of its dependencies.
63+
[PlatformSpecificFact(TestPlatforms.Any & ~TestPlatforms.OSX)]
6064
public void It_builds_a_framework_dependent_RID_specific_runnable_output()
6165
{
6266
var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier;

test/Microsoft.NET.Build.Tests/GivenThatWeWantToGenerateADepsFileForATool.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ public GivenThatWeWantToGenerateADepsFileForATool(ITestOutputHelper log) : base(
1717
{
1818
}
1919

20-
// Disabled on full Framework MSBuild due to https://github.com/dotnet/sdk/issues/1293
2120
[CoreMSBuildOnlyFact]
2221
public void It_creates_a_deps_file_for_the_tool_and_the_tool_runs()
2322
{
23+
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
24+
{
25+
// https://github.com/dotnet/sdk/issues/49665
26+
return;
27+
}
28+
2429
TestProject toolProject = new()
2530
{
2631
Name = "TestTool",
@@ -37,10 +42,15 @@ public void It_creates_a_deps_file_for_the_tool_and_the_tool_runs()
3742
.And.HaveStdOutContaining("Hello World!");
3843
}
3944

40-
// Disabled on full Framework MSBuild due to https://github.com/dotnet/sdk/issues/1293
4145
[CoreMSBuildOnlyFact]
4246
public void It_handles_conflicts_when_creating_a_tool_deps_file()
4347
{
48+
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
49+
{
50+
// https://github.com/dotnet/sdk/issues/49665
51+
return;
52+
}
53+
4454
TestProject toolProject = new()
4555
{
4656
Name = "DependencyContextTool",

test/Microsoft.NET.Build.Tests/GiventThatWeWantDesignerSupport.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ public GivenThatWeWantDesignerSupport(ITestOutputHelper log) : base(log)
2525
[InlineData("net7.0-windows10.0.17763", "false")]
2626
public void It_provides_runtime_configuration_and_shadow_copy_files_via_outputgroup(string targetFramework, string isSelfContained)
2727
{
28+
if (targetFramework == "netcoreapp3.0" && RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
29+
{
30+
// https://github.com/dotnet/sdk/issues/49665
31+
// error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'osx-arm64'.
32+
return;
33+
}
34+
2835
if ((targetFramework == "net6.0-windows" || targetFramework == "net7.0-windows10.0.17763")
2936
&& !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
3037
{

test/Microsoft.NET.Build.Tests/ImplicitAspNetVersions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public void AspNetCoreVersionIsSetImplicitly(string aspnetPackageName)
4646
aspnetVersion.ToString().Should().Be("2.1.1");
4747
}
4848

49-
[Theory]
49+
// https://github.com/dotnet/sdk/issues/49665
50+
// error : NETSDK1056: Project is targeting runtime 'osx-arm64' but did not resolve any runtime-specific packages. This runtime may not be supported by the target framework.
51+
[PlatformSpecificTheory(TestPlatforms.Any & ~TestPlatforms.OSX)]
5052
[InlineData("Microsoft.AspNetCore.App")]
5153
[InlineData("Microsoft.AspNetCore.All")]
5254
public void AspNetCoreVersionRollsForward(string aspnetPackageName)

0 commit comments

Comments
 (0)