-
Notifications
You must be signed in to change notification settings - Fork 13
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
Optimize NuGet package downloads for a specific operating system #2
Comments
I finally got around to try EphemeralMongo. 😃 It seems to me that there's an easy solution to reduce the download size with the existing packages. Instead of importing EphemeralMongo through the In other technical words, going from this: <ItemGroup>
<PackageReference Include="EphemeralMongo6" Version="0.1.3" />
</ItemGroup> to this: <ItemGroup>
<PackageReference Include="EphemeralMongo.Core" Version="0.1.3" />
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="0.1.3" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="0.1.3" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="0.1.3" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
</ItemGroup> It's not as tidy and a built-in solution would be nicer but it can definitely save some bandwidth and time. Maybe it could be worth mentioning this approach in the README? |
@0xced done! Thank you for the suggestion. |
Linking some more issues that discuss the matter (even if not obvious from their titles).
Interesting how all theses issues are still open. 😅 Also, note that the libclang package is using the undocumented |
EphemeralMongo use a dedicated runtime NuGet package for each operating system (linux-x64, osx-x64 and windows-x64).
However, when using EphemeralMongo4, EphemeralMongo5 or EphemeralMongo6, the three OS-specific runtime packages are downloaded and copied to the build output, which takes time and a lot of space. The ideal solution would to only download the relevant runtime package for the consuming operating system.
Unfortunately, there is no viable solution today to optimize the download process.
There are actually a lot of opened issues in the .NET GitHub repository about option #2, so it might be possible in a future version of .NET:
Using runtime.json is also not an option because it is deprecated, undocumented, and was created for internal .NET Core NuGet packages.
Until then, we'll stick with the RID-specific runtime package.
The text was updated successfully, but these errors were encountered: