Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Windows file paths in local go mod cache #2654

Merged
merged 1 commit into from May 9, 2024
Merged

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Feb 16, 2024

Previously, the file resolver was created from incorrect calls (path.Join instead of filepath.Join) which resulted Go license searches always missing on Windows. Use filepath.* functions when initializing the Go config, and when the unindexed file resolver is being created.

See #2615 - this fixes some of the specific problems reported in that issue, but I'm leaving that issue open to track better integration testing of syft and grype on Windows.

TODOs:

  • unit tests
  • audit other configs and go license paths for incorrect path.Join use where filepath is needed
  • Add Windows CI runner to prevent introduction of this sort of bug in the future (probably separate PRs :) )

@willmurphyscode
Copy link
Contributor Author

Getting platform-specific testing spun up has proved pretty time consuming. I think it might be better to release this with tests only proving that it doesn't break mac/linux, and then follow up with tests.

@willmurphyscode willmurphyscode marked this pull request as ready for review May 9, 2024 13:43
Previously, the file resolver was created from incorrect calls
(path.Join instead of filepath.Join) which resulted Go license searches
always missing on Windows. Use filepath.* functions when initializing
the Go config, and when the unindexed file resolver is being created.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
@willmurphyscode willmurphyscode merged commit b2ca5fb into main May 9, 2024
12 checks passed
@willmurphyscode willmurphyscode deleted the fix-go-mod-path branch May 9, 2024 17:08
@willmurphyscode willmurphyscode added the bug Something isn't working label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants