Addresses
Every target has an address: the //-prefixed path that names it across the
whole workspace. You use addresses on the command line and wherever one target
references another.
//app:server
//lib/auth:lib
//proto:api
Anatomy
//lib/auth:lib
└──┬──┘ └┬┘
package name
- package — the workspace-relative directory, after the
//. The root package is the empty string, written//:name. - name — the target's name within that package, after the
:.
Relative forms
Inside BUILD files you can write addresses relative to the current package
instead of spelling out the full //package:name path. heph resolves them
against the package that owns the BUILD file.
| Form | Resolves to |
|---|---|
:name | //current/pkg:name |
./sub:name | //current/pkg/sub:name |
../sibling:name | //current/sibling:name |
See Buildfile → Relative addresses for examples.
Package matchers
Some commands (such as heph inspect packages) accept a package matcher
instead of a single address. Matchers select one or more packages at once.
| Pattern | Selects |
|---|---|
//pkg | exactly //pkg |
//pkg/... | //pkg and every package beneath it |
. | the package matching the current working directory |
... | the current package and every package beneath it |
./sub | //current/pkg/sub |
./sub/... | //current/pkg/sub and everything beneath it |
../sibling | //current/sibling |
# All packages rooted at //lib:
heph inspect packages //lib/...
# Packages in and below the current directory:
heph inspect packages ...
Output-group selector
A target can publish several output groups.
Append |group to an address to depend on just one of them:
//app:compile|bin # only the "bin" group of //app:compile
Without a selector, the address refers to the target's default output group.
Built-in @heph/* packages
Some plugins expose targets under reserved @heph/* packages. They are resolved
on demand — you reference them, you don't define them.
| Address | Owned by | Purpose |
|---|---|---|
//@heph/bin:<tool> | Hostbin | Wrap a binary already on the host PATH. |
//@heph/fs:file@f=<path> | Filesystem | Reference a single workspace file. |
//@heph/fs:glob@p=<pattern>@e=<excludes> | Filesystem | Reference files by glob. |
//@heph/query:query@expr=<expr> | Query | Group targets matching a query expression. |
//@heph/go/std/<pkg> | Go | A Go standard-library package. |
//@heph/go/thirdparty/<module>@<version> | Go | A pinned third-party Go module. |
//@heph/introspect:outputs | engine | A target's own declared outputs, used by in-place codegen. |
You rarely type the @heph/fs or @heph/query addresses by hand. Use the
file(), glob(), and query() builtins
to generate them, or pass -e <expr> directly to heph run / heph query.
The table is here so you can recognize them in a dependency graph.