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

NETSDK1204 error during dotnet clean on macOS when AoT enabled #36960

Closed
martincostello opened this issue Nov 16, 2023 · 6 comments
Closed

NETSDK1204 error during dotnet clean on macOS when AoT enabled #36960

martincostello opened this issue Nov 16, 2023 · 6 comments
Labels
Area-NativeAOT Native AOT compilation untriaged Request triage from a team member

Comments

@martincostello
Copy link
Member

Describe the bug

Running dotnet clean as part of the Polly CI fails on macOS when PublishAot=true is specified in a project file.

To Reproduce

Run build.ps1 on macOS after cloning this commit: App-vNext/Polly@58c807e

I haven't been able to reproduce this in a simpler project: martincostello/dotnet-8-samples#10

I also don't have access to a macOS computer (I have a Windows laptop), so I can't test this out locally to try and get a more minimal repro.

Exceptions (if any)

Workflow error logs from App-vNext/Polly#1800:

Error: /Users/runner/.dotnet/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1204: Ahead-of-time compilation is not supported on the current platform 'osx-x64'. [/Users/runner/work/Polly/Polly/test/Polly.AotTest/Polly.AotTest.csproj]

Further technical details

.NET 8.1.00 SDK running on GitHub Action's macos-latest runner.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Nov 16, 2023
@eerhardt eerhardt added Area-NativeAOT Native AOT compilation and removed Area-NetSDK labels Nov 16, 2023
@eerhardt
Copy link
Member

FYI- @sbomer @agocke

@sbomer
Copy link
Member

sbomer commented Nov 16, 2023

@martincostello The project is targeting net7.0 which did not support PublishAot for osx-x64. The .NET 8 SDK has improved error handling for unsupported scenarios. Would you be able to update the project to targcet net8.0?

@sbomer
Copy link
Member

sbomer commented Nov 16, 2023

For future reference, I was able to get a binlog out of this with the following change to build.cake:

 var dotNetCleanSettings = new DotNetCleanSettings
         {
             Verbosity = DotNetVerbosity.Minimal,
+            MSBuildSettings = new DotNetMSBuildSettings
+            {
+                BinaryLogger = new MSBuildBinaryLoggerSettings
+                {
+                    Enabled = true,
+                    FileName = System.IO.Path.Combine(artifactsDir, Directory("msbuild.binlog")),
+                },
+            },
         };

image
The error is happening because the net7.0 KnownILCompilerPacks doesn't include a RID for osx-x64 (since that's not supported). I don't have an x64 macOS machine to test on, but I get the same error on osx-arm64 when targeting net7.0.

@martincostello
Copy link
Member Author

I'm quite confused because we've updated our SDK to 8.0 and added net8.0 targets. Did we miss a 7.0 reference somewhere?

@sbomer
Copy link
Member

sbomer commented Nov 16, 2023

I'm looking at the TFM of the test project in the commit you shared: App-vNext/Polly@58c807e#diff-a9aede301b3d3343182c1aac4a69b05e602be40e498b5295ad94735ea344f70eR8

@martincostello
Copy link
Member Author

Ah. That project was added subsequent to the initial .NET 8 PR being opened so it must have missed our 7.0 find and replace sweep 🤦🏻‍♂️

@martincostello martincostello closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NativeAOT Native AOT compilation untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants