Repository navigation
Fix missing file hashes when running on windows system - #5341
Merged
Merged
Conversation
- add a `Unit tests (Windows)` job running a new `make unit:windows` task, scoped to the packages that own host path handling (tests needing linux docker fixtures are skipped) - `Unit tests` is now a gate job over the Linux and Windows unit jobs - add a resolver test asserting that locations from `AllLocations` resolve again via `FilesByPath` and use posix paths. This is expected to fail on windows today, which is why file digests come back empty for `dir:` scans (#5325) - fix windows-only test files that no longer compiled Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
force-pushed
the
triage/issue-5325-missing-hashes
branch
from
September 28, 2026 21:09
00d0808 to
9e18c6d
Compare
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- chroot paths are always posix (`ToChrootPath` no longer returns backslash paths on windows), same for the directory source name derived from `base` - `windows.FromPosix` no longer panics on input that isn't volume-encoded (e.g. relative or already native paths) - skip tests on windows that rely on symlink fixtures, shell script fixtures, or emulate windows paths on a posix host - disable `core.autocrlf` on the windows CI job so fixture digests match linux This leaves only the `FilesByPath` lookup failures from #5325. Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- `allContainedPaths` cleaned with the native separator but split on `/`, so a root reached through a symlink never had its ancestors indexed on windows - index assertions in tests now key on the posix path the index actually stores - skip symlink fixture tests and a posix-only test helper on windows Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- restore `go.sum` and `.make/go.sum` (accidentally populated by a local `-mod=mod` invocation) - revert the `allContainedPaths` separator change: production passes native windows paths there, and splitting them on `/` produces drive-relative ancestors, so skip the posix-only test on windows instead - annotate the remaining `filepath` usages that operate on native paths Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
The directory and file resolvers key their file tree on posix paths (`/c/some/path`), but `FilesByPath`, `HasPath` and root-anchored `FilesByGlob` searched it with the native path from the chroot context (`C:\some\path`). On windows every lookup silently missed, so anything that resolves files by path found nothing. This is why file digests were empty for `dir:` scans. Requests are now converted to posix before searching the tree. Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
marked this pull request as ready for review
September 29, 2026 01:37
wagoodman
enabled auto-merge (squash)
September 29, 2026 13:21
kzantow
reviewed
Sep 29, 2026
- check out text files with lf on every platform via `* text=auto eol=lf`, so windows checkouts match linux regardless of `core.autocrlf` - keep the fixtures that are intentionally crlf (jar manifests, etc) untouched with `-text` - drop the `core.autocrlf` step from the windows CI job, which this replaces Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
kzantow
approved these changes
Sep 30, 2026
spiffcs
added a commit
that referenced
this pull request
Sep 30, 2026
* main: (91 commits) feat: catalog CPAN distributions installed by perl clients (#5131) fix(binary): correct traefik version detection on big-endian arches (#5281) Fix hang when scanning a Java resource adapter (.rar) file (#5348) chore(deps): update SPDX license list (#5315) fix: match opensource.org license URLs across SPDX URL forms (#5361) Speed up unit tests in CI (#5360) Fix missing file hashes when running on windows system (#5341) Stop reading the mount table for every single-file source (#5257) fix: conan expat CPE (#5259) fix(spdx): write a name for the root package when the source has none (#5349) fix(python): link uv.lock dependents to the locked version they name (#5351) fix: suppress misleading upstream CPE for PHP extension binaries (#5102) fix: report scanner errors and raise the line cap in metadata parsers (#5353) Harden cataloger parsers against truncated input (do not panic) (#5355) fix(cpe): bound CPE candidate generation for pathological package metadata (#5356) test(golang): make the UPX fixture exercise loader padding (#5354) fix(golang): account for UPX's loader padding when unpacking Go binaries (#5347) test(snap): bound the kernel changelog bomb fixture by ratio, not a fixed 1MB (#5352) test(debian): bound the bomb fixture by ratio, not a fixed 1MB (#5350) fix(ai): handle malformed GGUF headers without panicking (#5345) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On windows, the directory and file resolvers could not find files by path. The file tree is keyed on posix paths (
/c/some/path), but lookups searched it with the native path (C:\some\path), so everyFilesByPath,HasPathand root-anchoredFilesByGlobcall silently returned nothing. The most visible symptom is empty file digests fordir:scans (#5325), but anything resolving files by path was affected.ToChrootPathand the directory source name derived frombaseare now always posix (previously backslash paths on windows)windows.FromPosixno longer panics on input that isn't volume-encodedUnit tests (Windows)CI job running a newmake unit:windowstask, scoped to the packages that handle host paths...Unit testsis now a gate over the linux and windows unit test jobsType of change
Checklist
Issue references
Closes #5325