{"id":19933765,"url":"https://github.com/bazelbuild/rules_swift","last_synced_at":"2026-01-21T20:02:43.090Z","repository":{"id":33950302,"uuid":"136227935","full_name":"bazelbuild/rules_swift","owner":"bazelbuild","description":"Bazel rules to build Swift on Apple and Linux platforms","archived":false,"fork":false,"pushed_at":"2026-01-08T16:22:27.000Z","size":5268,"stargazers_count":339,"open_issues_count":37,"forks_count":162,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-01-10T20:20:38.112Z","etag":null,"topics":["bazel","bazel-rules","swift"],"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-06-05T19:55:46.000Z","updated_at":"2026-01-02T17:10:43.000Z","dependencies_parsed_at":"2023-10-16T22:04:15.137Z","dependency_job_id":"be0b5259-6b36-43fb-8651-926902610516","html_url":"https://github.com/bazelbuild/rules_swift","commit_stats":null,"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"purl":"pkg:github/bazelbuild/rules_swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazelbuild","download_url":"https://codeload.github.com/bazelbuild/rules_swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Frules_swift/sbom","scorecard":{"id":113810,"data":{"date":"2025-08-11","repo":{"name":"github.com/bazelbuild/rules_swift","commit":"ccebe4dc4ac16ea45ef111bee33f31036027ac08"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.9,"checks":[{"name":"Maintained","score":10,"reason":"28 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/create-release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/create-release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/bazelbuild/rules_swift/create-release.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 3.1.2 not signed: https://api.github.com/repos/bazelbuild/rules_swift/releases/238132496","Warn: release artifact 3.1.1 not signed: https://api.github.com/repos/bazelbuild/rules_swift/releases/232376943","Warn: release artifact 3.1.0 not signed: https://api.github.com/repos/bazelbuild/rules_swift/releases/231246116","Warn: release artifact 2.9.0 not signed: https://api.github.com/repos/bazelbuild/rules_swift/releases/225017975","Warn: release artifact 3.0.2 not signed: https://api.github.com/repos/bazelbuild/rules_swift/releases/224432795","Warn: release artifact 3.1.2 does not have provenance: https://api.github.com/repos/bazelbuild/rules_swift/releases/238132496","Warn: release artifact 3.1.1 does not have provenance: https://api.github.com/repos/bazelbuild/rules_swift/releases/232376943","Warn: release artifact 3.1.0 does not have provenance: https://api.github.com/repos/bazelbuild/rules_swift/releases/231246116","Warn: release artifact 2.9.0 does not have provenance: https://api.github.com/repos/bazelbuild/rules_swift/releases/225017975","Warn: release artifact 3.0.2 does not have provenance: https://api.github.com/repos/bazelbuild/rules_swift/releases/224432795"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/bazelbuild/.github/SECURITY.md:1","Info: Found linked content: github.com/bazelbuild/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/bazelbuild/.github/SECURITY.md:1","Info: Found text in security policy: github.com/bazelbuild/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T20:39:49.956Z","repository_id":33950302,"created_at":"2025-08-15T20:39:49.958Z","updated_at":"2025-08-15T20:39:49.958Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28641293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bazel","bazel-rules","swift"],"created_at":"2024-11-12T23:14:48.290Z","updated_at":"2026-01-21T20:02:43.085Z","avatar_url":"https://github.com/bazelbuild.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Rules for [Bazel](https://bazel.build)\n\n[![Build status](https://badge.buildkite.com/d562b11425e192a8f6ba9c43715bc8364985bccf54e4b9194a.svg?branch=main)](https://buildkite.com/bazel/rules-swift-swift)\n\nThis repository contains rules for [Bazel](https://bazel.build) that can be\nused to build Swift libraries, tests, and executables for macOS and Linux.\n\nTo build applications for all of Apple's platforms (macOS, iOS, tvOS,\nvisionOS, and watchOS), they can be combined with the\n[Apple Rules](https://github.com/bazelbuild/rules_apple).\n\nIf you run into any problems with these rules, please\n[file an issue!](https://github.com/bazelbuild/rules_swift/issues/new)\n\n## Basic Examples\n\nCreate a simple CLI that can run on macOS, Linux, or Windows:\n\n```bzl\nload(\"@build_bazel_rules_swift//swift:swift_binary.bzl\", \"swift_binary\")\n\nswift_binary(\n    name = \"cli\",\n    srcs = [\"CLI.swift\"],\n)\n```\n\nCreate a single library target that can be used by other targets in your\nbuild:\n\n```bzl\nload(\"@build_bazel_rules_swift//swift:swift_library.bzl\", \"swift_library\")\n\nswift_library(\n    name = \"MyLibrary\",\n    srcs = [\"MyLibrary.swift\"],\n    tags = [\"manual\"],\n)\n```\n\n## Reference Documentation\n\n[Click here](https://github.com/bazelbuild/rules_swift/tree/main/doc)\nfor the reference documentation for the rules and other definitions in this\nrepository.\n\n## Quick Setup\n\n### 1. Install Swift\n\nBefore getting started, make sure that you have a Swift toolchain installed.\n\n**Apple users:** Install [Xcode](https://developer.apple.com/xcode/downloads/).\nIf this is your first time installing it, make sure to open it once after\ninstalling so that the command line tools are correctly configured.\n\n**Linux users:** Follow the instructions on the\n[Swift download page](https://swift.org/download/) to download and install the\nappropriate Swift toolchain for your platform. Take care to ensure that you have\nall of Swift's dependencies installed (such as ICU, Clang, and so forth), and\nalso ensure that the Swift compiler is available on your system path.\n\n### 2. Configure your workspace\n\nCopy the `MODULE.bazel` snippet from [the releases page](https://github.com/bazelbuild/rules_swift/releases).\n\n### 3. Additional configuration (Linux only)\n\nThe `swift_binary` and `swift_test` rules expect to use `clang` as the driver\nfor linking, and they query the Bazel C++ API and CROSSTOOL to determine which\narguments should be passed to the linker. By default, the C++ toolchain used by\nBazel is `gcc`, so Swift users on Linux need to override this by setting the\nenvironment variable `CC=clang` when invoking Bazel.\n\nThis step is not necessary for macOS users because the Xcode toolchain always\nuses `clang`.\n\n## Building with Custom Toolchains\n\n**macOS hosts:** You can build with a custom Swift toolchain (downloaded\nfrom https://swift.org/download) instead of Xcode's default. To do so,\npass the following flag to Bazel:\n\n```lang-none\n--action_env=TOOLCHAINS=toolchain.id\n```\n\nWhere `toolchain.id` is the value of the `CFBundleIdentifier` key in the\ntoolchain's Info.plist file.\n\nTo list the available toolchains and their bundle identifiers, you can run:\n\n```command\nbazel run @build_bazel_rules_swift//tools/dump_toolchains\n```\n\n**Linux hosts:** At this time, Bazel uses whichever `swift` executable is\nencountered first on your `PATH`.\n\n## Supporting debugging\n\nTo make cacheable builds work correctly with debugging see\n[this doc](doc/debuggable_remote_swift.md).\n\n## Swift Package Manager Support\n\nTo download, build, and reference external Swift packages as Bazel\ntargets, check out\n[rules_swift_package_manager](https://github.com/cgrindel/rules_swift_package_manager).\n\n## Supported bazel versions\n\nrules_apple and rules_swift are often affected by changes in bazel\nitself. This means you generally need to update these rules as you\nupdate bazel.\n\nYou can also see the supported bazel versions in the notes for each\nrelease on the [releases\npage](https://github.com/bazelbuild/rules_swift/releases).\n\nBesides these constraint this repo follows [semver](https://semver.org/)\nas best as we can since the 1.0.0 release.\n\n| Bazel release | Minimum supported rules version | Final supported rules version|\n|:-------------------:|:-------------------:|:-------------------------:|\n| 8.x (most recent rolling) | 0.27.0 | current |\n| 7.x | 0.27.0 | current |\n| 6.x | 0.27.0 | 2.2.0 |\n| 5.x | 0.25.0 | 1.14.0 |\n| 4.x | 0.19.0 | 0.24.0 |\n| 3.x | 0.14.0 | 0.18.0 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Frules_swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazelbuild%2Frules_swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Frules_swift/lists"}