-
Notifications
You must be signed in to change notification settings - Fork 195
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
chromium: Prepare for Rust. #723
Comments
Good catch, thanks! Looks like we're going to have some fun with build toolchain stuff in the near future 😅 I've used Rust before, but I don't think I've ever done cross compilation with it before, nor have I built the compiler itself. |
Dunfell will be challenging, mainly due to the difference in how it fetches crates. In Dunfell's case, meta-rust could be an option; however, we will need to cut it off eventually. |
We'll have to see what version of Rust is required to decide if we keep dunfell going. For kirkstone, we can also consider using: In theory that layer can be used to provide the same ( or closer to the same ) version of Rust used on master. We could make a mickledore branch as well. Anyway, it seems like we can only wait for now. |
I think once we have M113 there should be enough code for one to experiment passing |
Unfortunately there's a new zero-day high severity CVE that is fixed in 114 so unless Rust is required for 114, we should do that update and then work on Rust support. https://hothardware.com/news/google-emergency-0-day-patch-billions-chrome-installs |
Looks like m115 is the first version that looks for a Rust toolchain by default:
Looking at # Chromium provides a Rust toolchain in //third_party/rust-toolchain when
# checkout_rust is True (which is being rolled out by default over time).
#
# To use a custom toolchain instead, specify an absolute path to the root of
# a Rust sysroot, which will have a 'bin' directory and others. Commonly
# <home dir>/.rustup/toolchains/nightly-<something>-<something>
rust_sysroot_absolute = ""
# If you're using a Rust toolchain as specified by rust_sysroot_absolute,
# set this to the output of `rustc -V`. Changing this string will cause all
# Rust targets to be rebuilt, which allows you to update your toolchain and
# not break incremental builds.
rustc_version = "" In the mean time, I'll try doing a build with |
Thanks for picking this up. I've worked with upstream to at least get their Publish tarball and Build from Tarball bots to work with Rust and have the latter build the toolchain rather than use bundled binaries (so that it behaves more like Chromium's LLVM toolchain from a packager's perspective). Rust became official on Linux in M116, and the bots are packaging and testing Rust with M117 on, so YMMV with M117. The bot's steps can at least provide some guidance on what needs to be done -- if we can bypass some of that by using OE's Rust stuff, even better. |
The upstream bot changes sound great, thanks! m116 uses a revision of Rust that according to Rust's GitHub should be included in Rust 1.71.0. I don't know what Chromium's exact requirements are, and if using e.g. https://git.yoctoproject.org/meta-lts-mixins/log/?h=kirkstone/rust-1.68 as suggested by @rwmacleod might work. I'd be happy to do some test builds with m116 after the m115 update is done, but I won't be able to test dunfell unless we can find a fix for #726. I can both try using OE's Rust and building Chromium's custom toolchain. The latter might require using m117, though, as for m116 the tarballs don't include the toolchain sources - unless we can get the new m116 tarballs to also include the sources? Not sure whether that's possible, I'll ask on the Chromium Slack. |
That's not difficult, see https://source.chromium.org/chromium/chromium/tools/build/+/main:recipes/recipes/publish_tarball.py;l=359;drc=b6ab7fb2e7075263b4e7f9421708ee53b59dc5d0 I added the M117 check there because back then the bot was failing to create M115 tarballs and there were no M116 releases being made at the time. |
Ah, great, could you please change that check to use m116 then? Or should I send a CL? |
Sorry if this sounds dumb but I really have zero knowledge of how Rust works: doesn't it make sense to try to use OE's toolchain first and, if that doesn't work, experiment with downloading rustc/building Chromium's Rust stuff in the recipe before sending a CL that might ultimately not be of use? |
I think it does make sense to try OE's toolchain first. My motivation is that in the case this should turn out to not work, already having m116 tarballs available that include Chromium's toolchain sources would speed up the testing a bit. Also, other distros might appreciate having such tarballs, so even if in the end such a change might not be of use to us, it might be to others? |
I guess that's fair. I'll try to send a CL later today. |
So I've tried to do that, but M116 lacks |
That sounds like a reasonable alternative, thanks for looking into it! |
I'm currently experiencing issues building chromium-x11 in the kirkstone branch with this issue. |
Could you elaborate? We haven't done anything related to Rust support yet so my guess is that you're having a separate issue. |
I am seeing the rust toolchain problems already with recent master
|
I first saw that error in 115, so the fix is currently part of the 115 update PR: https://github.com/OSSystems/meta-browser/pull/741/files#diff-436bebc7f6c04ff6040b2273ced509fa01ef9453a4fe30c569445ee21e37e364R305 But if it happens with 114 already, we can land that change separately, as the update PR will likely still take some time to be merged. |
I saw that exact error in 114. |
It turns out that Rust might be used in the build in 114 already. As discussed in OSSystems#723, we need to figure out how to best support Rust builds, and until we've done so we need to disable it.
It turns out that Rust might be used in the build in 114 already. As discussed in #723, we need to figure out how to best support Rust builds, and until we've done so we need to disable it.
Re-posting this announcement from chromium-dev@:
i.e. we will have to find a solution for this bug before the next update (121 is scheduled to be released on Jan 23). @kraj |
I've managed to get a 120 build with I needed to tweak some things, but nothing too big; the two main changes are:
Before I polish everything and send a PR, does anyone have concerns regarding this approach? |
for master (rust 1.74.1 atm), it might be worth to test whether
is enough to make this work. |
With dunfell scheduled to be EOL in April 2024, I think it shouldn't guide our approach to supporting chromium with rust and we should just declare dunfell to be unsupported for chromium >= 121. There were some problems, that I don't recall the specifics of, with meta-rust-bin, so it might be best to avoid that layer. Is the version of rust in kirkstone new enough for chromium or do we need a rust mixin layer with 1.7[45]? |
I strongly support the decision to declare Dunfell as unsupported. However, I would like to point out that using a nightly Rust compiler can significantly increase build time, unless you are using |
I forgot about
I haven't actually tried, but I don't think so. One of the nightly options Chromium uses was introduced in 1.69, so kirkstone's Rust 1.68 mixin will probably not work. |
Alright, I just did a successful build (qemuarm64, Nanbield) using OE's |
Up now at #782, sorry for the delay. |
This is kind of a meta-bug to make everyone aware of https://groups.google.com/a/chromium.org/g/chromium-packagers/c/Gl30hsQ85g8/m/XTc46sRgAQAJ -- tl;dr at some point in the not-too-distant future building Chromium will also require a Rust toolchain.
I know basically nothing about Rust and Rust toolchains and I can imagine integrating one into our build will not be fun. And supporting dunfell will probably make things extra challenging :-)
The text was updated successfully, but these errors were encountered: