Skip to content

Missing instructions for macOS Metal #2472

Closed
@Walther

Description

@Walther

The instructions for getting started with gfx-rs on macOS are lacking.

The Readme instructs:

# macOS
cargo run --bin quad --features metal

These examples assume that necessary dependencies for the graphics backend are already installed. For more information about installation and usage, refer to the Getting Started guide.

The Getting Started guide only has instructions for Fedora and Ubuntu.

With the instructions provided, running on macOS 10.14.1 (18B75), with only the XCode command-line utils installed (not the full XCode IDE and everything), you bump into the following error:

cargo run --bin quad --features metal
   Compiling gfx-backend-metal v0.1.0 (file:///Users/walther/git/gfx/src/backend/metal)
   Compiling spirv_cross v0.11.2
   Compiling objc_id v0.1.1
   Compiling cocoa v0.18.1
   Compiling cocoa v0.17.0
   Compiling parking_lot_core v0.3.1
   Compiling glsl-to-spirv v0.1.7
   Compiling gfx-hal v0.1.0 (file:///Users/walther/git/gfx/src/hal)
   Compiling jpeg-decoder v0.1.15
error: failed to run custom build command for `gfx-backend-metal v0.1.0 (file:///Users/walther/git/gfx/src/backend/metal)`
process didn't exit successfully: `/Users/walther/git/gfx/target/debug/build/gfx-backend-metal-eca86b15efa6c9d1/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=/Users/walther/git/gfx/src/backend/metal/shaders
cargo:rerun-if-changed=/Users/walther/git/gfx/src/backend/metal/shaders/blit.metal

--- stderr
xcrun: error: unable to find utility "metal", not a developer tool or in PATH
thread 'main' panicked at 'shader compilation failed', src/backend/metal/build.rs:68:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
^C

After a quick googling, this seems to suggest that the relevant tools might be only available after installing the full XCode distribution.

(I'll report back when I get to a place with proper internet again so that I can download the full XCode, and see if that solves the issue. If it does, I'll gladly write a PR with the step-by-step instructions ❤️ )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions