-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Invoke backtrace-rs
buildscript in std
buildscript
#116318
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
I believe jubilee is in charge of backtrace-rs now r? workingjubilee |
effectively. |
3906e9a
to
cd5446d
Compare
This comment has been minimized.
This comment has been minimized.
Based on rust-lang#99883 by @Arc-blroth Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
cd5446d
to
9367727
Compare
Alright, this is waiting on rust-lang/cc-rs#705 as I understand it? |
I can take another look at that PR. IIRC I was happy to merge it but it'd be nice if someone with Android experience could give it a quick test since the PR author has been busy. Unfortunately I don't have a lot of faith in cc's testing atm. |
Ping one of the Android target maintainers? They're usually pretty on-the-ball. |
This isn't technically blocked by the cc change, but that PR is the last piece of the puzzle to fix the Android issue. Whether to merge this now or later I'll leave up to you. |
given:
I think we can at least wait for some cleanup/doublechecking to happen assuming that it doesn't grow excessively in time. |
@bors r+ rollup=iffy |
A |
At first I tried encoding the version as a value in |
Here is what I was using to make this work locally: rust-lang/backtrace-rs#570 To the question above though: If we could set the Min API level to 21, then all of this can just go away. |
https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html, published January 2023 says:
25 is still in use on CI:
|
Yeah, okay. And the latest NDK still supports API L19 and L20, but the next one will be L21 as its minimum, so that only hits the table after it releases. |
...wait, did r26 get released? when? |
Looks like r26 was released on September 18: https://github.com/android/ndk/wiki/Changelog-r26/ed5e3da97588c0d2b6eb022b701e250d8c642ae9 |
I'm confused as to why just including |
Absolutely, here's the error when I remove the
|
I suspect what's confusing here is that the |
cc @chriswailes since we're currently discussing possible Android build hacks for std and min API levels. |
@danakj have you tried making cc available in your build? Seems like build dependencies should at least be available even if they aren't used. |
Yeah, we can not use Edit: Build dependencies in general are available, but Edit edit: In this case, a runtime error may not have been noticed, but we would have received API level < 21 as a result, which would be incorrect, for example. |
I know you can't use cc, and I'm not proposing that you do. But making it available, even if it isn't invoked, will sidestep the "need to cfg out Right, we simply provide possibly incorrect results if invoking cc fails. But if you define the environment variable as proposed earlier, I think everything would work fine (and cc would not be invoked at all). |
Right, but I am not sure how to ensure that we don't accidentally invoke |
Revert "Invoke `backtrace-rs` buildscript in `std` buildscript" This reverts commit 9367727 because it caused issues for projects building the standard library with non-cargo build systems. See rust-lang#116318 (comment) r? workingjubilee
I thought you said you don't even need backtrace-rs anyways, so is having the wrong android version even an issue? I guess you don't want cc to be available for anything else either. Regardless, I think my preferred option, if you need it, would be a |
Yeah, I am concerned about making our build system fragile by adding A no_cc cfg flag sounds totally great to me. |
You could replace Everything you'd do with compile-time checks like You will still get your errors at build time since a panicking build script will stop the build. |
I did consider replicating the entire cc API in a stub crate before, and even prototyped that. In order to compile you need all of the public API available though, and then match changes across versions. It's not as simple as just making a |
Instead of replicating the entire API, it would probably be easier to just fork the existing source code and just adding panics in a couple places. |
Yeah, this is possible, though it requires maintaining a fork, possibly multiple versions over time, and shimming a different library into the build system. The complexity is larger than removing it entirely. This will need to be replicated for each project building stdlib in a static build system. I understand the no_cc flag represents some complexity on your end that it avoids. Is it too much? |
I don't think a |
FWIW Here's what it could look like to use |
nevermind that does runtime switching, i didn't realize the build script was using |
What should be the next step here? We're currently on a rustc nearing a month old, which prevents us from finding other issues, like LLVM head integration fixes for example, as they stack up. Can we roll the NDK and then the minimum ABI will be 21 and this goes away? If so, who would do that, is there an approval process for it? If not, could we hold the |
Would temporarily apply the patch in #116705 (which reverts this PR) when using rustc 1.73 work? It landed a week ago and would end up on stable December 28. (or November 16 if backported to beta) Edit: I just see that this PR hasn't even landed on beta yet, so no beta backport of the revert is necessary. |
Oh I didn't see the revert, I see it in the comment thread above now. Then we will roll past that, yeah. Thank you! The next step question still applies, and I am happy to participate in what comes next, but that will unblock us, thanks! |
FWIW, Chromium's minimum API level is now 26: https://groups.google.com/a/chromium.org/g/chromium-dev/c/B9AYI3WAvRo |
Based on #99883 by @Arc-blroth
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705