runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Portable apps for binary-compatible RIDs

Open ericstj opened this issue 10 years ago • 19 comments

Opened from discussion on https://github.com/dotnet/corefx/pull/10348.

Consider a RID like ubuntu.16.10-x64. We don't specifically cross-compile for this, instead we use a previous build of ubuntu, ubuntu.16.04-x64, and that's expected to work for coreclr/corefx/core-setup native components.

Folks upstack, however, can use the ubuntu.16.10-x64 RID in their packages if they need to distinguish their own assets for this if necessary. This will work for standalone since the user will directly choose that RID. I don't think it works for portable apps.

Since the host hardcodes the "active RID" as the RID it was built against, ubuntu.16.04-x64 in this case, how do we expect a portable app to ever get the running-on RID for a binary compatible distro? https://github.com/dotnet/core-setup/blob/42de2408f4707f0ae9bba5c2e5470a3ede284f27/src/corehost/cli/deps_format.cpp#L99

/cc @mellinoe @livarcocc @ellismg @gkhanna79 @schellap

ericstj avatar Jul 27 '16 15:07 ericstj

Just to be clear, for ubuntu.16.10-x64 we do expect to cross compile, correct? Looking at the existing runtime.json file, it looks like that is what we expect. However, for something like linuxmint.18-x64 which is parented to ubuntu.16.04-x64, we have this problem?

ellismg avatar Jul 27 '16 16:07 ellismg

Thanks for opening this.

Just to be clear, for ubuntu.16.10-x64 we do expect to cross compile, correct?

Yep. linuxmint18 is the only one we can re-use packages for, I think.

However, for something like linuxmint.18-x64 which is parented to ubuntu.16.04-x64, we have this problem?

Yes, I think so, and also for existing "binary-compatible rids", like linuxmint17 -> 17.3. I'm guessing that the host will just see these as ubuntu14.04 currently.

mellinoe avatar Jul 27 '16 17:07 mellinoe

If 2 rids are binary compatible, then wouldn't the package already provide the assets in the lowest compatible rid (ex: win7-x64), in which case the lower rid in the host will select these assets?

If this is not the case, for compatible rids, the host has to be built/released on the highest rid machines from the lab, so its own baked-in rid can be used to lookup into the rid fallback graph as the starting node. Otherwise, a lower rid (baked in) host will fail to use assets in a package that simultaneously provides higher compatible rids.

The runtime graph in M.N.A.deps.json will need to reflect these newer rids and the precedence in the runtimes section.

schellap avatar Jul 27 '16 17:07 schellap

in which case the lower rid in the host will select these assets?

@schellap I think the intent is to enable picking up higher RID assets, if available.

the host has to be built/released on the highest rid machines from the lab

@ericstj @mellinoe @schellap is correct that for such a case the host will need to be rebuilt. During the design of this aspect, the underlying premise was that .NET Core will be rebuilt whenever we have to support a new RID to account for the highest RID available at the time of build.

This discussion implies that the above premise may not hold - if that is the case, how will host get the information of the latest RID to work with? Will it be part of Microsoft.NETCore.App's deps.json (which contains the fallback graph)? And if so, wouldn't that imply that we would have to rebuild the SharedFX for the new RID? And if we do that, does that not imply that core-setup would need to be rebuilt for the new RID and doing so, host would just get the new RID per the current design?

gkhanna79 avatar Aug 01 '16 17:08 gkhanna79

@ericstj Is this required for 1.1.0?

gkhanna79 avatar Sep 19 '16 23:09 gkhanna79

@mellinoe might know more here as he's been scouting new distros.

ericstj avatar Sep 20 '16 17:09 ericstj

Most RIDs aren't binary-compatible, so it's not a big deal. It sounds like the current design implies that we are going to need to compile for each binary-compatible distro independently at some point. Given that there's so few of them, I'm not sure it will ever actually be worth it.

mellinoe avatar Sep 20 '16 17:09 mellinoe

@mellinoe what about for solving the bootstrapping problem? Perhaps even just exposing a couple things like "active RID" and "RID fallback" as env variables that folks can set?

ericstj avatar Sep 20 '16 17:09 ericstj

We will need to fix this for 1.1.0 RTM for Sierra support.

gkhanna79 avatar Oct 10 '16 18:10 gkhanna79

Moving this to 1.2.0 for a general solution that spans various OS distros.

gkhanna79 avatar Oct 28 '16 04:10 gkhanna79

Resurrecting this discussion, to correctly address the problem, we need to compute the RID of the OS during host startup (similar to what we do for OSX here) and remove the hard-coded RID from the host.

This will also have the appropriate side-affect of host not picking up the higher RID assets, incorrectly, on lower RID OS.

Needless to say, if we were to go this route, we need to have guidelines on how the RID naming works and names computed.

Thoughts?

As an aside, are there concerns in adding Linux Mint 18.1 support to the RID fallback graph since (like Linux Mint 18) it maps to Ubuntu 16.04 as well?

gkhanna79 avatar Feb 14 '17 23:02 gkhanna79

CC @weshaggard

gkhanna79 avatar Feb 14 '17 23:02 gkhanna79

Thoughts on this?

CC @Petermarcu

gkhanna79 avatar Feb 16 '17 00:02 gkhanna79

The way the rid is computed is here: https://github.com/dotnet/core-setup/blob/afdc2ba4a62c860ac62265f8fc64081d465dc725/src/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs#L100

It's reading /etc/os-release

ellismg avatar Feb 16 '17 00:02 ellismg

Is this is the consistent approach we are following everywhere? I ask because, IIRC, there was a conversation couple of weeks ago whether RID should have major version only or both major and minor.

Based upon the above link, RID would have whatever VERSION_ID would contain. How does that resonate with the concerns around single version number in RID?

gkhanna79 avatar Feb 16 '17 01:02 gkhanna79

Is this is the consistent approach we are following everywhere? I ask because, IIRC, there was a conversation couple of weeks ago whether RID should have major version only or both major and minor.

This is how the tooling computes the rid for the runtime you are on. We've been trying to use this logic more across places which need to answer the same question (I think CoreFX or BuildTools now pulls this in) We have a bunch of places where logic has been duplicated because it can't take a dependency on managed code (e.g. our shell scripts). We should centralize on this file being the "source of truth" for how we compute RIDs and then if we need to do something in a place where we can't take a dependency on this module fork the code and figure out how to co-evolve stuff.

Based upon the above link, RID would have whatever VERSION_ID would contain. How does that resonate with the concerns around single version number in RID?

The discussion was around updating the logic in that assembly to treat RHEL differently. Like you, I would like to minimize the number of places we have this logic duplicated.

So when computing the RID we would special case where ID="rhel" in this case, we would strip the minor version from VERSION_ID before concatenating them. We would not do this for every distro, just RHEL.

ellismg avatar Feb 16 '17 01:02 ellismg

Sounds good @ellismg. Are we planning to make change to the code above for RHEL?

gkhanna79 avatar Feb 16 '17 01:02 gkhanna79

CC @eerhardt

gkhanna79 avatar Feb 21 '17 19:02 gkhanna79

Closed with https://github.com/dotnet/core-setup/pull/1584.

gkhanna79 avatar Feb 28 '17 22:02 gkhanna79