Skip to content
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

Add support for banana linux #297

Open
4 tasks
tmds opened this issue Nov 23, 2017 · 25 comments
Open
4 tasks

Add support for banana linux #297

tmds opened this issue Nov 23, 2017 · 25 comments
Labels
area-native-bootstrapping Allowing new platforms/operating systems to use source-build

Comments

@tmds
Copy link
Member

tmds commented Nov 23, 2017

.NET can't source-build on a distro it doesn't know (that is: not yet in the rid graph).

This is an impediment when building .NET on new versions of an existing distro, or when building it on a new distro.

The build should handle the unknown rid appropriately.
Package maintainers shouldn't have to become rid graph maintainers.

Tasks:

@dotnet/source-build-contrib

@crummel crummel added the area-native-bootstrapping Allowing new platforms/operating systems to use source-build label Aug 21, 2018
@tmds
Copy link
Member Author

tmds commented Oct 23, 2019

@crummel @dagood we are often running into issues with newer versions of Fedora due to the rid being unknown.
The suggestion here is to change /etc/os-release as part of one of the ci builds to ensure source-build works on an unknown glibc linux-x64.
Can we do this?

cc @omajid

@adaggarwal
Copy link
Member

@crummel Chris Rummel FTE @dagood Davis Goodin FTE we are often running into issues with newer versions of Fedora due to the rid being unknown.
The suggestion here is to change /etc/os-release as part of one of the ci builds to ensure source-build works on an unknown glibc linux-x64.
Can we do this?

I think that's how dotnet-install.sh determines the os. Incase we replace it, we might need a file/placeholder that would contain the RID?

@omajid
Copy link
Member

omajid commented Oct 23, 2019

I think that's how dotnet-install.sh determines the os. Incase we replace it, we might need a file/placeholder that would contain the RID?

I think dotnet-install.sh falls back to linux-x64 rid correctly.

For example, arch-x64 RID doesn't exist in the RID graph, but we get past dotnet-install.sh on Arch Linux just fine: #1310.

@dagood
Copy link
Member

dagood commented Oct 23, 2019

I think that's how dotnet-install.sh determines the os. Incase we replace it, we might need a file/placeholder that would contain the RID?

It seems better to me to look at it from a dev's point of view: what do I expect source-build to do when it can't recognize my OS? My understanding is that the point of adding banana (which I think is a really good idea) is to find situations like that.

For the prebuilt SDK, I imagine I'll normally need linux-x64 (glibc). Then I'd probably want a non-portable build with my new RID in the right place in the RID graph that allows me to restore Microsoft assets if necessary for cross-RID publish, etc. Specifying those each time I want to build seems reasonable, because my OS is unknown (not mentioned in the sources). (Edit: Sounds like I may only need to specify the RID I want, or not even that.)

@crummel
Copy link
Contributor

crummel commented Oct 23, 2019

I like this idea, it'll keep us on top of new versions and unknown distros. It does seem like we'll probably have to soft-patch the RID graph though, unless something in the runtime changes to allow arbitrary unknown RIDs. We can try this out and see what all breaks.

@dagood
Copy link
Member

dagood commented Oct 23, 2019

we'll probably have to soft-patch the RID graph

I thought we were already doing that with:

<Target Name="UpdateRuntimeGraph"
BeforeTargets="Build"
Condition="'$(_IsBootstrapping)' == 'true'">
<PropertyGroup>
<RuntimeJsonFile>$(ProjectDirectory)pkg/Microsoft.NETCore.Platforms/runtime.json</RuntimeJsonFile>
</PropertyGroup>
<Message Importance="High" Text="Adding rid, $(TargetRid), to $(RuntimeJsonFile)" />
<AddRidToRuntimeJson RuntimeJson="$(RuntimeJsonFile)"
Rid="$(TargetRid)-$(Platform)" />
</Target>

@crummel
Copy link
Contributor

crummel commented Oct 23, 2019

Oh, I think IsBootstrapping went away when we switched from BuildTools to Arcade. That should be an easy fix though.

@tmds
Copy link
Member Author

tmds commented Oct 29, 2019

(Edit: Sounds like I may only need to specify the RID I want, or not even that.)

Yes. Source-build should figure out the target rid from /etc/os-release and assume a parent of linux-{arch} (on glibc Linux).
As optional parameters, the user may want to name the target rid (e.g. rhel.8 instead of rhel.8.1)
And specify a list of parent rids.

For this issue, I think we can focus on patching /etc/os-release as a pre-build CI step. And verify we get an sdk for the patched os-release rid.

@tmds
Copy link
Member Author

tmds commented Nov 6, 2019

I think we can focus on patching /etc/os-release as a pre-build CI step. And verify we get an sdk for the patched os-release rid.

@dagood @crummel can we do this?

@dagood
Copy link
Member

dagood commented Nov 6, 2019

The approach sounds good to me, if that's the question. I don't know where it sits in the backlog... seems weird that @leecow is assigned and it's in a closed ZenHub epic. @crummel do you know the background, should it be unassigned to retriage or something like that?

@crummel crummel removed the triaged label Nov 6, 2019
@crummel
Copy link
Contributor

crummel commented Nov 6, 2019

Yeah, we'll assign this to someone in triage. Thanks for the discussion around how to do this everyone!

@dseefeld dseefeld added this to the 5.0 milestone Dec 11, 2019
@tmds
Copy link
Member Author

tmds commented Jan 9, 2020

@crummel @dagood having this CI build will catch rid issues that are now hitting us post-release.

@tmds
Copy link
Member Author

tmds commented Jan 9, 2020

And considering #1428, we should build the source-tarball on banana Linux, and verify it builds on pineapple Linux.

@dagood
Copy link
Member

dagood commented Jul 30, 2020

Issues have come up with versions--stuff like banana-x64/banana.2-x64 vs. banana.2.9-x64 failing on this regex:

// This regular expression is crafted to extract the semver component from the artifacts
// that Core-Setup produces. They have filenames like this (note the two formats!)
// dotnet-runtime-rhel.7-x64.2.0.0-preview2-25401-9.tar.gz
// dotnet-runtime-2.0.0-preview2-25401-9-rhel.7-x64.tar.gz
// the "semver" capture would be 2.0.0-preview2-25401-9 in this case.
protected virtual string VersionMatchRegex => @"(\.|-)(?'semver'[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9]+(-|\.)[0-9]+(-|\.)[0-9]+)?)";

Concretely, @lupin-de-mid hit this issue with astra.1.6-x64. Also, the SDK seemed to parse os-release as astra.16-x64 at runtime, not sure if this is related (or a problem).(edit: see below clarification) Context starting here: https://gitter.im/dotnet/source-build?at=5f21801125cae90e6d8afb48

I think this problem will repro on Ubuntu too (e.g. ubuntu.20.04-x64).

@lupin-de-mid
Copy link

Concretely, @lupin-de-mid hit this issue with astra.1.6-x64. Also, the SDK seemed to parse os-release as astra.16-x64 at runtime,

I workaround problem by changing /etc/os-release from VERSION=1.6 to VERSION=16. So RID in dotnet --info output is defined at compile time

@dagood
Copy link
Member

dagood commented Jul 30, 2020

I think this problem will repro on Ubuntu too (e.g. ubuntu.20.04-x64).

We actually run Ubuntu 18.04 CI, which doesn't hit this, so I'm wrong here. Will need to look deeper.

@dagood
Copy link
Member

dagood commented Nov 19, 2020

Something to consider for this issue is patching up the RID graph in the prebuilt/tooling SDK that we download in the tarball production build. It isn't necessary in all cases (the catch-all linux-x64 may work) but it's probably necessary for cases like alpine-x64 / linux-musl-x64. See #1868. If we don't do this as part of resolving this issue, we should probably open a new issue to track support for that.

@tmds
Copy link
Member Author

tmds commented Feb 9, 2021

RHEL 9 is Banana Linux: we can't build .NET Core on it until the rids have rippled through :/

@omajid
Copy link
Member

omajid commented Feb 12, 2021

Also starting to see issues on the recently-forked Fedora 35 :(

@tmds
Copy link
Member Author

tmds commented Apr 15, 2021

Now that dotnet/runtime#50818 is in.

Can we add a CI job to source-build that verifies we can build a source-tarball on banana Linux, and use it to build .NET on pineapple Linux?

The CI job can write to /etc/os-release to change the distro id.

@MichaelSimons @crummel @dseefeld can you take a look into this?

@tmds
Copy link
Member Author

tmds commented Apr 15, 2021

cc @ericstj

@tmds
Copy link
Member Author

tmds commented May 5, 2021

@MichaelSimons @crummel @dseefeld friendly reminder.

It would be great if we can close the circle by adding a CI job to verify source-build is no longer blocked by unknown rids.

@crummel
Copy link
Contributor

crummel commented May 5, 2021

I'm looking into this now, I'll hopefully have some x64 RHEL machines soon so I'm planning on making CI changes for that anyway.

@tmds
Copy link
Member Author

tmds commented Sep 15, 2022

I've updated the top-level comment with a task list.

cc @MichaelSimons @crummel @omajid @ericstj @richlander

@tmds
Copy link
Member Author

tmds commented Nov 21, 2022

This is fixed as part of dotnet/installer#14549.

We should add a CI test for it. Preferably it does two builds where the second build consumes the output of the first. For the two builds we should use two different unknown rids (e.g. pinapple.14 and banana.18).

To control the rids, we can make /etc/os-release writable in the container image we intend to use for the test.
We don't need to apply it to all images, as this is a functional test for the unknown rid scenario.
It would be nice if we have both a glibc-based and a musl-based image to test against.

We can update @omajid's PR (dotnet/dotnet-buildtools-prereqs-docker#679) to enable the test scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-native-bootstrapping Allowing new platforms/operating systems to use source-build
Projects
Status: Backlog
Development

No branches or pull requests

9 participants