zed-industries / create-gpui-app

CRA-style tool for creating new gpui apps
MIT License
130 stars 8 forks source link

Example can't compile: can't find metal #23

Closed natemcintosh closed 3 weeks ago

natemcintosh commented 3 weeks ago

Problem

When attempting the quick start example, I make it up to the cargo run stage, at which point it fails saying

--- stderr
  metal shader compilation failed:
  xcrun: error: unable to find utility "metal", not a developer tool or in PATH

I'm assuming metal can be installed relatively easily, but would be nice to have instructions in the README explaining how to install it if is not already installed.

Attempts to fix

I've run

$ xcode-select --install 
xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

From this comment I was able to get a few compilations steps further before I got

cargo run
Compiling gpui v0.1.0 (https://github.com/zed-industries/zed#9ef3306f)
error: failed to run custom build command for `gpui v0.1.0 (https://github.com/zed-industries/zed#9ef3306f)`

Caused by:
  process didn't exit successfully: `/Users/natemcintosh/gdev/notes/target/debug/build/gpui-bdc38e81373e6cd5/build-script-build` (exit status: 101)
  --- stdout
  cargo::rustc-check-cfg=cfg(gles)
  cargo:rustc-link-lib=framework=System
  cargo:rerun-if-changed=src/platform/mac/dispatch.h
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  src/platform/mac/dispatch.h:1:10: fatal error: 'dispatch/dispatch.h' file not found
  thread 'main' panicked at /Users/natemcintosh/.cargo/git/checkouts/zed-23861290b5d2093f/9ef3306/crates/gpui/build.rs:73:14:
  unable to generate bindings: ClangDiagnostic("src/platform/mac/dispatch.h:1:10: fatal error: 'dispatch/dispatch.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Searching for this error brought me to this zed dev page which finally helped me fix it.

Action

I'll create a PR that adds a link to the zed development troubleshooting page to the README on this repo.

natemcintosh commented 3 weeks ago

PR here