dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.09k stars 4.7k forks source link

Linux Packaging #2622

Closed RheaAyase closed 4 years ago

RheaAyase commented 7 years ago

A few things to make clear regarding packaging.

  1. What are we packaging? A single package that contains everything, or two or even three separate packages? (host, framework...)

  2. How do we call it? There are debian based packages with naming as dotnet-host, dotnet-hostfxr, dotnet-sharedframework. Now imagine dnf install or apt-get install - what would the user install when, which takes me to my next question...

  3. What are the dependencies of these packages, which would depend on which one?

  4. How do we version it? What would our packages be when it comes to versions? Using the above dotnet-host as example: dotnet-host-1.0

  5. And how can user combine versions/whatever at the same time? Say Bob has sdk 1.1 some time in the future, and wishes to be able to target framework 1.0 and 1.1. Our understanding is that Bob would have to install a package for said sdk, which as such would have only the latest framework as dependency (or not even that) and Bob would have to optionally add whatever other framework he would like to publish for.

  6. Bonus question. Where does our (packagers) responsibility start? Say we will have to fix something our-distro-specific and pushing it upstream is not good enough. Say we need the fix ASAP. We can of course build it ourselves with the fix, and we would, but what about nuget packages that do not contain this fix, if someone would be targeting their application for our distro, from some other platform? Can we be responsible for this somehow, can we get the fix in faster than with next whatever update in a few months?

Last but not least, I would like to suggest that these could be compiled into nice packaging guidelines for all the various Linux distributions out there.

cc @Fedora-dotnet @omajid @tmds @nmilosev (I hope that I got everything covered and didn't mix my notes up, please correct me if so...)

bleroy commented 7 years ago

The PR has been submitted: https://github.com/dotnet/docs/pull/2014. Publication date will depend on the doc team's schedule. I'll close this issue when that's done.

bleroy commented 7 years ago

Following the discussion that happened elsewhere on naming of .NET downloads, packages, and container images (https://github.com/dotnet/designs/issues/2), we'd like to make the following change to the package naming guidelines... Instead of just dotnet-[major].[minor], we'd like to align on other names and call it dotnet-runtime-[major].[minor]. This is also more explicit, and hopefully can steer more people to the package they need. This would be the only change on our end. @richlander will also make changes on his end to bring more consistency with this effort in naming of other files.

RheaAyase commented 7 years ago

Fine by me.


colltoaction commented 7 years ago

Then, maybe we can change dotnet-sdk to dotnet to get a really good first-time experience, where you install one package and get a full development environment. Experienced people will investigate what other options they have.

RheaAyase commented 7 years ago

If you were a new user trying out .net then you would be directed by everyone to dnf/apt-get/whatever install dotnet-sdk instead of dotnet which is the SDK that you as a new user trying it out are looking for and should know and understand the difference. Similarly you are installing python-dev(el) etc, and not just python... (Python is probably a bad example here but... you get the point, it's always dev(el)... another kinda related example would be mono)

oscarvarto commented 7 years ago

Any updates for availability on Arch Linux based distros?

omajid commented 7 years ago

The generic linux-x64 binary for 2.0 (preview) should work on arch. Can you try that? We are also working to make it easier to build .NET Core form source. We have a Fedora package here that you could try to adapt and build on arch too: https://pagure.io/fedora-dotnet/tree/f26

gegenschall commented 7 years ago

I'm sorry, I never reported back. My apologies!

Arch packages are using the recommended naming scheme since about 2.0.0-preview1. They are available here: dotnet - "Meta package", depends on dotnet-runtime-2.0 dotnet-host dotnet-runtime-2.0 dotnet-sdk-2.0 dotnet-runtime-1.1 dotnet-sdk-1.1

One minor nitpick: Version for the {runtime,sdk}-2.0 packages was something along the lines of 2.0.0_preview2_00xxxx-00 which is not recognized to be older than 2.0.0. I had to use the epoch keyword to force it being newer than the preview packages.

omajid commented 7 years ago

Version for the {runtime,sdk}-2.0 packages was something along the lines of 2.0.0_preview2_00xxxx-00 which is not recognized to be older than 2.0.0. I had to use the epoch keyword to force it being newer than the preview packages.

Not sure how Arch normally does it, but on Fedora-land we have to make pre-release packages have a 0 "fedora release version" just to handle cases like this.

Our Preview 2 packages are versioned as 2.0.0-0.3.preview2 right now so we can move to 2.0.0-1 later.

omajid commented 6 years ago

I just found out about https://github.com/dotnet/cli/issues/4014 which also touched on this.

tmds commented 6 years ago

@RheaAyase can we close this with the recent update to the packaging doc? https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging

brad-jones commented 6 years ago

Sorry to dig up an old issue but I am struggling to see how one can install multiple versions through a package manager such as dnf on Fedora.

Yes I have read and re-read: https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging

My understanding is that I should be to install several specific versions of the SDK & Runtime side-by-side.

Eg:

dnf install dotnet-sdk-2.1.302
dnf install dotnet-sdk-2.1.402

However at least for the Fedora repo, it would seem builds have stopped being published in this way.

$ dnf --showduplicates list dotnet-sdk*
Last metadata expiration check: 1:14:07 ago on Thu 13 Sep 2018 14:31:03 AEST.
Available Packages
dotnet-sdk-2.1.x86_64                   2.1.300-1               packages-microsoft-com-prod
dotnet-sdk-2.1.x86_64                   2.1.301-1               packages-microsoft-com-prod
dotnet-sdk-2.1.x86_64                   2.1.302-1               packages-microsoft-com-prod
dotnet-sdk-2.1.x86_64                   2.1.400-1               packages-microsoft-com-prod
dotnet-sdk-2.1.x86_64                   2.1.401-1               packages-microsoft-com-prod
dotnet-sdk-2.1.x86_64                   2.1.402-1               packages-microsoft-com-prod
dotnet-sdk-2.1.200.x86_64               2.1.200-1               packages-microsoft-com-prod
dotnet-sdk-2.1.201.x86_64               2.1.201-1               packages-microsoft-com-prod
dotnet-sdk-2.1.202.x86_64               2.1.202-1               packages-microsoft-com-prod
dotnet-sdk-2.1.300-rc1-008673.x86_64    2.1.300_rc1_008673-1    packages-microsoft-com-prod

Sure I can install a specific version like this dnf install dotnet-sdk-2.1-2.1.302-1 but then come along later and dnf install dotnet-sdk-2.1-2.1.402-1 now 302 has been uninstalled.

Am I missing something obvious? Or is this just not possible?

RheaAyase commented 6 years ago

@brad-jones You should always use software packaged by the contributors to the Linux distribution in question, not by 3rd party or upstream ;)

Our packages may contain Fedora specific tweaks and fixes, and you can most certainly install them side by side.

rjanek@RedHat:~/dev/qe$ dotnet --info
<snip>
.NET Core SDKs installed:
  2.1.302 [/usr/lib64/dotnet/sdk]
  2.1.401 [/usr/lib64/dotnet/sdk]
brad-jones commented 6 years ago

@RheaAyase thanks for the tip about the copr repo, I am up and running again.

I guess my next question is, then why isn't the copr repo used in the official dotnet core installation instructions at https://www.microsoft.com/net/download/linux-package-manager/fedora28/sdk-2.1.402

RheaAyase commented 6 years ago

@brad-jones that is a good question ;p

It is something that I suggested many times without any answer at all. Maybe it will change finally, given the recent developments...