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

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

Closed
jeremy-visionaid opened this issue Oct 15, 2024 · 5 comments · Fixed by #21439 or #21453
Closed
Labels
msbuild Issues affecting our msbuild tasks/targets
Milestone

Comments

@jeremy-visionaid
Copy link
Contributor

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
Copy link
Contributor Author

jeremy-visionaid commented Oct 15, 2024

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

@Search2Code
Copy link

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

@rolfbjarne rolfbjarne added the msbuild Issues affecting our msbuild tasks/targets label Oct 15, 2024
@tolszak
Copy link

tolszak commented Oct 15, 2024

I would love to see it fixed too!

@molesmoke
Copy link

@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.

rolfbjarne added a commit that referenced this issue Oct 15, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
@rolfbjarne rolfbjarne added this to the Future milestone Oct 15, 2024
@rolfbjarne
Copy link
Member

Thanks for the report - fix is in progress.

rolfbjarne added a commit that referenced this issue Oct 16, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.

Fixes #21437.
haritha-mohan pushed a commit that referenced this issue Oct 19, 2024
…. (#21439)

This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Use 'xcrun' to invoke 'metal' and 'metallib' (partial fix for #3931).
* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.
* Fix nullability.

Fixes #21437.
rolfbjarne added a commit that referenced this issue Oct 22, 2024
This has a few advantages:

* We simplify and unify more of our code.
* We have more control over the error reporting / logging behavior.

Additionally:

* Allow for overriding the path to the command-line tool in question.
* Add support for cancellation.

Fixes #21437.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msbuild Issues affecting our msbuild tasks/targets
Projects
None yet
5 participants