Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(audit): accept bin/foo.exe as a match for provides: - bin/foo
On windows/* targets, make install produces `bin/foo.exe` instead
of `bin/foo`. Recipes that target multiple platforms shouldn't have
to enumerate both forms in `provides:` — extend the lookup to also
accept the `.exe` suffix as a fallback.

This is the brewkit hook @jhheider pointed at on #346
(audit/audit.ts line 46). It unblocks the jq Windows pilot
(pkgxdev/pantry#12987) which would otherwise fail the `provides:
- bin/jq` audit on its windows/x86-64 target (the actual binary is
`bin/jq.exe`).

Implementation: just expand the search list. Cost is one extra stat
per provided binary on non-Windows installs (no measurable impact);
zero false-positive risk because `.exe` files are unconventional on
POSIX systems.

No platform check at audit time — the audit runs over whatever's
in the cellar, doesn't need to know what target was built for. If
`foo.exe` exists, that's a real PE binary and counts as providing
`foo`.
  • Loading branch information
tannevaled committed May 22, 2026
commit ad332f9e51cd3e7e23c3828744b94340bc78206e
16 changes: 13 additions & 3 deletions audit/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ async function audit_provides(pkg: Package) {

for (const provide of await pantry.project(pkg).provides()) {
const name = moustaches.apply(provide, versionMap)
const bin = path.join('bin', name)
const sbin = path.join('sbin', name)
if (!bin.isExecutableFile() && !sbin.isExecutableFile()) {
// Windows targets ship binaries with `.exe` suffix. Recipes can
// keep `provides: - bin/foo` without enumerating both — we look
// for the unsuffixed name first (Linux/macOS), then fall back to
// `foo.exe` (windows/*). Cost: one extra stat per provide on
// non-Windows; zero false positives since `.exe` files are
// unconventional on POSIX.
const candidates = [
path.join('bin', name),
path.join('sbin', name),
path.join('bin', name + '.exe'),
path.join('sbin', name + '.exe'),
]
if (!candidates.some(p => p.isExecutableFile())) {
missing.push([pkg.project, name])
}
}
Expand Down
Loading