Skip to content

build: depend on helly25_mbo 0.11.1 from BCR (drop git_override) - #45

Merged
helly25 merged 1 commit into
mainfrom
chore/bump-mbo-0.11.1
Jun 20, 2026
Merged

build: depend on helly25_mbo 0.11.1 from BCR (drop git_override)#45
helly25 merged 1 commit into
mainfrom
chore/bump-mbo-0.11.1

Conversation

@helly25

@helly25 helly25 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

helly25_mbo was pinned to a main commit via git_override because the fixes our test conventions rely on — the macOS clang+asan verification (#188) and the StatusIs code-matcher support (#190) — were unreleased at the time.

Both ship in mbo 0.11.1, which is published in the Bazel Central Registry. So the override is now pure cruft: depend on the registry version like every other module (abseil-cpp, re2, googletest, …).

-bazel_dep(name = "helly25_mbo", version = "0.11.0", repo_name = "com_helly25_mbo")
-git_override(
-    module_name = "helly25_mbo",
-    commit = "5b0e36b2103bbbb6e08f6585edcf7c4dc65e00b7",
-    remote = "https://github.com/helly25/mbo.git",
-)
+bazel_dep(name = "helly25_mbo", version = "0.11.1", repo_name = "com_helly25_mbo")

MODULE.bazel.lock already carries the BCR helly25_mbo/0.11.1 MODULE.bazel + source.json hashes and no longer references any git ref; bazel mod graph --lockfile_mode=update leaves it untouched, so no lock change is needed.

Test plan

  • bazel mod graph resolves helly25_mbo@0.11.1 from BCR with no errors.
  • Green on both toolchains: bazel test //... (default) and --config=clang --config=asan — including the fields constexpr LimitedMap dispatch that uses mbo's container.

0.11.0 was pinned to a main commit via git_override because the macOS
clang+asan verification (#188) and the StatusIs code-matcher (#190) we
rely on were not yet in a release. Both ship in the 0.11.1 BCR release,
so the override is no longer needed -- depend on the registry version
like every other module.

MODULE.bazel.lock already carries the BCR 0.11.1 MODULE.bazel/source.json
hashes (no git refs remain), so no lock change is required.
@helly25
helly25 merged commit 57fe1bd into main Jun 20, 2026
4 checks passed
@helly25
helly25 deleted the chore/bump-mbo-0.11.1 branch June 20, 2026 17:47
helly25 added a commit that referenced this pull request Jun 28, 2026
…oadmap decisions (#193)

Per the directive to put enforcement rules in the repo, not just memory:

AGENTS.md gains two sections:
- Self-documenting features: the registry + globals are the doc SOT; every
  feature add/change updates its Descriptor.summary / GlobalFlag entry +
  kHelpText in the same change, so --help/--man/--markdown stay complete.
- CLI conventions: flag scope by dash count (--global vs -primary; -h/-q/-help/
  -version are special-cased compat globals); flag-only, no subcommands; and a
  user-toggleable boolean capability is a --feature, not a one-off flag.

TODO.md roadmap decisions (design phase, accounting for existing code):
- #43 parallel traversal + --sort: already BUILT (ReadPool, sort modes, tests,
  tsan cell); remaining is a CLI bashtest.
- #45 --exact/--path-encoding: default = filesystem-native (natural per-platform
  case behavior); --exact forces verbatim byte matching; --path-encoding=raw|escape.
- #73 --feature: PARKED (no customer yet) with the full ready-to-build design +
  a trigger (first boolean capability builds it); trigger mirrored in AGENTS.md.
- #54 mode mechanism: subsumed by --config (no --mode flag; --modern deferred).
helly25 added a commit that referenced this pull request Jun 28, 2026
#194)

The plain renderer can now C-escape path bytes so a newline or control
character in a filename cannot corrupt the line-oriented -print stream:
--path-encoding=escape turns `\` and control bytes into `\\`, `\n`, `\t`,
`\r`, or `\xNN`; raw (the default) stays verbatim and find-compatible. It
applies to the plain format only -- kNul keeps raw bytes (the NUL is the
separator) and kJsonl always JSON-escapes.

render::Renderer gains a PathEncoding; run.cc ResolvePathEncoding mirrors
ResolveFormat (last wins, raw default) and feeds the implicit-print renderer.
Self-documented via the globals table + kHelpText (so --help/--man/--markdown
list it). render_test covers escape/raw and that it applies only to plain.

The other half of #45 (--exact, filesystem-native matching) remains.
helly25 added a commit that referenced this pull request Jun 28, 2026
…rxc (regex) (#195)

* cli: add --path-encoding=raw|escape for safe plain output (#45 part 1)

The plain renderer can now C-escape path bytes so a newline or control
character in a filename cannot corrupt the line-oriented -print stream:
--path-encoding=escape turns `\` and control bytes into `\\`, `\n`, `\t`,
`\r`, or `\xNN`; raw (the default) stays verbatim and find-compatible. It
applies to the plain format only -- kNul keeps raw bytes (the NUL is the
separator) and kJsonl always JSON-escapes.

render::Renderer gains a PathEncoding; run.cc ResolvePathEncoding mirrors
ResolveFormat (last wins, raw default) and feeds the implicit-print renderer.
Self-documented via the globals table + kHelpText (so --help/--man/--markdown
list it). render_test covers escape/raw and that it applies only to plain.

The other half of #45 (--exact, filesystem-native matching) remains.

* Add content-search predicates: -content/-icontent (literal) + -rxc/-irxc (regex)

File-content search (rg/fd parity): the xff counterpart of -name/-regex, but over
a file's bytes instead of its path.

  -content STR / -icontent STR   literal substring (i = ASCII case-fold)
  -rxc RE / -irxc RE             RE2 regex, unanchored (PartialMatch)

All four are xff extensions (--config=find rejects them) and Cost::kExpensive (they
read the file). Binary files are skipped by default via a NUL-byte sniff over the
first 8 KiB (grep/ripgrep behaviour). The name -grep was deliberately rejected:
grep's BRE/ERE/-P flavor baggage is ambiguous for both a literal and a
single-flavor-regex predicate.

Mechanism:
- regex::Matcher::PartialMatch (RE2::PartialMatch), backing -rxc/-irxc.
- vfs::FileSystem::ReadContent (whole-file read) across all implementers: LocalFs
  uses a POSIX read loop, DryRunFileSystem delegates, the test fakes stub it.
- evaluate.cc ContentToSearch (type-gate + read + binary sniff) + EvalContent/EvalRxc.
- parser CompileNodeRegex precompiles -rxc/-irxc like -regex/-iregex.

Self-documentation in the same change (registry SOT): four Descriptor summaries
(flow into --help / --help=NAME / --man / --markdown), the kHelpText expression
summary, and a resolved-names note in docs/design.md superseding the
-contains/-grep placeholders.

Tests: regex PartialMatch; LocalFs::ReadContent; evaluate_test literal / regex /
case-fold / binary-skip / non-regular; content_test.sh end-to-end (incl. find-style
gating and the --help topic).
helly25 added a commit that referenced this pull request Jul 2, 2026
Foundation for xff's FS-native name matching: a per-volume case-sensitivity
query on the FileSystem interface. LocalFs answers it via
pathconf(_PC_CASE_SENSITIVE) on macOS/BSD (1 = case-sensitive, 0 = folding); on
Linux, where glibc has no such name, it reports case-sensitive (ext4/xfs/btrfs
default; per-directory casefold via statx STATX_ATTR_CASEFOLD is a later
refinement). An unprobeable volume falls back to case-sensitive (byte-exact),
which is always find-faithful.

The engine's DryRunFileSystem forwards it; the walk/run test fakes return
case-sensitive. local_fs_test cross-checks the probe against the volume's actual
behaviour (whether FILE.TXT resolves to a lower-case file.txt), so it is correct
on both case-sensitive and case-folding runners without hard-coding a platform.

No behaviour change yet: --exact and the FS-native -name default consume this
next.
helly25 added a commit that referenced this pull request Jul 2, 2026
* Add --exact / FS-native name matching (#45)

The xff style now matches -name / -path the way the entry's own volume resolves
names: on a case-folding volume (APFS / HFS+ default, NTFS, exFAT) a lower-case
-name pattern matches a mixed-case file, the way the OS itself would resolve the
lookup; on a case-sensitive volume (ext4 and friends) it stays byte-exact. This
fixes find's surprising miss on macOS where -name foo.txt skips Foo.txt.

--exact opts out, forcing verbatim byte-exact matching regardless of the volume;
the find style is always byte-exact (drop-in faithful), as is the conservative
in-process (nullopt-style) default. The -iname / -ipath variants fold regardless;
regex keeps its own -iregex.

Mechanics: run.cc resolves the FS-native policy once (xff style and not --exact),
then per entry consults vfs::IsCaseSensitive cached by device id (single-threaded
visitor, no lock), setting EvalContext::fold_name_case for a folding volume; a
probe miss/error falls back to case-sensitive. EvalName/EvalPath OR that into the
descriptor's fold_case.

Self-doc: --exact in globals.cc + kHelpText (Matching). design.md reconciles the
older tri-state sketch to the shipped boolean (case only; NFC/NFD + fuzzy stay
deferred); TODO.md #45 marked shipped.

Tests: evaluate_test (fold_name_case folds -name/-path, -iname still folds);
run_test (CaseFoldFs: xff folds, --exact / find / nullopt stay byte-exact,
exact-case always matches); exact_test.sh end-to-end, volume-probed so it holds on
case-sensitive and folding runners. bazel test //... green (37).

* shfmt: single space before trailing comments in exact_test.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant