Kentaro Hayashi: Building Mozc with dh-bazel, buildsystem support for debhelper
Introduction
After bazel-bootstrap 7.7.1 was landed into Debian unstable, I'm working on packaging newer Mozc (Most famous Japanese input method editor) with Bazel.
Here is the blog entry initial efforts to build Mozc with Bazel at that time.
Why dh-bazel?
After that, newer Mozc packages are uploaded into experimental and moved to testing phase on experimental now.
When started packaging efforts for newer Mozc with Bazel, I'm a newbie to do it. Now I've got a knowledge to do it a bit, I want to know best practice on packaging X on Debian with Bazel furturmore.
Usually there are dh-X for buildsystem X on Debian, but it's not true for Bazel as far as I know. This is why I had started to write dh-bazel.
I've wrote initial dh-bazel prototype and post a mail to debian-bazel ML.
dh-bazel supports the following way:
%:
dh $@ --buildsystem=bazel
override_dh_auto_build:
dh_auto_build -- //:hello
If you want to build source under src, you could write d/rule like this:
%:
dh $@
override_dh_auto_build:
dh_auto_build --buildsystem=bazel --sourcedirectory=src -- //:hello
Conclusion
dh-bazel is in very early stage prototype, but I have succeeded to build newer Mozc with some modifications to Mozc debian/rules on experimental with dh-bazel locally!
dh-bazel is a thin wrapper for Bazel, so it does not reduce packaging glitches dramatically, but it helps some sort of packaging tasks IMHO.
There are some achievement with dh-bazel
- It helps to do similar building way like other debhelper buildsystem
- It sets comprehensive Bazel startup options
- It sets comprehensive Bazel command options
- If you want to set extra flags, just specify it as additional user options (
--override_module=, and so on)
Note that it only simplify dh_auto_build stage, so you must manually install artifacts
with .install or something correctly.
I hope that it will help package maintainer using Bazel in the future. (dh-bazel is not uploaded into debian/unstable yet, so stay tuned!)