2 days ago

Hi everyone,

I’m happy to announce the availability of rules_d — the Bazel ruleset for the D programming language, now with Bazel module (Bzlmod) support.

The goal of this project is to make D a first-class citizen in the Bazel ecosystem, so that you can build, test, and package D code alongside C++, Rust, Go, or any other languages supported by Bazel, all within the same build graph.

Current Features

  • d_binary and d_library rules for compiling D source files
  • d_test rule for unit testing
  • Support for multiple D compilers (DMD, LDC)
  • Dependency handling and incremental builds via Bazel
  • Interop with C/C++: d_binary, d_library and d_test targets can depend on cc_library targets
  • Distributed via Bzlmod for straightforward integration:
bazel_dep(name = "rules_d", version = "0.1.3")

Get Involved

The project has been freshly reimplemented for bzlmod, so feedback and contributions are very welcome.

I’m also looking for a co-maintainer. If you’re interested in Bazel, D, and polyglot build systems, please reach out!

If you’re already using Bazel or curious about experimenting with D in larger polyglot codebases, give it a try and let me know how it works for you.

Looking forward to your feedback!

Dragos C.