sebae banner ad-300x250
sebae intro coupon 30 off
sebae banner 728x900
sebae banner 300x250

with_cfg: Making transitions more accessible

0 views
0%

with_cfg: Making transitions more accessible

Bazel’s transitions are a very powerful concept that allows a rule and all its dependencies to be built with modified options such as compiler flags, build types or toolchain versions. While very useful, transitions are often regarded as complicated to use as they can only be directly attached to custom rules, not existing ones.

with_cfg is a new Starlark library that greatly reduces the amount of boilerplate required to create new rules out of old ones with an additional transition applied. Ever wanted a cc_asan_test that always runs a test with sanitizers or a java_21_library to use new language features in select parts of the codebase? After a quick introduction to transitions, this talk covers a number of such examples that all easily fit on a slide.

Speaker: Fabian Meumertzheim

Date: April 15, 2025