Bazel & Go basics


TODO: This guide has not really been written yet. But here's a few bits and pieces you might find helpful to get started if you're not familiar with Bazel (until the full guide is written).

Installing Bazel on macOS

$ brew install bazelisk ibazel

You want to have bazelisk installed instead of bazel so that the correct version of Bazel is used instead of the latest one.

Bazel basics

$ bazel run //hswaw/site
$ bazel run //hswaw/laserproxy

This builds and runs project at specified depot paths.

You can pass flags to build product after --, like so:

$ bazel run //hswaw/site -- -hspki_disable

BTW: -hspki_disable is a common flag to use to run a project locally without HTTPS setup.

By convention, most projects will show you available flags like so:

$ bazel run //hswaw/laserproxy -- -h

For some projects, you might want interactive development, where rebuild happens automatically on any change to the project. In this case, replace bazel run with ibazel run.