bazelbuild/rules_jsonnet

Jsonnet rules for Bazel

72

stars

155

commits

Starlark

primary language

Sep 4, 2026

updated

bazelbuild.github.io/rules_jsonnet/
bazel
bazel-rules
jsonnet
jsonnet-rules

README

Build status

Jsonnet Rules

Overview

These are build rules for working with Jsonnet files with Bazel.

Setup

To use the Jsonnet rules as part of your Bazel project, please follow the instructions on the releases page.

Jsonnet Compiler Selection

By default for Bzlmod, Bazel will use the Go compiler. Note that the primary development focus of the Jsonnet project is now with the Go compiler. This repository's support for using the C++ compiler is deprecated, and may be removed in a future release.

To use the C++ or Rust compiler of Jsonnet instead, register a different compiler:

Jsonnet compilerMODULE.bazel directive
Gojsonnet.compiler(name = "go")
cppjsonnet.compiler(name = "cpp")
Rustjsonnet.compiler(name = "rust")

CLI

Use the --extra_toolchains flag to pass the preferred toolchain to the bazel invocation:

bazel build //... --extra_toolchains=@rules_jsonnet//jsonnet:cpp_jsonnet_toolchain

bazel test //... --extra_toolchains=@rules_jsonnet//jsonnet:rust_jsonnet_toolchain

bazel run //... --extra_toolchains=@rules_jsonnet//jsonnet:go_jsonnet_toolchain

Rule usage

Please refer to the StarDoc generated documentation for instructions on how to use these rules.

Contributors

(top 30 of 46)

renovate[bot]

32 commits

EdSchouten

25 commits

davidzchen

16 commits

markusdap

11 commits

bazelbuild/rules_jsonnet

Jsonnet rules for Bazel

72

stars

155

commits

Starlark

primary language

Sep 4, 2026

updated

bazelbuild.github.io/rules_jsonnet/
bazel
bazel-rules
jsonnet
jsonnet-rules

README

Build status

Jsonnet Rules

Overview

These are build rules for working with Jsonnet files with Bazel.

Setup

To use the Jsonnet rules as part of your Bazel project, please follow the instructions on the releases page.

Jsonnet Compiler Selection

By default for Bzlmod, Bazel will use the Go compiler. Note that the primary development focus of the Jsonnet project is now with the Go compiler. This repository's support for using the C++ compiler is deprecated, and may be removed in a future release.

To use the C++ or Rust compiler of Jsonnet instead, register a different compiler:

Jsonnet compilerMODULE.bazel directive
Gojsonnet.compiler(name = "go")
cppjsonnet.compiler(name = "cpp")
Rustjsonnet.compiler(name = "rust")

CLI

Use the --extra_toolchains flag to pass the preferred toolchain to the bazel invocation:

bazel build //... --extra_toolchains=@rules_jsonnet//jsonnet:cpp_jsonnet_toolchain

bazel test //... --extra_toolchains=@rules_jsonnet//jsonnet:rust_jsonnet_toolchain

bazel run //... --extra_toolchains=@rules_jsonnet//jsonnet:go_jsonnet_toolchain

Rule usage

Please refer to the StarDoc generated documentation for instructions on how to use these rules.

Contributors

(top 30 of 46)

renovate[bot]

32 commits

EdSchouten

25 commits

davidzchen

16 commits

markusdap

11 commits

Languages

Starlark

95.6%

Python

4.4%