Thanks to visit codestin.com
Credit goes to bazel.virtuslab.com

VirtusLabBazel Knowledge Hub
Level 0

The Anatomy

Workspace, packages, labels, and Starlark

Read a Bazel repository with confidence: find the root, identify packages, understand labels, and scan BUILD files as declarations instead of scripts.

The Anatomy cover

Level 0 teaches you how to enter a Bazel repository and understand what you are looking at. Before commands are useful, the checkout needs coordinates: where the repository starts, which package owns a file, how targets are named, and why a BUILD file is not an ordinary script.

The Anatomy Shape

0.1 Filesystem Hierarchy gives the physical map. Bazelisk and .bazelversion explain which Bazel binary runs. Repository markers define the root. BUILD files divide the tree into packages. The output tree explains why generated artifacts live outside the source directories you edit.

0.2 Language of Labels turns that map into addresses. The same notation family shows up in dependency lists, command-line target patterns, visibility rules, package groups, and later query output. Once //pkg:target, :target, and //... become coordinates instead of punctuation, many errors get easier to read.

0.3 Starlark Syntax Basics teaches the BUILD-file reading habit. The syntax may look Python-shaped, but the useful first pass is structural: what was loaded, which package defaults apply, which targets exist, and what their attributes mean.

How To Use It

Read 0.1 Filesystem Hierarchy and 0.2 Language of Labels before debugging commands or dependency lists. Read 0.3 Starlark Syntax Basics when a BUILD file looks like code that should be executed top to bottom. At this level, the win is recognition: know what kind of thing you are reading and which layer it belongs to.

key takeaway

Level 0 turns a checkout from "folders and files" into a build workspace with roots, packages, labels, and declarations. Later commands only make sense once those coordinates are visible.