Skip to content

NET-2922 Normalize NuSpec paths to Unix forward slash#9776

Open
bdovaz wants to merge 2 commits intoSonarSource:masterfrom
bdovaz:normalize-license-path
Open

NET-2922 Normalize NuSpec paths to Unix forward slash#9776
bdovaz wants to merge 2 commits intoSonarSource:masterfrom
bdovaz:normalize-license-path

Conversation

@bdovaz
Copy link
Copy Markdown

@bdovaz bdovaz commented Dec 1, 2025

In this commit 5a23948#diff-f8f453a6bb79d1bba0a5f48cfd1d9a73373d4e68008591548d15bb0ef30abaa4R9 I see that the path has been changed, but it has been changed to a Windows path and not a normalized one that any OS can interpret.

This is starting to cause problems when you try to read the package metadata (license in this case) through dotnet tooling or NuGet packages with their API when doing so from a Linux machine.

@pavel-mikula-sonarsource
Copy link
Copy Markdown
Contributor

Hi,
can you clarify the problem a bit?

I understand that Unix systems are generally not capable of understanding paths written by Windows, as it only work the other way around. We should be able to update that.

What is not clear to me is where the change happened. When I look at the nuspec file from the commit, I see all old paths (like icon in windows format, same as in the new nuspec.

At the same time, while the documentation seems to refer it to it as "path" everywhere, without explicit separator rules, all the examples are using windows \ path separator in the .nuspec reference.

Can you share what are the commands or tools that you're using to reproduce the issue?

Copy link
Copy Markdown
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a consistency check for now

Comment thread analyzers/packaging/SonarAnalyzer.CSharp.nuspec
Comment thread analyzers/packaging/SonarAnalyzer.CSharp.Styling.nuspec Outdated
@bdovaz
Copy link
Copy Markdown
Author

bdovaz commented Dec 5, 2025

@pavel-mikula-sonarsource Ready to review.

And regarding your questions, everything comes from here: sensslen/nuget-license#290

But it can potentially be affected by other tools, so it's better to use / instead of \.

@pavel-mikula-sonarsource pavel-mikula-sonarsource changed the title Normalize license file path in nuspec metadata NET-2922 Normalize NuSpec paths to Unix forward slash Dec 18, 2025
@pavel-mikula-sonarsource
Copy link
Copy Markdown
Contributor

pavel-mikula-sonarsource commented Dec 18, 2025

Internal ticket: NET-2922

Copy link
Copy Markdown
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavel-mikula-sonarsource
Copy link
Copy Markdown
Contributor

The change looks good, but I can't merge it just yet. I'll need to run this through internal QA CI and do also some manual testing, as we don't have enough QA for NuGet packages themselves.

Due to holiday season etc, I'll come back to this by the end of January.

@pavel-mikula-sonarsource
Copy link
Copy Markdown
Contributor

Hi @bdovaz,

I got back to this PR and wanted to move forward with it. One thing that I forgot about and I should have done in December is to solve the Contributor License Agreement - we need to sign one before accepting external contribution. I'll send you a private message on our community forum with the next steps.

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.

2 participants