Starlark bazel-rules

Open-source Starlark projects categorized as bazel-rules

Top 23 Starlark bazel-rule Projects

  • rules_docker

    Rules for building and handling Docker images with Bazel

    Project mention: Crafting container images without Dockerfiles | | 2023-02-06

    My company uses Bazel's rules docker to build our images:

    They're pretty great and have a lot of the caching and parallelism benefits mentioned in the post for free out of the box, along with determinism (which Docker files don't have because you can run arbitrary shell commands). Our backend stack is also built with Bazel so we get a nice tight integration to build our images that is pretty straightforward.

    We've also built some nice tooling around this to automatically put our maven dependencies into different layers using Bazel query and buildozer. Since maven deps don't change often we get a lot of nice caching advantages.

  • rules_nodejs

    NodeJS toolchain for Bazel.

    Project mention: Bazel jasmine_test issue | /r/bazel | 2023-07-24
  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • rules_rust

    Rust rules for Bazel

    Project mention: Rust fact vs. fiction: 5 Insights from Google's Rust journey in 2022 | /r/rust | 2023-06-27

    To answer your question, I don't know if Soong or Bazel can reuse the files produced by an incremental Rust compilation. I tried searching the rules_rust repository and found some discussions, but nothing that clearly told me "Yes, this is supported".

  • rules_python

    Bazel Python Rules

    Project mention: Python coverage in Bazel has been broken for nearly 6 years | | 2023-08-19
  • rules_apple

    Bazel rules to build apps for Apple platforms.

    Project mention: A Comprehensive guide to build a cross-platform application by Bazel | | 2022-11-17

    git_repository( name = "build_bazel_rules_apple", remote = "", tag = "1.1.3", ) git_repository( name = "build_bazel_rules_swift", remote = "", tag = "1.2.0", ) load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") swift_rules_dependencies()

  • rules_scala

    Scala rules for Bazel

  • bazel-skylib

    Common useful functions and rules for Bazel

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at

  • rules_swift

    Bazel rules to build Swift on Apple and Linux platforms

    Project mention: A Comprehensive guide to build a cross-platform application by Bazel | | 2022-11-17

    git_repository( name = "build_bazel_rules_apple", remote = "", tag = "1.1.3", ) git_repository( name = "build_bazel_rules_swift", remote = "", tag = "1.2.0", ) load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") swift_rules_dependencies()

  • bazel-coverage-report-renderer

    Haskell rules for Bazel.

  • rules_proto_grpc

    Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets

  • rules_js

    High-performance Bazel rules for running Node.js tools and building JavaScript projects

    Project mention: Any nice patterns for releasing libraries? | /r/bazel | 2023-05-26

    For Bazel you can find a good example of this functionality in rules_js with the integration of pnpm workspaces and the npm_package rule (macro) which recently gained a .publish runnable target that will publish the package.

  • rules_nixpkgs

    Rules for importing Nixpkgs packages into Bazel.

    Project mention: Crafting container images without Dockerfiles | | 2023-02-06
  • rules_cc

    C++ Rules for Bazel

    Project mention: What's New in Bazel 6.0 | | 2022-12-19

    Not that I'd recommend it, but if you symlink your system library into the bazel build area, as long as your sandboxing setup don't hose you (or you just turn it off), bazel will track system tools/library in the same way as everything else.

    Bazel's rules_cc even has a system_library.bzl you can import a `system_library` from that automates this for you.

    I'd still recommend building everything from scratch (and understanding the relationships and graph of your dependencies), but if your build isn't that complicated and you want to role the dice on UB, this isn't that hard.

    As an aside, the most galling part of bazel's cache key calculations has to be that it's up to the individual rules to implement this how they see fit. The rules native to bazel written in java vary wildly compared to starlark-written rules. On thing you (or someone in your org) end up becoming pretty comfortable with while using bazel in anger is RTFC.

  • rules_gitops

    This repository contains rules for continuous, GitOps driven Kubernetes deployments.

  • platforms

    Constraint values for specifying platforms and toolchains (by bazelbuild)

    Project mention: Problems compiling Python gRPC libraries in Bazel - different errors in deps | /r/grpc | 2022-12-15

    Repository rule http_archive defined at: /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/bazel_tools/tools/build_defs/repo/http.bzl:370:31: in ERROR: /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/bazel_tools/platforms/BUILD:89:6: in alias rule @bazel_tools//platforms:windows: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on See for details. ERROR: /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/bazel_tools/platforms/BUILD:89:6: Analysis of target '@bazel_tools//platforms:windows' failed INFO: Repository cython instantiated at: /usr/local/home/bill/depot/src/project/WORKSPACE:448:10: in /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:458:21: in grpc_deps /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/com_github_grpc_grpc/bazel/grpc_python_deps.bzl:69:21: in grpc_python_deps Repository rule http_archive defined at: /usr/local/home/wrp/.cache/bazel/_bazel_wrp/254c50c69c3701cca4e904bef759573b/external/bazel_tools/tools/build_defs/repo/http.bzl:370:31: in

  • rules_ts

    Bazel rules for the `tsc` compiler from

    Project mention: Building a modern gRPC-powered microservice using Node.js, Typescript, and Connect | | 2023-04-20

    import { StateTransitionService } from "@state-transitions/definition"; import { createConnectTransport } from "@bufbuild/connect-node"; import { createPromiseClient } from "@bufbuild/connect"; // The following line is due to these issues // > // > import type {} from "@bufbuild/protobuf"; export const transport = createConnectTransport({ baseUrl: `http://localhost:8080`, httpVersion: "1.1", }); export const client = createPromiseClient(StateTransitionService, transport);

  • rules_scala

    Robust and featureful Bazel rules for Scala (by higherkindness)

  • gcc-toolchain

    A fully-hermetic Bazel GCC toolchain for Linux.

  • rules_jsonnet

    Jsonnet rules for Bazel

    Project mention: Jsonnet – The Data Templating Language | | 2023-03-27

    I can definitely sympathize here - in every context, just straight JSON/YAML configuration seems never expressive enough, but the tooling created in response always seems to come with sharp edges.

    Here are some of the things I appreciate about Jsonnet:

    - It evals to JSON, so even though the semantics of the language are confusing, it is reasonably easy to eval and iterate on some Jsonnet until it emits what one is expecting - and after that, it's easy to create some validation tests so that regressions don't occur.

    - It takes advantage of the fact that JSON is a lowest-common-denominator for many data serialization formats. YAML is technically a superset of JSON, so valid JSON is also valid YAML. Proto3 messages have a canonical JSON representation, so JSON can also adhere to protobuf schemas. This covers most "serialized data structure" use-cases I typically encounter (TOML and HCL are outliers, but many tools that accept those also accept equivalent JSON). This means that with a little bit of build-tool duct-taping, Jsonnet can be used to generate configurations for a wide variety of tooling.

    - Jsonnet is itself a superset of JSON - so those more willing to write verbose JSON than learn Jsonnet can still write JSON that someone else can import/use elsewhere. Using Jsonnet does not preclude falling back to JSON.

    - The tooling works well - installing the Jsonnet VSCode plugin brings in a code formatter that does an excellent job, and rules_jsonnet[0] provides good bazel integration, if that's your thing.

    I'm excited about Jsonnet because now as long as other tool authors decide to consume JSON, I can more easily abstract away their verbosity without writing a purpose-built tool (looking at you, Kubernetes) without resorting to text templating (ahem Helm). Jsonnet might just be my "one JSON-generation language to rule them all"!


    Though if Starlark is your thing, do checkout out skycfg[1]

    [0] -

    [1] -

  • rules_r

    R rules for Bazel

  • rules_py

    More compatible Bazel rules for running Python tools and building Python projects

  • rules_cc_module

    Rules for using C++20 modules with bazel

  • rules_graalvm

    Bazel rules to make JVM binaries into native binaries

    Project mention: New GraalVM Rules for Bazel | | 2023-08-13
  • Revelo Payroll

    Free Global Payroll designed for tech teams. Building a great tech team takes more than a paycheck. Zero payroll costs, get AI-driven insights to retain best talent, and delight them with amazing local benefits. 100% free and compliant.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-08-19.

Starlark bazel-rules related posts


What are some of the best open-source bazel-rule projects in Starlark? This list will help you:

Project Stars
1 rules_docker 1,056
2 rules_nodejs 706
3 rules_rust 548
4 rules_python 463
5 rules_apple 442
6 rules_scala 340
7 bazel-skylib 326
8 rules_swift 282
9 bazel-coverage-report-renderer 254
10 rules_proto_grpc 231
11 rules_js 227
12 rules_nixpkgs 226
13 rules_cc 144
14 rules_gitops 140
15 platforms 87
16 rules_ts 68
17 rules_scala 65
18 gcc-toolchain 65
19 rules_jsonnet 61
20 rules_r 39
21 rules_py 38
22 rules_cc_module 36
23 rules_graalvm 12
Collect and Analyze Billions of Data Points in Real Time
Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.