-
-
Notifications
You must be signed in to change notification settings - Fork 93
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 Error with Uppercase Characters in Version Strings #902
base: master
Are you sure you want to change the base?
Conversation
Resolve an issue where versions with uppercase characters (e.g., 1.0.0-Beta, 1.0.0.BETA.1) caused CycloneDX to throw errors. The problem occurred because the NuGet cache converted version strings to lowercase for path names. Signed-off-by: John Hunhoff <[email protected]>
To provide additional information, the error message is "Central Directory corrupt," and it originates from the file NugetV3Service.cs. This error occurs in all versions greater than 2.3. To test, you just need a project that depends on a NuGet package with an uppercase character in the version.. |
Do you happen to have an example at hand of a public package that has an uppercase character in its version? |
This PR fixes #603, at least when it comes to people having issues with Linux-based build agents.
I did not find any public NuGet packages that uses an uppercase in it's version. It may be that the public feed automatically sets all versions to lowercase. However, for private feeds, those are possible. I have such a case using Azure Artifact feeds, where we use a timestamp as part of the version number for internal prerelease packages, similar to this format: In a Windows environment, that's not a problem since paths are case-insensitive. When That is not the case with Linux. In that case, the file cannot be found because of the casing difference, and the check fails. In To the best of my knowledge, the NuGet client normalizes versions to lowercase in the global cache when restoring packages. The GlobalPackagesFolderUtility class instantiates a VersionFolderPathResolver with the parameter |
I don't have an example, the error occurred to me with private packages self hosted on directory or nexus repository manager in linux. The only public package I know of is https://www.nuget.org/packages/Unity/5.9.0-RC1. |
I've stumbled upon the same problem as @JohnHunhoff with our private packages (we use nexus on windows as private repository) and I can reproduce the problem and that the fix solves it. Can this pull request be merged or an example that shows the problem and the solution is needed before? |
Resolve an issue where versions with uppercase characters (e.g., 1.0.0-Beta, 1.0.0.BETA.1) caused CycloneDX to throw errors. The
problem occurred because the NuGet cache converted version strings to lowercase for path names. This caused the .nuspec file to not be found.