Closed RayMMond closed 4 years ago
hi i see your point: I have created a test that should execute exact this code areas with the same package and I'm hosting the test on linux/ubuntu (github actions) https://github.com/mssforks/BaGet/tree/issue/513
BUT i cannot reproduce the exception. Maybe just solved in one of the dependencies ?
@loic-sharma Maybe we should compile and test the entire codebase on a Linux based OS (additionally to the current full build on windows).
Can you setup this in Azure Pipelines ?
@WernerMairl Thanks for reply~😃 Did you try upload this MailKit 2.4.1 package to BaGet? Because only this package's icon path contains '\', which cause the problem.
yes, you can give a look at my fork (link in my last post) the test project contains the package as as resx and the nupkg is added to BaGet
Hi, This should be fixed by https://github.com/loic-sharma/BaGet/pull/517. Could you try again with the latest docker image? I'll update the GitHub release and nuget.org packages soon.
Tested OK on latest docker image.
Still happening on me. Using the latest image (docker pull loicsharma/baget:0.4.0-preview2
).
Stack trace:
fail: BaGet.Core.PackageIndexingService[0]
Uploaded package is invalid
System.IO.FileNotFoundException: docs\README.md
at NuGet.Packaging.ZipArchiveExtensions.LookupEntry(ZipArchive zipArchive, String path)
at NuGet.Packaging.ZipArchiveExtensions.OpenFile(ZipArchive zipArchive, String path)
at NuGet.Packaging.PackageArchiveReader.GetStream(String path)
at NuGet.Packaging.PackageReaderBase.GetStreamAsync(String path, CancellationToken cancellationToken)
at BaGet.Core.PackageArchiveReaderExtensions.GetReadmeAsync(PackageArchiveReader package, CancellationToken cancellationToken) in /src/BaGet.Core/Extensions/PackageArchiveReaderExtensions.cs:line 32
at BaGet.Core.PackageIndexingService.IndexAsync(Stream packageStream, CancellationToken cancellationToken) in /src/BaGet.Core/Indexing/PackageIndexingService.cs:line 56
Describe the bug
Pushing a package icon path with '\' to baget linux container, will cause System.IO.FileNotFoundException.
To Reproduce
Steps to reproduce the behavior:
Additional context
After some digging, I found something interesting.
According to PackageArchiveReader:
https://github.com/loic-sharma/BaGet/blob/bd440199ba16f62bdb0c157c69b6479f3e2aa9f9/src/BaGet.Core/Extensions/PackageArchiveReaderExtensions.cs#L50-L55
And Nuget.Packaging:
https://github.com/NuGet/NuGet.Client/blob/e59333e773bbc4fed97e5534fe88e25332ca04b0/src/NuGet.Core/NuGet.Packaging/PackageArchiveReader.cs#L140-L150
package.NuspecReader.GetIcon()
return icon path in nuspec, it could be window-style or linux-style. When it's windows-style, and BaGet is running in linux,path = path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
will not replace '\' to '/'.I'm not sure it is a BaGet bug or a Nuget.Packaging bug, any thoughts?