Missing XCode command line tools for Metal SDK
Categories
(Firefox Build System :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: kvark, Unassigned)
References
Details
I'm trying to add a dependency that needs to build some Metal shaders in build.rs. The try fails because something can't be found:
k 2019-10-04T03:19:12.531Z] 03:19:12 INFO - Running
/builds/worker/workspace/build/src/obj-firefox/debug/build/gfx-backend-metal-77f6aa08cd9153c4/build-script-build
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - [num-integer 0.1.39] cargo:rustc-cfg=has_i128
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - Fresh memchr v2.2.0
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - [gfx-backend-metal 0.3.2] cargo:rerun-if-changed=/builds/worker/workspace/build/src/third_party/rust/gfx-backend-metal/shaders
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - [gfx-backend-metal 0.3.2] cargo:rerun-if-changed=/builds/worker/workspace/build/src/third_party/rust/gfx-backend-metal/shaders/blit.metal
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - [gfx-backend-metal 0.3.2] thread 'main' panicked at 'failed to execute metal compiler: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:999:5
[task 2019-10-04T03:19:12.532Z] 03:19:12 INFO - [gfx-backend-metal 0.3.2] stack backtrace:
That "something" is xcrun
, I believe, which is a part of XCode command line tools. Is there a way for us to enable/install them on Try instances?
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Our automation builds are running on a Linux host, cross compiling to macOS, so we probably need to change our approach here. Instead of checking for the path to the metal compiler with xcrun we should probably make it a check in configure and pass it directly. We also need to check that the sdk being used for mac builds is recent enough to include the tool (it looks like 10.11, currently).
Reporter | ||
Comment 2•5 years ago
|
||
Chris,
Could you clarify the proposed idea, please? The "we should probably make it a check in configure and pass it directly" bit piece is not clear to me, since we get the error in build.rs
, which comes with no "configure" script. Perhaps we should change our build.rs
to take the path from an environment variable that Gecko build system provides?
We also need to check that the sdk being used for mac builds is recent enough to include the tool (it looks like 10.11, currently).
According to the wiki, 10.11 should have the tools. Is there a way for us to verify that xcrun
and metal compiler are there?
Comment 3•5 years ago
|
||
I believe the issue is that xcrun isn't available on a linux host. So the idea would be to find metal in our configure script based on the sdk's location, and communicate that to build.rs (I think an environment variable or file to include/read). I think bindgen does something similar, the approach there may be instructive.
Comment 4•5 years ago
|
||
xcrun is not the only thing that is being executed. It's merely a wrapper. What is actually executed is metal
and metallib
... and those won't work either on a Linux host...
Reporter | ||
Comment 5•5 years ago
|
||
Ok, so what's the plan? We can't use Linux cross-compiling any more and have to switch to OSX host compilation?
Comment 6•5 years ago
|
||
(In reply to Dzmitry Malyshau [:kvark] from comment #5)
Ok, so what's the plan? We can't use Linux cross-compiling any more and have to switch to OSX host compilation?
This would be an enormous ask of releng/relops, although it's not my call to make.
Would it be feasible to run the build.rs on a mac before the build and upload its result as a dependency of the actual build?
Reporter | ||
Comment 7•5 years ago
|
||
Yes, looks like we don't have a choice but to do this...
Please feel free to close the issue or use it for tracking if a decision to do native osx compilation is made.
Comment 8•5 years ago
|
||
Ok, will close for now.
Description
•