Skip to content

An example of bazel's stamp feature to embed git shas and other info into produced binaries

License

Notifications You must be signed in to change notification settings

keith/bazel-stamp-example

Repository files navigation

bazel-stamp-example

This is an example repo using bazel's under-documented "stamp" feature to embed information into your final binary in a relatively safe way.

Example

The binary_example target in the root root BUILD file is the standard example of linkstamps where you have a cc_library with the linkstamp attribute, and depend on that from a binary that sets stamp = 1.

The genrule_example target in the root BUILD file is an example for when you don't have a top level binary you can set stamp = 1 on (even though in this example we still use a cc_binary to demonstrate it working). This is useful for the case you want to embed this specific information into a static library that you vendor.

About

An example of bazel's stamp feature to embed git shas and other info into produced binaries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published