Better Xcode Metal debugging documentation
The metal crate has some instructions for how to debug Metal in Xcode, see https://github.com/gfx-rs/metal-rs/tree/master/guide/debugging-in-xcode.
We should consider adding a similar "how-to" guide (or just copy theirs with attribution).
See also https://github.com/gfx-rs/metal-rs/issues/152.
A few things I've been fighting from the guide so far, when building inside Xcode:
- Unless I can make the build fail immediately because
cargois not found, I haven't found how to see the live compilation logs yet until the build finishes... -
rustupfrombrewis not inPATHby default. Even having it in/etc/paths.ddoes not seem to be inherited by Xcode, and it has to be added manually underBuild Settings(with a leading:because it gets appended to the existing inheritedPATH): - Almost my entire tree performs a recompile versus the terminal
alacritty(and terminal editorhelix) that I normally use, becauseobjc2triggers a recompile onMACOSX_DEPLOYMENT_TARGETchanging. I made sure that this var is not set underBuild Settings, but it seems to be set/inferred elsewhere... - In this project, the working directory on launch/debug is not respected with the default
Console: Xcode. It used to work when I usedDebug->Debug executable...before though, and the current workaround is to switch theConsoletoTerminal.
When building from the terminal, and merely using Debug -> Debug executable..., I have no clue how to save the created "Scheme" for the next time Xcode opens, so that I keep have to reconfigure the working directory and a few other settings. ~Perhaps I can create a new empty project without custom build system (at all) for that 😅~ EDIT: In the project that I have above, in the scheme editor under Build unchecking the checkboxes of the Run column makes it no longer invoke the build step: