Starlark Bazel

Open-source Starlark projects categorized as Bazel

Top 23 Starlark Bazel Projects

  • distroless

    🥑 Language focused docker images, minus the operating system.

    Project mention: Reddit temporarily ban subreddit and user advertising rival self-hosted platform (Lemmy) | /r/selfhosted | 2023-06-07

    Docker doesn't do this all the time. Distroless Docker containers are relatively common.

  • 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.

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • rules_nodejs

    NodeJS toolchain for Bazel.

    Project mention: Vercel announces Turbopack, the successor to Webpack | | 2022-10-25

    Bazel is just the infrastructure to run webpack. You'd need to do some work to make webpack's state be cacheable (I dunno what options and such it has for this, maybe it's already there as an option). But if you're looking at Bazel for JS work you probably just want to use the existing and maintained rules for it: It's been a while since I last looked at it but I don't think it has any caching for webpack.

  • examples

    Examples for Bazel (by bazelbuild)

  • rules_foreign_cc

    Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja)

    Project mention: Using Bazel and Conan for external dependencies | /r/bazel | 2022-07-09

    Hello, readline or ncurses can be built using bazel rules foreign cc. Just in case…

  • rules_rust

    Rust rules for Bazel

    Project mention: When to Use Bazel? | | 2022-09-13

    Bazel doesn't allow targeting a lot of platforms (especially embedded) from Rust, even when the Rust ecosystem supports these targets. Something is off with its design if new work needs to be done for every platform that's already available behind an interface that's as consistent as what rustc gives.

    What is supported needs to be inferred from this file, as far as I can tell:

  • rules_python

    Bazel Python Rules

    Project mention: Build faster with Buck2: Our open source build system | | 2023-04-06

    Regarding bazel, the rules_python has a py_wheel rule that helps you creating wheels that you can upload to pypi (

    If you want to see an approach of bazel to pypi taken a bit to the extreme you can have a look at tensorflow on GitHub to see how they do it. They don't use the above-mentioned building rule because I think their build step is quite complicated (C/C++ stuff, Vida/ROCm support, python bindings, and multiOS support all in one before you can publish to pypi).

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • 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()

  • bazel-compilation-database

    Tool to generate compile_commands.json from the Bazel build system

  • rules_scala

    Scala rules for Bazel

  • bazel-skylib

    Common useful functions and rules for Bazel

  • rules_jvm_external

    Bazel rules to resolve, fetch and export Maven artifacts

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

    git_repository( name = "rules_jvm_external", remote = "", tag = "4.2", ) load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ "androidx.appcompat:appcompat:1.3.0", "", "androidx.constraintlayout:constraintlayout:2.0.4", ], repositories = [ "", ], )

  • 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.

    Project mention: Is there some truth to this hyperbole? "Haskell is beautiful and elegant, but unmaintainable and painful" | /r/haskell | 2022-06-27

    There's for that.

  • rules_proto_grpc

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

    Project mention: Stuck with a protoc version mismatch problem | /r/bazel | 2022-09-15
  • bazel-toolchain

    LLVM toolchain for bazel

    Project mention: cc toolchain for macOS Monterey / Apple M1 | /r/bazel | 2022-12-01

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") BAZEL_TOOLCHAIN_TAG = "0.7.2" BAZEL_TOOLCHAIN_SHA = "f7aa8e59c9d3cafde6edb372d9bd25fb4ee7293ab20b916d867cd0baaa642529" http_archive( name = "com_grail_bazel_toolchain", sha256 = BAZEL_TOOLCHAIN_SHA, strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG), canonical_id = BAZEL_TOOLCHAIN_TAG, url = "{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG), ) load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") bazel_toolchain_dependencies() load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") llvm_toolchain( name = "llvm_toolchain", llvm_version = "15.0.5", ) load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") llvm_register_toolchains() http_archive( name = "com_google_googletest", urls = [""], strip_prefix = "googletest-609281088cfefc76f9d0ce82e1ff6c30cc3591e5", )

  • 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.

  • bazel-embedded

    Tools for embedded/bare-metal development using bazel

  • 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_scala

    Robust and featureful Bazel rules for Scala (by higherkindness)

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

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-06-07.

Starlark Bazel related posts


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

Project Stars
1 distroless 15,690
2 rules_docker 1,038
3 rules_nodejs 700
4 examples 685
5 rules_foreign_cc 598
6 rules_rust 505
7 rules_python 439
8 rules_apple 425
9 bazel-compilation-database 414
10 rules_scala 335
11 bazel-skylib 303
12 rules_jvm_external 272
13 rules_swift 270
14 bazel-coverage-report-renderer 250
15 rules_proto_grpc 214
16 bazel-toolchain 208
17 rules_js 205
18 rules_nixpkgs 204
19 rules_cc 130
20 rules_gitops 124
21 bazel-embedded 79
22 platforms 78
23 rules_scala 64
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives