Skip to content

Fix two SBOM generation bugs where a path contains a space - #9

Open
Gillibald wants to merge 1 commit into
mainfrom
fix/sbom-version-comparison-on-main
Open

Gillibald wants to merge 1 commit into
mainfrom
fix/sbom-version-comparison-on-main

Conversation

@Gillibald

@Gillibald Gillibald commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

What does the pull request do?

Fixes two SBOM generation bugs. Both reproduce only where a path contains a space, which is why CI never sees either.

What is the current behavior?

  • The cyclonedx-dotnet arguments are quoted by hand and again by Tool's ArgumentStringHandler, producing ""C:\Some Dir\proj.csproj"". The OS reads the leading "" as an empty quoted string and the rest as a bare path, so the argument splits at the first space and cyclonedx-dotnet rejects the remainder with "command or argument not recognized".
  • EnrichRootComponent's staleness guard compares version strings ordinally. A 12.2 tag keeps its spelling through NuGetVersion.ToString() while pack normalizes the shipped nuspec to 12.2.0, so the guard throws for packages that are in fact current.

What is the updated/expected behavior with this PR?

Interpolated values are passed unquoted, matching the Babel and IlMerge calls. The staleness guard parses both sides as NuGetVersion and compares semantically; versions that do not parse keep the exact-string check, and genuine drift still throws.

Checklist

Breaking changes

None.

🤖 Generated with Claude Code

Both reproduce only on a developer machine whose profile directory has a
space in it, which is why CI never saw either.

- The cyclonedx-dotnet arguments were quoted by hand as well as by Tool's
  ArgumentStringHandler, producing ""C:\Some Dir\proj.csproj"": the OS reads
  the leading "" as an empty quoted string and the rest as a bare path, so
  the argument splits at the first space and the tool rejects the remainder
  with "command or argument not recognized".
- The staleness guard compared version strings ordinally. A "12.2" tag keeps
  its spelling through NuGetVersion.ToString() while pack normalizes the
  shipped nuspec to "12.2.0", so the guard threw for packages that were in
  fact current. Both sides now parse as NuGetVersion; versions that do not
  parse keep the exact-string check, and genuine drift still throws.

Ports the two fixes from fix/sbom-version-comparison onto the rewritten
generator on main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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