From 06ae935e731f82e0b098a4a008e52149836f00e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 19:02:29 +0000 Subject: [PATCH] docs: clarify glob() exclude resolves like pattern heph PR #399 (97c5f48) fixed glob() so exclude entries resolve package-relative (or workspace-root-relative under abs=True) just like pattern, instead of being passed through raw. Document the resolved behavior in the buildfile guide and its heph-expert skill reference twin. Ref: hephbuild/heph#399 --- plugins/heph-expert/skills/heph/references/authoring.md | 5 +++++ website/docs/plugins/buildfile.md | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/plugins/heph-expert/skills/heph/references/authoring.md b/plugins/heph-expert/skills/heph/references/authoring.md index 3f918b8..7f272a2 100644 --- a/plugins/heph-expert/skills/heph/references/authoring.md +++ b/plugins/heph-expert/skills/heph/references/authoring.md @@ -69,6 +69,11 @@ Both resolve to filesystem (`//@heph/fs:…`) addresses, so their results drop straight into a dependency field. Paths are relative to the BUILD file's package by default; pass `abs=True` to resolve from the workspace root. +For `glob()`, `exclude` resolves exactly like `pattern` — package-relative by +default, workspace-root-relative under `abs=True`. A package-relative +`exclude=["vendor/**"]` in `//pkg` excludes `pkg/vendor/**`, not a root-level +`vendor/**`; add `abs=True` to exclude from the workspace root instead. + ```python title="BUILD" target( name = "lib", diff --git a/website/docs/plugins/buildfile.md b/website/docs/plugins/buildfile.md index 5103230..6b44208 100644 --- a/website/docs/plugins/buildfile.md +++ b/website/docs/plugins/buildfile.md @@ -156,6 +156,12 @@ normalized — `./` prefixes and empty segments are collapsed, `..` components resolve against the package path, and a path whose `..` segments escape the workspace root is an error. +For `glob()`, `exclude` resolves exactly like `pattern` — package-relative by +default, workspace-root-relative under `abs = True`. A package-relative +`exclude = ["vendor/**"]` in `//pkg` excludes `pkg/vendor/**`, not a +root-level `vendor/**`; write `exclude = ["vendor/**"], abs = True` to exclude +from the workspace root instead. + ### `target()` — what buildfile reads, and what it forwards `target()` interprets only the fields that describe the target to the engine —