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: trim path from deps.json in portable way #2674

Merged
merged 2 commits into from Feb 29, 2024

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Feb 27, 2024

Previously, the path trimming regex would leave leading path separator in place on Windows.

Probably a better long term fix is to a library path operation.

Fixes #2264

TODO

  • unit tests
  • use something more like filepath.Basename + removeSuffix (actually, we can't do this because the artifact being scanned might not use the same path separators as the host where syft is running).
  • Research why this was introduced - .NET NuGet - dotnet-deps cataloger not working with syft v0.94.0 #2264 gives us a narrow range of commits to look in. Maybe something change with the resolvers? Maybe the regex just changed?

@wagoodman and I talked about this, and it doesn't seem like an underlying bug in the file abstraction, so I'm considering the investigation that was the last todo completed.

Previously, the path trimming regex would leave leading path separator
in place on Windows.

Probably a better long term fix is to a library path operation.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
@willmurphyscode willmurphyscode marked this pull request as ready for review February 29, 2024 13:36
@wagoodman wagoodman merged commit 3ad91f2 into main Feb 29, 2024
11 checks passed
@wagoodman wagoodman deleted the fix/deps-json-path-trimming branch February 29, 2024 14:31
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.

.NET NuGet - dotnet-deps cataloger not working with syft v0.94.0
3 participants