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 www.getonboard.dev. Learn more →
Top 23 Starlark bazel-rule Projects
-
My company uses Bazel's rules docker to build our images: https://github.com/bazelbuild/rules_docker
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.
-
-
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.
-
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".
-
Project mention: Python coverage in Bazel has been broken for nearly 6 years | news.ycombinator.com | 2023-08-19
-
Project mention: A Comprehensive guide to build a cross-platform application by Bazel | dev.to | 2022-11-17
git_repository( name = "build_bazel_rules_apple", remote = "https://github.com/bazelbuild/rules_apple.git", tag = "1.1.3", ) git_repository( name = "build_bazel_rules_swift", remote = "https://github.com/bazelbuild/rules_swift.git", tag = "1.2.0", ) load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") swift_rules_dependencies()
-
-
-
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 www.getonboard.dev.
-
Project mention: A Comprehensive guide to build a cross-platform application by Bazel | dev.to | 2022-11-17
git_repository( name = "build_bazel_rules_apple", remote = "https://github.com/bazelbuild/rules_apple.git", tag = "1.1.3", ) git_repository( name = "build_bazel_rules_swift", remote = "https://github.com/bazelbuild/rules_swift.git", tag = "1.2.0", ) load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") swift_rules_dependencies()
-
-
rules_proto_grpc
Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets
-
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.
-
-
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. https://github.com/bazelbuild/rules_cc/blob/main/cc/system_l...
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.
-
-
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 https://github.com/bazelbuild/platforms. See https://github.com/bazelbuild/bazel/issues/8622 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
-
Project mention: Building a modern gRPC-powered microservice using Node.js, Typescript, and Connect | dev.to | 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 // > https://github.com/aspect-build/rules_ts/issues/159#issuecomment-1437399901 // > https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1270716220 import type {} from "@bufbuild/protobuf"; export const transport = createConnectTransport({ baseUrl: `http://localhost:8080`, httpVersion: "1.1", }); export const client = createPromiseClient(StateTransitionService, transport);
-
-
-
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]
-
-
-
-
-
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.
Starlark bazel-rules related posts
- Python coverage in Bazel has been broken for nearly 6 years
- Bazel jasmine_test issue
- Any nice patterns for releasing libraries?
- Bazel Build Rules for Standard ML
- When to Use Bazel?
- An ex-Googler's guide to dev tools
- Incremental Builds for Haskell with Bazel
-
A note from our sponsor - Onboard AI
getonboard.dev | 4 Oct 2023
Index
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 |