xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 511 forks source link

Metal compiler build failures are not displayed by dotnet build at minimal verbosity #21437

Open jeremy-visionaid opened 5 hours ago

jeremy-visionaid commented 5 hours ago

Apple platform

iOS, Mac Catalyst

Framework version

net8.0-, net9.0-

Affected platform version

8.0.403, 9.0.100-rc.2.24474.11

Description

dotnet build does not show the reason compiling a Metal file failed, it only reports that metal exited with an error code:

dotnet build
  Determining projects to restore...
  Restored /Users/jeremy/src/tests/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj (in 109 ms).
  Detected signing identity:

    Code Signing Key: "" (-)
    Bundle Id: com.companyname.MacCatalystApp1
    App Id: com.companyname.MacCatalystApp1
  MacCatalystApp1 -> /Users/jeremy/src/tests/MacCatalystApp1/MacCatalystApp1/bin/Debug/net8.0-maccatalyst/maccatalyst-arm64/MacCatalystApp1.dll
/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk.net8.0_18.0/18.0.8303/tools/msbuild/iOS/Xamarin.Shared.targets(1405,3): error MSB6006: "metal" exited with code 1. [/Users/jeremy/src/tests/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk.net8.0_18.0/18.0.8303/tools/msbuild/iOS/Xamarin.Shared.targets(1405,3): error MSB6006: "metal" exited with code 1. [/Users/jeremy/src/tests/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.49

But the error is not useful without including the output from the metal compiler:

         test.metal:5:6: warning: missing terminating ' character [-Winvalid-pp-token]
         Qapla'
              ^
         test.metal:5:1: error: unknown type name 'Qapla'
         Qapla'
         ^
         test.metal:5:6: error: expected unqualified-id
         Qapla'
              ^
         1 warning and 2 errors generated.

Steps to Reproduce

git clone https://github.com/jeremy-visionaid/MacCatalystApp1

git clone https://github.com/jeremy-visionaid/MacCatalystApp1
cd MacCatalystApp1
dotnet build

Did you find any workaround?

dotnet build -v:normal

Build logs

No response

jeremy-visionaid commented 5 hours ago

Ideally, I'd expect that the build error should be shown in the "PROBLEMS" tab of VS Code

Search2Code commented 35 minutes ago

Try to run this in the terminal, it's possible a environment issue.

tolszak commented 22 minutes ago

I would love to see it fixed too!

molesmoke commented 20 minutes ago

@Search2Code the attached output is from the terminal, the results are the same in VS Code too. AFAIK everyone on my team is affected by the same issue.