-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Rename RID with alpine in name #3075
Comments
We can consider this for 2.1. I'm not sure how the generic naming will help the docker layering. @MichaelSimons can give more insight on how that may work. |
I think for docker it is fine to have OS name. |
@janvorli , I believe you explored this when we first brought up Alpine. Were there any challenges we should be aware of? IIRC we just put it under a specific Alpine because it was the safest and easiest choice at the time. |
@Petermarcu, also for some reason the alpine package name has hardcoded version of alpine https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-alpine.3.6-x64.tar.gz and 3.6 is already not the latest version of OS, it's 3.7 since Nov 2017 https://alpinelinux.org/ |
Yeah, thats what I meant by making sure things end up in linux-musl-x64 packages. When we have specific versions like 3.6, they are the minimum, so if the binaries work on 3.6 and 3.7 then we would have 3.7. |
@janvorli I want to make sure you think the alpine binaries we have today are good enough to put in a generic musl rid package or if you would have concerns. |
Noting a few PR's that will be helpful if we make this change: dotnet/core-setup#3212 |
While I think it should work, we will need to test it. There were some surprises between Alpine 3.5 and 3.6 in term of the availability of the lttng stuff, so there may be others in the Alpine 3.7 and even more likely the other MUSL based Linux distros. The Void Linux has an additional difference that needs to be taken care of in the core-setup stuff. It's /etc/os-release doesn't contain any version number. I remember that when I was testing glibc based version of the void Linux in the past, the dotnet tool was crashing because of that. As for the RID hieararchy |
I don't see this impacting the docker layering. The base images wouldn't change as a result of this. |
That should be fixed now: dotnet/core-setup#2381 |
@janvorli, alpine 3.6 tarball is apparently working quite well on alpine 3.7 docker https://github.com/dotnet/cli/issues/8767. Maybe they have added all the required dependencies permanently in their pkgmanager and we can continue to use it for all 3.x versions? So tarball name can also be made neutral dotnet-sdk-latest-alpine.3.6-x64.tar.gz =>dotnet-sdk-latest-alpine.3-x64.tar.gz (or even without 3). |
Instead of |
That's what I've said above: |
@Petermarcu - is this necessary for |
I think if we're going to make it a sibling of Linux, we'd have to do it now because it would be breaking to do later. I'd like to not have to do this now if we don't have to and make it so the alpine build can be promoted I am happy to discuss. |
@eerhardt if the only change is to leave everything in alpine packages but to change the parent of alpine to musl-linux and then that be parented to unix would anything other than the rid graph in corefx need to change? I'm still not sure I like removing the linux parent from musl-linux. There could very well be linux assets that are c library agnostic and could be represented as linux and apply equally to alpine and ubuntu, right? |
@Petermarcu, there is a BSD LIBC used by non-Linux OSes. It would make more sense to realize libc as lower level artifact as possible. In theory there could be a non-Unix OS using bionic-libc. Architecture -> LibC -> OSFamily -> OSKernel -> OS -> Distro |
After discussing this with @Petermarcu and @janvorli, here are our plans for .NET Core 2.1:
We will fix the RID graph with this issue. I've opened https://github.com/dotnet/corefx/issues/28554 for issue 2. |
- Add `musl-linux` RID - Set `alpine`'s parent to `musl-linux` - Add `alpine.3.7` to the graph - Fix up `android` to inherit from `unix` while we are here Fixes https://github.com/dotnet/core-setup/issues/3817
- Add `linux-musl` RID - Set `alpine`'s parent to `linux-musl` - Add `alpine.3.7` to the graph - Fix up `android` to inherit from `unix` while we are here Fixes https://github.com/dotnet/core-setup/issues/3817
I respectfully disagree with this. You're thinking too narrow. RID doesn't mean "libc". RID only means LIBC in the context of a package that is building native assets that depend on a C-library. In the context of that package it needs to consider that it may be placing a lib-c-based asset in the Now another package might be building a native asset that is linux specific and doesn't depend on a c-library. Should we force it to cross-compile for Alpine or musil which mean nothing to it? Another package might be building a managed asset that is linux specific. Should we force it to cross-compile as well? I would always opt for the most potential reuse when we are designing the RID graph. For the cases where we know there is an incompatibility we need to make sure that folks can minimally cross compile to deal with that incompatibility, and the default/lower RID should give them more reach than the more specific one. |
@ericstj if we were starting from scratch, I would say that we would have Linux-glibc and Linux-musl, both having a parent of Linux. And the linux would likely mean "anything that uses Linux kernel". I wonder then if we should consider adding that level and naming it "linux-core" or something like that. linux-core would mean "anything that uses Linux kernel". Its children would be linux (meaning linux-glibc), linux-musl and android for now. |
No it doesn't because we do not say NuGet is not a switch statement. It's a hierarchy. There is nothing wrong with assigning "most common behavior" to the Now we could add a |
I know it is a hierarchy, that's why I was thinking that the hieararchy should follow the real hierarchy of the OSes and distros. Now you got me really confused. |
Perhaps this is our main point of disagreement. That's actually an incorrect assumption and doesn't match how these hierarchies are used in practice in NuGet. In the case that you have a more-specific asset, it doesn't matter what's in the parent heirarchy, its only the asset you get out. Often times the whole reason you define the more-specific asset is to obscure the more generic one. Suppose you have an implementation of a library that works for most linuxes, except you discover that one distro has a quirk, and you need to cross-compile for that. For the purposes of this discussion lets assume that this library doesn't use the C standard library. I would say you could just do this:
If I follow your logic this is not correct, since that linux-x64 asset would not actually work on quirkyDistro-x64 it wouldn't be acceptable to place it there, even though it would never be selected on quirkyDistro-x64. Instead to keep your assumption true we would need to promote the quirk to the RID graph in order to get a representation that holds, something like.
I think a better mental model for the RID graph is that actual software releases are tied to specific RIDs. These are real and have meaning. The intermediate groupings are imaginary groups that can help us share assets between real RIDs. The intermediate groups are named in such a way that makes it clear how we decided to group them, but they are not absolute and can never carry the complete set of things that folks might care about for cross-compilation. In some cases we may decide to only define a group for the exceptional case and let the larger group cover the common case. This isn't wrong, its an optimization or shorthand. I'll reiterate that I've already said it is reasonable and not incorrect to add grouping for linux-glibc. My point is that it isn't breaking and it isn't technically required because folks have a pattern to follow without it that works for representing cross-compiled assets between glibc and musl. |
* Support musl-libc based linux RIDs - Add `linux-musl` RID - Set `alpine`'s parent to `linux-musl` - Add `alpine.3.7` to the graph - Fix up `android` to inherit from `unix` while we are here Fixes https://github.com/dotnet/core-setup/issues/3817 * Change linux-musl to be parented to linux. * Reparent android RID to linux.
@eerhardt, can you please explain what got fixed by your change? I was hoping to get smooth experience with
I still cannot get to build .net core repos on alpine:latest (3.7), without manually fiddling with scripts to avoid
|
Manually hardcoding version = 3.6 in few places .. |
I think his fixes were aimed at making sure we weren't pinned in a corner WRT the rid graph. We should continue working through this. I think the issue here is that everything is still in the original package names. |
@Petermarcu, it is maybe unclear from https://github.com/dotnet/corefx/issues/28554 what needs to be updated in order to emit musl based RID in .NET Core packages, given we are not suppose to modify the following files?
It would help if we get that working to provide wider support. Maybe I missed the point, but until we had |
The corefx issue is about how the binaries are built. I think the next phase of this would be to package the same binaries in the core-setup repo into both the alpine packages as well as linux-musl packages. @eerhardt do you agree? |
With https://github.com/dotnet/corefx/issues/28554 I think we've said that the "alpine" build should already be "portable" across any linux-musl based distro. It just doesn't necessarily pass the "portable= true" flag, which would cause the output RID to be Yes, we can rename our archives and .nupkgs from @janvorli - can you confirm that our currently built Alpine binaries should work on any musl based distro one last time? /cc @johnbeisner - FYI on the forth-coming dotnet-install script change. |
@kasper3 commented on Sun Mar 11 2018
Sabotage Linux - http://sabotage.tech/
Void Linux - https://www.voidlinux.eu/
NodeOS - http://node-os.com/
are some examples of musl-libc based linux distributions. Here is a full list: https://wiki.musl-libc.org/projects-using-musl.html.
Currently
microsoft/dotnet:2.1-sdk-alpine
docker image has hardcoded alpine name in it and unlikedotnet-sdk-latest-linux-x64.tar.gz
distro-agnostic package, there is no way of using alpine package on any-musl distro.Please consider renaming alpine docker and tarball to have musl in its name instead of alpine, so other distros based on this libc can get the (non-official) support.
Example of using .NET Core on some non-officially supported glibc-based distros:
CC @janvorli @MichaelSimons
@Petermarcu commented on Sun Mar 11 2018
You should be able to publish for Alpine and use it on other musl-libc based distros.
My understanding is that in addition to just supporting musl-libc, we would have to make sure the binaries are created in a distro agnostic way with respect to other dependencies like openssl and libunwind.
@kasper3 commented on Sun Mar 11 2018
@Petermarcu, sure the same way there are fallback lookup paths for dependency lib names in glibc-based distros. Those fallback paths in core-setup/coreclr/corefx repos can even be added later.
However, with alpine hardcoded in RID name without a base RID with musl-libc is not neutral. Before 2.1 if this gets renamed to *musl-libc* that would be a great achievement in terms of future proofing, otherwise we are going to stick with alpine-* forever or encounter a breaking change when it's time to support the second musl-libc distro.
@Petermarcu commented on Sun Mar 11 2018
I think thats something we can consider. We'd have to make the graph something like this: linux-x64->musl-linux-x64->alpine-x64->alpine.3.6-x64. And make sure the implementations that are in the alpine.3.6-x64 packages end up in the linux-musl-x64 packages. I'm going to move this to the core-setup repo where it can be tracked.
The text was updated successfully, but these errors were encountered: