{"id":19933746,"url":"https://github.com/bazelbuild/apple_support","last_synced_at":"2025-03-01T11:44:11.463Z","repository":{"id":37057449,"uuid":"160946505","full_name":"bazelbuild/apple_support","owner":"bazelbuild","description":"Apple support for Bazel rules","archived":false,"fork":false,"pushed_at":"2025-02-21T17:05:55.000Z","size":530,"stargazers_count":86,"open_issues_count":12,"forks_count":40,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-21T18:22:17.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazelbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-08T14:22:15.000Z","updated_at":"2025-02-21T17:06:00.000Z","dependencies_parsed_at":"2024-05-08T19:31:44.291Z","dependency_job_id":"416921f3-04e4-40b2-b24b-46c03c717570","html_url":"https://github.com/bazelbuild/apple_support","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fapple_support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fapple_support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fapple_support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fapple_support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazelbuild","download_url":"https://codeload.github.com/bazelbuild/apple_support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241361398,"owners_count":19950379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:14:44.844Z","updated_at":"2025-03-01T11:44:11.443Z","avatar_url":"https://github.com/bazelbuild.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apple Support for [Bazel](https://bazel.build)\n\nThis repository contains the [Apple CC toolchain](#toolchain-setup),\nApple related [platforms](platforms/BUILD) and\n[constraints](constraints/BUILD) definitions, and small helper functions\nfor rules authors targeting Apple platforms.\n\nIf you want to build iOS, tvOS, visionOS, watchOS, or macOS apps, use\n[`rules_apple`][rules_apple].\n\nIf you want to build Swift use\n[`rules_swift`](https://github.com/bazelbuild/rules_swift).\n\nSee [the documentation](doc) for the helper rules provided by this\nrepository.\n\n## Installation\n\nCopy the `MODULE.bazel` or `WORKSPACE` snippets from [the releases\npage](https://github.com/bazelbuild/apple_support/releases) into your\nproject.\n\n## Toolchain setup\n\nThe Apple CC toolchain in this repository provides toolchains for\nbuilding for Apple platforms besides macOS. Since Bazel 7 this toolchain\nis required when targeting those platforms but the toolchain also\nsupports Bazel 6.\n\nNOTE: This toolchain requires a full Xcode installation, not just the\nXcode Command Line Tools. If you only need to build for macOS and don't\nwant to require a full Xcode installation in your build, use the builtin\nUnix toolchain provided by Bazel.\n\n### Bazel 7+ Setup\n\nFor Bazel 7+ the only setup that is required is to have `apple_support`\nin your `MODULE.bazel` (even if you're not referencing it directly) or\n`WORKSPACE`, which you can copy from [the releases\npage](https://github.com/bazelbuild/apple_support/releases) into your\nproject.\n\nIf you also depend on `rules_cc`, `apple_support` must come _above_\n`rules_cc` in your `MODULE.bazel` or `WORKSPACE` file because Bazel\nselects toolchains based on which is registered first.\n\n### Bazel 6 Setup\n\nFor Bazel 6, pull this repository into your build and add this to your\n`.bazelrc`:\n\n```bzl\nbuild --enable_platform_specific_config\nbuild:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain\nbuild:macos --crosstool_top=@local_config_apple_cc//:toolchain\nbuild:macos --host_crosstool_top=@local_config_apple_cc//:toolchain\n```\n\nThis ensures that all rules provided by [`rules_apple`][rules_apple], as\nwell as other rules like `cc_binary`, all use the toolchain provided by\nthis repository when building on macOS.\n\nIf you're using bzlmod with Bazel 6 and the `--crosstool_top`\nconfigurations you must expose the `local_config_apple_cc` repository to\nyour project by putting this in your `MODULE.bazel`:\n\n```bzl\napple_cc_configure = use_extension(\"@build_bazel_apple_support//crosstool:setup.bzl\", \"apple_cc_configure_extension\")\nuse_repo(apple_cc_configure, \"local_config_apple_cc\")\n```\n\n## Toolchain configuration\n\nThere are many different flags you can flip to configure how the\ntoolchain works. Here are some of the more commonly useful ones:\n\n- Setting `DEVELOPER_DIR` in the environment. This is recommended so\n  that the toolchain can be invalidated when the `DEVELOPER_DIR`\n  changes, which ensures that toolchain binaries will be rebuilt with\n  the new version of Xcode so that caches are correctly shared across\n  machines.\n- Setting `BAZEL_ALLOW_NON_APPLICATIONS_XCODE=1` in the environment (or\n  using `--repo_env`) allows the toolchain to discover Xcode versions\n  outside of the `/Applications` directory to avoid header inclusion\n  errors from bazel. This is not enabled by default because\n  `/Applications` is the standard directory, and this improves toolchain\n  setup performance.\n\n[rules_apple]: https://github.com/bazelbuild/rules_apple\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Fapple_support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazelbuild%2Fapple_support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Fapple_support/lists"}