-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Update CI to use Android NDK r25b #102332
Conversation
r? @jyn514 (rust-highfive has picked a reviewer for you, use r? to override) |
I'm unsure how to trigger the CI runs for the Android tests in the PR. If you could tell me how I'll go ahead and get those started. |
@chriswailes same way as in #101781 (comment) :) except with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me once you figure out how to get arm-android
to run in PR CI (or you can also try running it locally with src/ci/run.sh
, but I've never had much luck with that.)
@jyn514 Shouldn't this go trough an MCP at minimum ? It's upgrading the SDK from |
Hmm, it was discussed in https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Formalizing.20Rust's.20Android.20NDK.2FAPI.20Support, but I don't think it ever went through an MCP. @chriswailes can you confirm? The way to make an MCP is by opening an issue on https://github.com/rust-lang/compiler-team/issues/. |
You are correct that there has not been an MCP. The topic was discussed in the above-linked Zulip chat, between developers at RustConf, and in this PR. That isn't to say that this is sufficient discussion, but hopefully demonstrates that I'm not trying to sneak something by :-) If you think that a MCP is warranted in this situation I'd be happy to get one started. As an FYI, no one raised any objections to the update during those discussions and the NDK update policy was included in the Platform Support document that was merged. The current NDK in use is years beyond its support life and means that any features introduced in the last 5 years aren't available to Rust developers. |
Ah, perfect - I think that's enough process, just wanted to make sure there'd more than just informal conversations. Great, r=me once you fix the build then :-) |
This comment has been minimized.
This comment has been minimized.
f95fe1b
to
b905bae
Compare
b905bae
to
4453a77
Compare
This comment has been minimized.
This comment has been minimized.
ah, this doesn't actually look like a regression, it just only succeeds when run from a full bors merge (which was ... a Decision to make smh). So I think you can undo the CI changes and this will be ready to merge :) |
Sounds great! Thanks for another review. |
4453a77
to
8b11265
Compare
@bors r+ rollup=iffy |
📌 Commit 8b11265dfc775ec0dc79c5091ca35c35ba1c547e has been approved by It is now in the queue for this repository. |
⌛ Testing commit 8b11265dfc775ec0dc79c5091ca35c35ba1c547e with merge 3b5460514b8623e9c7e93d24bf40b1b957fd99a0... |
💔 Test failed - checks-actions |
Finished benchmarking commit (79a664d): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
I guess this PR broke the rustup's CI. Please check out rust-lang/rustup#3071 |
It looks like some code in the |
The PR to update |
Thanks for working on this! |
Is this a change that warrants a similar announcement as the one for the glibc/kernel bump (made in #95026)? That one was also pre-warned for a few releases before the change actually landed (e.g., in the Rust 1.61.0 blog post). |
cc @jyn514 — I actually wonder if this should be reverted to prevent it going out in the next beta/stable release, and then put it through a similar sequence of announcements as the glibc change I linked above. This is a fairly big upgrade, and one that makes the standard library pre-compiled against the newer NDK unable to be used when linking against the older NDK (at least as far as I can tell), so we should give people some warning and time to move. |
I can understand that folks are (understandably) looking forward to using an up-to-date NDK to build, and there's certainly good reason to move quickly here -- folks have been complaining about this state of affairs for some time. That said, this definitely seems like it warrants a pre-announcement (or even a sequence of announcements) as @jonhoo suggests. Things get a bit messy because of #85806. In particular, a stdlib built against an NDK older than r23 must be linked against I worry about the possibility that when this gets released, a large number of developers will wake up to their CI failing for reasons they didn't anticipate. At this PR itself shows, the upgrade to r25 is likely to be more involved for those developers than a simple version bump, and there isn't (yet) anywhere to turn for a clear workaround like the This might be useful to drive as a compile warning for some amount of time, to give developers a heads up and link to some blessed workaround. The goal here would be to reduce the size of the set of "will break on NDK upgrade" projects and turn them into "can remove the workaround on NDK upgrade" projects. I tried doing some Github searches to estimate the size of these sets, but didn't get anything I trusted enough to report. If we break everybody (or nearly-everybody, minus the folks who are paying a lot of attention), we may lose trust with the Android community that will be very challenging to regain. |
An example of project currently stuck on an old NDK, and that this breaks: Firefox. |
This will hit stable in a little over a month (December 15), so I think we have some time to discuss even with no action taken. I would recommend a new issue filed and tagged for 1.66, so that discussion can be more easily tracked (and e.g. nominated for T-compiler discussion). Just so that I can understand correctly, it sounds like for the folks commenting here about this breaking their environments, you need a pre-r23 NDK? So if we updated Rust to r21e (released January 2021) this would work fine for you? Presumably, there is a separate set of folks who do want a post-r23 NDK, but based on #102332 (comment) it sounds like that direction of compatibility in various libraries might be easier (with some hacks that could be removed later)? Regardless of how soon we update (and to what), I think a blog post along the lines of the glibc Linux one makes sense to me, especially where we know about active users who may be able to take steps to mitigate that aren't just "update your systems". Happy to help merge that, but someone with more android knowledge would need to write it. |
I'll file a new issue today for discussion and include all the information from the above thread, as well as anything else that I can easily figure out about the compatibility matrix. |
…rade, r=pietroalbini Revert "Update CI to use Android NDK r25b" This reverts commit bf7f1ca (pull request rust-lang#102332). The relevant discussion can be found in rust-lang#103673, where it was agreed that more time is needed to warn the community of the upcoming breakage. This PR is for the `master` branch, where a conflict was recently introduced due to 6d81602. The conflict is in `cc_detect.rs`, where the code that corrects the target triple was moved to a new function called `ndk_compiler()`. This puts the old logic in the `ndk_compiler` function, and assumes that it works properly in the other location where that code is being called. I would appreciate review from `@pietroalbini` to understand how we can test that the reverted logic is also suitable for the additional use case (seems to be related to setting `cc` and `cxx`). I've confirmed already that with these changes I can compile for `armv7-linux-androideabi`, `aarch64-linux-android`, `i686-linux-android`, and `x86_64-linux-android` using `x.py`. A separate revert for the `beta` branch will be required, since the original change has already made it to beta. The beta revert is available at alex-pinkus@3fa0d94, but I'm not sure of the process for staging that PR.
…rade, r=pietroalbini Revert "Update CI to use Android NDK r25b" This reverts commit bf7f1ca (pull request rust-lang#102332). The relevant discussion can be found in rust-lang#103673, where it was agreed that more time is needed to warn the community of the upcoming breakage. This PR is for the `master` branch, where a conflict was recently introduced due to 6d81602. The conflict is in `cc_detect.rs`, where the code that corrects the target triple was moved to a new function called `ndk_compiler()`. This puts the old logic in the `ndk_compiler` function, and assumes that it works properly in the other location where that code is being called. I would appreciate review from ``@pietroalbini`` to understand how we can test that the reverted logic is also suitable for the additional use case (seems to be related to setting `cc` and `cxx`). I've confirmed already that with these changes I can compile for `armv7-linux-androideabi`, `aarch64-linux-android`, `i686-linux-android`, and `x86_64-linux-android` using `x.py`. A separate revert for the `beta` branch will be required, since the original change has already made it to beta. The beta revert is available at alex-pinkus@3fa0d94, but I'm not sure of the process for staging that PR.
PR rust-lang#102332 added support for NDK r25b, and removed support for r15. Since the switch to r25b would have broken existing r15 users anyway, let's take the opportunity to make the interface more user friendly. Firstly move the android-ndk property to [build] instead of the targets. This is possible now that the NDK has obsoleted the concept of target-specific toolchains. Also make the property take the NDK root directory instead of the "toolchains/llvm/prebuilt/<host tag>" subdirectory.
Update CI to use Android NDK r25b This commit updates the CI definitions to use the most recent Android LTS NDK release: r25b. Changes since the last NDK used by Rust negate the need to generate "standalone toolchains" and newer NDKs can be used in-place. See https://developer.android.com/ndk/guides/other_build_systems#overview
This commit updates the CI definitions to use the most recent Android LTS NDK release: r25b. Changes since the last NDK used by Rust negate the need to generate "standalone toolchains" and newer NDKs can be used in-place.
See https://developer.android.com/ndk/guides/other_build_systems#overview