Collecting transitive runfiles with skylark

Bazel has a concept it calls runfiles for files that a binary uses during execution. For example, a binary might need to read in a CSV, an ssh key, or a .json file. These files are generally specified separately from your sources for a couple of reasons: Bazel can understand that it is a runtime,Continue reading “Collecting transitive runfiles with skylark”

Startup idea #6ec4e42a-28cc-4425-9ebc-61ac8e224580: Adventurer’s gear for geeky hikers

I’m going to start “calling” my startup ideas in the same way Andy Dwyer calls band names. So, first up: it’s like REI for D&D players. We’d sell a “basic adventurer’s kit” that came with iron rations, wineskin, torches, 50 feet of rope, etc. Then you could get “class specialization” kits, for example: Rogue: containsContinue reading “Startup idea #6ec4e42a-28cc-4425-9ebc-61ac8e224580: Adventurer’s gear for geeky hikers”

Using a generated header file as a dependecy

Someone asked me today about how to use a generated header as a C++ dependency in Bazel, so I figured I’d write up a quick example. Create a BUILD file with a genrule that generates the header and a cc_library that wraps it, say, foo/BUILD: genrule( name = “header-gen”, outs = [“my-header.h”], # This commandContinue reading “Using a generated header file as a dependecy”

Operation: Crappy Sewing Machine commences

This weekend, I went to a bra-making workshop and won a sewing machine in a raffle. It isn’t really crappy, but I spent a couple of hours un-jamming it, so I’m bitter. The interesting thing about this machine is that it has a built-in camera, so you can take photos and video of exactly whatContinue reading “Operation: Crappy Sewing Machine commences”

configure: error: lib_i_don’t_care_about.so not found.

I work on Bazel, so I don’t usually get to see it from a user’s point of view. However, yesterday I added seven new projects to Bazel’s continuous integration, all of which promptly broke. I started cloning them and trying to fix them. These projects were various user-contributed rules for Bazel: rules for building Go,Continue reading “configure: error: lib_i_don’t_care_about.so not found.”

Star Trek invades our timeline

I was at Kennedy Space Center yesterday and they have an exhibit with all of the Apollo mission flags. Having mission flags is a great idea, more software launches should have flags, too. I noticed one in particular: (Please excuse the poor image quality, I have a technology-defying ability to take crappy photographs.) Those symbolsContinue reading “Star Trek invades our timeline”

Flag-Friday: debugging tests with –java_debug

To step through a Java test that you’re running with bazel test, use the –java_test flag: $ bazel test –java_debug //src/test/java/com/example:hello-test WARNING: Streamed test output requested so all tests will be run locally, without sharding, one at a time. INFO: Found 1 test target… Listening for transport dt_socket at address: 5005 At this point, switchContinue reading “Flag-Friday: debugging tests with –java_debug”

Saving the (prod) environment

You can create different environments (e.g., testing, prod, mobile, rainforest) with Bazel, then use them to make sure that targets only build with the right environment. This is a cool feature that’s undocumented (because it’s still in development, shhhhh, don’t tell anyone I told you about it). Let’s say you have a prod SSH keyContinue reading “Saving the (prod) environment”