Bazel

Practical Bazel: Supporting Trinary Stamp Attributes
Practical Bazel bazel stamping
Published: 2023-03-06
Practical Bazel: Supporting Trinary Stamp Attributes

In Bazel, stamping is the process of embedding additional information into built binaries, such as the source control revision or other workspace-related information. Rules that support stamping typically include an integer stamp attribute, where 1 means “always stamp”, 0 means “never stamp”, and -1 means “use the Bazel build --stamp flag. This blog post explains how to write a rule that supports these values.

Read more...
Practical Bazel: local_archive() Workspace Rule
Practical Bazel bazel
Published: 2023-03-01
Practical Bazel: local_archive() Workspace Rule

In general, one should never check in binary artifacts into Git; it is better to retrieve them from an artifact repository or a website using http_archive(). However, sometimes convenience is more important than ideological purity. To handle these cases, I wrote a simple workspace rule named local_archive().

Read more...