簡體   English   中英

在 mac mini m1 主機上使用 bazel 構建 ios

[英]Build ios with bazel on mac mini m1 hosted machine

我在 macstadium 上租了一個 Mac mini G5A AS/M1/8C/8G/256G/SSD,我安裝了 xcode 和命令行工具,當我“bazel build”時,我得到了這個錯誤:

ERROR: /private/var/tmp/_bazel_administrator/817b3a428d4281fbfa50ce6dccf87632/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_sim_arm64'

這是 my.bazelrc 文件內容:

build \

  --compilation_mode=fastbuild \

  --worker_sandboxing=false \

  --strategy=SwiftCompile=local \

  --features=swift.cacheable_swiftmodules \

  --apple_platform_type=ios \

  --xcode_version=13.4 \

  --ios_minimum_os=14.5 \

  --ios_simulator_device="iPhone 13" \

  --ios_simulator_version=15.5 \

  --ios_multi_cpus=x86_64

  --progress_report_interval=1 \

  --subcommands \

  --sandbox_debug \

  --announce_rc \

  --features=swift.use_global_module_cache \

  --action_env=PATH=/usr/bin:/bin \

  --action_env=BAZEL_IGNORE_SYSTEM_HEADERS_VERSIONS=1 \

  --spawn_strategy=local \

  --verbose_failures \

這是我的 WORKSPACE.bazel 文件:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "build_bazel_rules_apple",
    sha256 = "a19cf84dd060eda50be9ba5b0eca88377e0306ffbc1cc059df6a6947e48ac61a",
    url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.1/rules_apple.1.1.1.tar.gz",
)

load(
    "@build_bazel_rules_apple//apple:repositories.bzl",
    "apple_rules_dependencies",
)

apple_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:repositories.bzl",
    "swift_rules_dependencies",
)

swift_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:extras.bzl",
    "swift_rules_extra_dependencies",
)

swift_rules_extra_dependencies()

load(
    "@build_bazel_apple_support//lib:repositories.bzl",
    "apple_support_dependencies",
)

apple_support_dependencies()

巴澤爾版本:5.3.0

有沒有人遇到過類似的問題? 你對此有什么想法嗎?

sudo xcode-select -s Xcode 應用程序然后 bazel clean --expunge 修復它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM