Skip to content
devhusdkPublic

About

Bazel developer platform: one dx CLI for build, test, lint, typecheck, format, generate, audit, and release. Toolchains come from Bazel; no separate installs.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4,606 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rules_dx

rules_dx is a Bazel developer platform with one dx CLI for build, test, lint, typecheck, format, generate, audit, and release tasks. Language toolchains come from Bazel. No separate installs.

Status: rules_dx is not released yet. Install starts with the first BCR release.

Quickstart

Bazel via Bazelisk is required. In an empty directory, create four files.

.bazelversion:

9.2.0

MODULE.bazel:

bazel_dep(name = "rules_dx", version = "<release>")

BUILD.bazel:

# Empty on purpose: rules_rust crate_universe needs a root package.

.bazelrc:

common --repo_env=DO_NOT_TRACK=1

Then:

bazel run @rules_dx//:dx -- init --apply
tools/dx test //...

After that, run dx through the launcher:

tools/dx --help
tools/dx build //...

Behind a proxy or a company CA? See Corporate proxy and custom CA.

Which dx binary runs

In your module, @rules_dx//:dx will run the dx binary for the target platform, checked against the sha256 in cli/prebuilt/pins.bzl. Release binaries are planned for linux x86_64, linux aarch64, macos aarch64, windows x86_64 and windows aarch64. Until a release ships, a version with no pinned sha256 builds dx from source, with the Rust and C toolchains dx init sets up. Once some binary is pinned, platforms with no release binary fail the build. To pick a binary yourself, add this to your root MODULE.bazel:

dx_prebuilt = use_extension("@rules_dx//cli/prebuilt:extension.bzl", "dx_prebuilt")
dx_prebuilt.asset(name = "dx-linux-x86_64", url = "https://...", sha256 = "...")

Or build dx from source with dx_prebuilt.from_source(). That needs Rust and C toolchains. Only the root module's tags count.

dx init --apply writes the overrides rules_dx needs; see patches/README.md.

A global dx shim for PATH is built from //cli/shim. It runs the version in .dx/pins without Bazel. See Global Shim.

Next

tutorial, docs index, Bazel for dx users, adopting rules_dx in an existing Bazel repo, adopting rules_dx without Bazel experience, command reference, examples, CI, support matrix, and the docs site.

What rules_dx replaces

You get:

  • One dx CLI instead of per-language scripts.
  • Pinned toolchains, so nobody installs tools per machine.
  • Lint, format, and typecheck locally and in CI.
  • Security and license audits with dx security and dx license; see audit and update.
  • A CI workflow from dx init --apply; see init.
  • It replaces hand-picked rule-set versions, a Makefile or shell wrapper around Bazel, and CI config per language.

It costs:

  • Bazel and its learning curve: BUILD files and MODULE.bazel.
  • The files dx init writes: launcher, editor, devcontainer, CI and agent files; see init.
  • Following the pinned rule and tool versions. You move when you run dx upgrade.
  • Patched upstream overrides that dx init --apply writes to third_party/rules_dx/; see rules_dx overrides and patches/README.md.

Contributing

See Contributing for the current workflow.

License

rules_dx is licensed under Apache-2.0.

About

Bazel developer platform: one dx CLI for build, test, lint, typecheck, format, generate, audit, and release. Toolchains come from Bazel; no separate installs.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages