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

case sensitive file system on linux #108

Closed
scddev opened this issue May 11, 2022 · 7 comments · Fixed by #110
Closed

case sensitive file system on linux #108

scddev opened this issue May 11, 2022 · 7 comments · Fixed by #110
Labels
bug Something isn't working

Comments

@scddev
Copy link
Collaborator

scddev commented May 11, 2022

On linux all filenames are lower case.

E.g.:

~/.nuget/packages$ ls -al
...
drwxr-xr-x   3 demo demo  4096 May 11 05:49 owin
...

Also nuspec file is lower case:

~/.nuget/packages/owin/1.0.0$ ls -al
total 52
drwxr-xr-x 3 demo demo  4096 May 11 05:49 .
drwxr-xr-x 3 demo demo  4096 May 11 05:49 ..
drwxr-xr-x 3 demo demo  4096 May 11 05:49 lib
-rw-r--r-- 1 demo demo   127 May 11 05:49 .nupkg.metadata
-rw-r--r-- 1 demo demo 14137 May 11 05:49 owin.1.0.0.nupkg
-rw-r--r-- 1 demo demo    88 May 11 05:49 owin.1.0.0.nupkg.sha512
-rwxr--r-- 1 demo demo   660 Nov 13  2012 owin.nuspec
-rwxr--r-- 1 demo demo  9462 Oct 14  2018 .signature.p7s

Also requests to v3 api do not work and fallback to v2:

Package 'Owin', version requirement 1.0 resolved to version 1.0.0 from NuGet server
https://api.nuget.org/v3-flatcontainer/Owin/1.0.0/Owin.nuspec failed due to NotFound!
Attempting to download: https://www.nuget.org/api/v2/package/Owin/1.0.0
Attempting to read: Owin.nuspec

When using lower case url on v3, download succeeds:

~$ curl https://api.nuget.org/v3-flatcontainer/Owin/1.0.0/Owin.nuspec
<?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
RequestId:cc668ccb-601e-007c-6a00-657eb1000000
Time:2022-05-11T06:28:09.8441390Z</Message></Error>

~$ curl https://api.nuget.org/v3-flatcontainer/owin/1.0.0/owin.nuspec
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>Owin</id>
    <version>1.0</version>
    <title>OWIN</title>
    <authors>OWIN startup components contributors</authors>
    <owners>OWIN startup components contributors</owners>
    <licenseUrl>https://github.com/owin-contrib/owin-hosting/blob/master/LICENSE.txt</licenseUrl>
    <projectUrl>https://github.com/owin-contrib/owin-hosting/</projectUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>OWIN IAppBuilder startup interface</description>
    <tags>OWIN</tags>
  </metadata>
</package>
@tomchavakis tomchavakis added the bug Something isn't working label May 14, 2022
@tomchavakis
Copy link
Owner

Hi @scddev,

Thank you for mentioning this issue.
Can you please check if you are using the latest version ?
I've tested the tool using WSL-2 and Ubuntu Linux Machine and the response was ok at the latest version (v2.3.13).

This issue was fixed at this PR: #105 by @Lexy2

If you are still facing errors, please share your Linux os if it's something specific on this specific version

Thank you

@scddev
Copy link
Collaborator Author

scddev commented May 15, 2022

Hi @tomchavakis

the PR #105 only fixes one of the requests. Basically it only fixed the request to query for the list of versions (index.json). All followup requests (.nuspec) do not use toLower() and fail:

https://github.com/tomchavakis/nuget-license/blob/master/src/Methods.cs#L163

Same applies for the local cache. Also here toLower is required. Otherwise it also creates filenames with camel case which prevents a local cache hit:

https://github.com/tomchavakis/nuget-license/blob/master/src/Methods.cs#L244

Thanks

@Lexy2
Copy link
Collaborator

Lexy2 commented May 15, 2022

Yeah, that seems like an oversight. When the package names come from *.csproj files they can be canonical, (PascalCase, not camelCase and thus fail as valid package names).

I'll create a PR.

@tomchavakis
Copy link
Owner

Hi @Lexy2 and @scddev,

I have opened PR #109 which should resolve the issue.
Please take a look and if you are fine I will release a new version.
@Lexy2, if you think that you have a better implementation your PR is more than welcome :)

@tomchavakis
Copy link
Owner

@scddev,
Can you please verify that the #110 PR resolves your issue ?
Thanks

@Lexy2
Copy link
Collaborator

Lexy2 commented May 15, 2022

@tomchavakis I like your tests, they are cleaner and do not use reflection. My PR covers more situations in the main code.
Use the best of both!

@scddev
Copy link
Collaborator Author

scddev commented May 16, 2022

@tomchavakis ,

looks good to me:

remote:

Package 'Owin', version 1.0 not found in local cache
Package 'Owin', version requirement 1.0 resolved to version 1.0.0 from NuGet server
Successfully received https://api.nuget.org/v3-flatcontainer/owin/1.0.0/owin.nuspec

cache:

Package 'Owin', version requirement 1.0 resolved to version 1.0.0 from local cache

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 a pull request may close this issue.

3 participants