Open mikebluestein opened 6 years ago
Hi,
Thanks for the precise bug and the attached test case.
However I cannot reproduce this locally with this environment: https://gist.github.com/VincentDondain/006f62855a5fc424a2661fbc314d67e4. Here is my successful build output: https://gist.github.com/VincentDondain/2798b04bad78a168ff2fa7376ac4aa99
It's weird because it looks like the metal command line tool is failing when producing the NodeRender.metal
file.
NodeRender.metal:3:10: fatal error: 'SceneKit/scn_metal' file not found
.
#include <SceneKit/scn_metal>
is required and I don't know why it fails on that. See https://developer.apple.com/documentation/scenekit/scnprogram.
When you said: "The shader builds fine in Xcode or with Metal's command line tools.", does that mean you tried running the command from a terminal: https://gist.github.com/mikebluestein/200d75a0b29b616dface410b3c2c1123#file-gistfile1-txt-L78?
I don't see anything special that our msbuild tasks do that would cause that behavior. I believe the fatal error reported is from the metal command line tool itself so I don't expect that command to work locally if you try in a terminal. @jstedfast thoughts?
Note: I tried this on a Mojave machine, this doesn't make a difference for me compared to running on High Sierra, both work.
When you said: "The shader builds fine in Xcode or with Metal's command line tools.", does that mean you tried running the command from a terminal:
I can run this to compile the metallib:
xcrun -sdk iphoneos metal -c HighlightRenderer.metal -o default.air
xcrun -sdk iphoneos metallib default.air -o default.metallib
It worked in VS for Mac before I upgraded to Mojave. I can reproduce on 2 different machines as well.
I get the same error with the attached test case.
Sebastiens-MacBook-Pro:foo poupou$ /Applications/Xcode101-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal -arch air64 -emit-llvm -c -gline-tables-only -ffast-math -serialize-diagnostics obj/iPhone/Debug/metal/NodeRender.dia -o obj/iPhone/Debug/metal/NodeRender.air -mios-version-min=12.0 NodeRender.metal
NodeRender.metal:3:10: fatal error: 'SceneKit/scn_metal' file not found
#include <SceneKit/scn_metal>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
and, like @mikebluestein, it works when using xcrun
Sebastiens-MacBook-Pro:foo poupou$ xcrun -sdk iphoneos metal -arch air64 -emit-llvm -c -gline-tables-only -ffast-math -serialize-diagnostics obj/iPhone/Debug/metal/NodeRender.dia -o obj/iPhone/Debug/metal/NodeRender.air -mios-version-min=12.0 NodeRender.metal
The main difference is the -sdk iphoneos
argument to xcrun
which (I would assume) is implied when using .../iPhoneOS.platform/usr/bin/metal
It seems another case to push #4634 forward.
I'd like to +1 this bug. Working with XCode Project but build fails with Xamarin
Target _SmeltMetal:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal -arch air64 -emit-llvm -c -gline-tables-only -ffast-math -serialize-diagnostics obj/iPhone/Debug/device-builds/iphone9.3-12.1.1/metal/StencilRender.dia -o obj/iPhone/Debug/device-builds/iphone9.3-12.1.1/metal/StencilRender.air -mios-version-min=11.0 StencilRender.metal
StencilRender.metal:3:10: fatal error: 'SceneKit/scn_metal' file not found
#include <SceneKit/scn_metal>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(555,3): error MSB6006: "metal" exited with code 1.
Done building target "_SmeltMetal" in project "ARWallpaper.iOS.csproj" -- FAILED.
Done building project "ARWallpaper.iOS.csproj" -- FAILED.
Build FAILED.
Hi guys, looks like this is a path problem as any #include fails for me except the base metallib and simd
Always fails even though the library is in the correct location.
Steps to Reproduce
Expected Behavior
It builds.
Actual Behavior
Build fails with error: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error MSB6006: "metal" exited with code 1. (MSB6006)
Note: The shader builds fine in Xcode or with Metal's command line tools.
Environment
Build Logs
https://gist.github.com/mikebluestein/200d75a0b29b616dface410b3c2c1123
Example Project (If Possible)
test case.zip