rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Add Apple visionOS support

Open QuentinPerez opened this issue 1 year ago • 4 comments

👋

A small PR to support VisionOS. As it's a tier 3 toolchain, you'll need to build and host the standard library. Below is an example demonstrating the use of the rust_repository_set rule to configure the toolchain.

rust_repository_set(
    name = "aarch64_apple_visionos_on_aarch64_apple_darwin",
    edition = "2024",
    exec_triple = "aarch64-apple-darwin",
    extra_target_triples = {
        "aarch64-apple-visionos": [
            "@platforms//os:visionos",
            "@platforms//cpu:arm64",
            "@build_bazel_apple_support//constraints:apple",
            "@build_bazel_apple_support//constraints:device",
        ],
        "aarch64-apple-visionos-sim": [
            "@platforms//os:visionos",
            "@platforms//cpu:arm64",
            "@build_bazel_apple_support//constraints:apple",
            "@build_bazel_apple_support//constraints:simulator",
        ],
    },
    urls = ["URLS_TO_YOUR_RUST_STD"],
)

QuentinPerez avatar Apr 19 '24 08:04 QuentinPerez

can we merge it ?

QuentinPerez avatar Apr 24 '24 23:04 QuentinPerez

It looks like there’s some build failures that will need to be addressed first

UebelAndre avatar Apr 24 '24 23:04 UebelAndre

It looks like there’s some build failures that will need to be addressed first

You're right, I missed that one! I think we should not be able to merge it as long as the target isn't available on stable.

Caused by:
  process didn't exit successfully: `/private/var/tmp/_bazel_quentinperez/5845dd8b2f37c7097e5eb050b26837b8/external/rust_darwin_aarch64__aarch64-apple-darwin__stable_tools/bin/rustc - --crate-name ___ --print=file-names --target aarch64-apple-visionos --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: Error loading target specification: Could not find specification for target "aarch64-apple-visionos". Run `rustc --print target-list` for a list of built-in targets

QuentinPerez avatar Apr 25 '24 11:04 QuentinPerez

I am not sure to understand why the blzmod BCR step fails only on window

QuentinPerez avatar Aug 03 '24 16:08 QuentinPerez