-
Notifications
You must be signed in to change notification settings - Fork 133
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
Support runtime bootstrapping #2930
Comments
Actually, in the 1.x / 2.x / 3.x era, the bootstrapping script that was being used that I have created was working exactly the way suggested as an alternative above. It was running on the target platform. It used a working SDK from a bit-compatible platform as an input, extracted the commit hashes of the native bits, checked out the related repos at those commits and compiled the native parts. Then it copied the native bits over the ones in the SDK and also uncrossgened the managed assemblies, as the R2R code would not be compatible with the target architecture. |
I've forgotten to mention that the script also updated the RID graph in the |
I don't think the approach was actively abandoned, but it went 'missing'. The script was removed in #2001. The documentation is still around: https://github.com/dotnet/source-build/blob/main/Documentation/boostrap-new-os.md. The EngineeringPlanLinuxDistroRepos focuses on 'toolset bootstrapping' instead of 'runtime bootstrapping'
If source-build would still support the runtime bootstrapping, that's what we'd be using for s390x instead of using the Ubuntu cross-build. (note: for s390x we need to bootstrap for mono.) |
If I remember it correctly, one of the reasons for removing the script was that the source-build folks had another plan for bootstrapping (maybe the cross build you've mentioned is the one) and the fact that the script would need to be moved to the new repo structure. |
The old bootstrapping script also assumed that no managed tools are needed to build the unmanaged runtime parts. It goes against our desire to write the custom build tools in C#. Are the unmanaged runtime parts buildable without a working .NET runtime? There is a good chance we have picked up a managed tool dependency somewhere. |
It's a feature that .NET can be bootstrapped using only a native toolchain. The way we're now doing a runtime bootstrap by cross-compiling pushes the problem to the source-build user. He/she needs to create a cross-compilation environment from a supported platform to the unsupported platform. |
Yes. Is it that bad? The alternative discussed here has a cost too that are paid elsewhere. Would the overall benefits of switching the source build to this alternative offset the overall costs? |
For a package maintainer, it's preferable that package dependencies can be met by the distro without much effort. In some cases a cross-compiler won't even be readily available. Suppose we'd add Alpine support today. afaik cross-compilers that ship with Ubuntu target the same version of glibc as the build platform. You can't use them for a musl based distro. The cost is now for the package maintainer which needs to setup a cross-compilation environment. Each distro needs to address that on its own. Since it worked previously it is probably doable to make it work again. We manage to get everything built today, so this isn't urgent. If you also think it's important and within source-build scope, maybe we can target .NET 8? |
I do think it makes sense to maintain this hacky bootstrapping script as something that is guaranteed to work. The design is fragile - how do you know that CoreLib built for a different platform/architecture is going to work on your architecture? The implementation requires joining assets from multiple different build machines. It is something that we explicitly want to avoid in the source build design for .NET 8. I think it is ok to keep the script up to date as one-off solution for people who are doing the initial port to a new platform, to allow them to do the initial bootstrap with some massaging of the process. |
Even if not perfect, it certainly helped with FreeBSD support back in a day. (We end up going with cross-compilation as easier to maintain) |
I'm going to close this issue thanks to the .NET 9 vmr supporting cross-targetting. I don't think we still need an issue for "general bootstrap" support. Users can create new issues when they run into specific issues while bootstrapping. |
The way source-build bootstraps .NET requires a working version of .NET.
That means:
In practice: when .NET gets built for s390x for RHEL, we start with a bootstrap from x64 Ubuntu because Ubuntu provides better support for cross-compilation. Even with that support, we need to take special care the cross-compilation target is compatible with RHEL. For example: it can't target a version of glibc that is too new.
This requires building a very specific environment.
That environment can then be re-used for bootstrapping new major versions of .NET for the target platform.
The alternative to this is to support creating a bootstrap SDK directly on the target platform by combining: pre-compiled managed bits, with native assets that are built directly on the platform.
This type of build isn't supported. And maybe there are reasons why this can't even work.
This issue is to have some awareness of the steps not covered by source-build for bootstrapping unsupported platforms, and source-build's bootstrap limitations.
cc @omajid @uweigand @jkotas @janvorli
The text was updated successfully, but these errors were encountered: