Skip to content

rust: bump to 1.90.0 - #26733

Merged
licy183 merged 1 commit into
masterfrom
rust-1.90
Oct 2, 2025
Merged

licy183 merged 1 commit into
masterfrom
rust-1.90

Conversation

@licy183

@licy183 licy183 commented Oct 1, 2025

Copy link
Copy Markdown
Member

Also enable emulated TLS on Android in crate std.

Closes #26682

@licy183
licy183 requested a review from truboxl October 1, 2025 06:31

@robertkirkman robertkirkman left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! For me, this is working with hello world:

~ $ cargo new test2
    Creating binary (application) `test2` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
~ $ cd test2
~/test2 $ rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14) (built from a source tarball)
~/test2 $ cargo run
   Compiling test2 v0.1.0 (/data/data/com.termux/files/home/test2)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.58s
     Running `target/debug/test2`
Hello, world!
~/test2 $ 

It is also working for building and running a random binary crate, cargo install gifski.

@truboxl truboxl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can upstream this

@licy183
licy183 merged commit 77810a1 into master Oct 2, 2025
@licy183
licy183 deleted the rust-1.90 branch October 2, 2025 00:51

@workingjubilee workingjubilee left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does termux intend to never upstream a patch?

// and our own internal libraries.
//
- // Cygwin only supports emutls.
+ // Cygwin and Android only supports emutls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lacks plural/noun agreement

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an incredibly nitpicky comment.
Yes it's grammatically wrong, no it doesn't really matter the intent of the comment is still accurate and understandable.
If you wanna fix it, by all means send a PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@workingjubilee I believe it's allowed for you to just copy and paste patches from Termux and upstream them yourself, while giving credit (though someone can correct me if I'm wrong)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be working test. I could not provide the test case that can accompany the changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. Perhaps? Android targets are tier 2, which means we do not run tests for Android. We only make sure that the code builds. Even if you submitted it with a test case, I don't think it would block CI if someone broke it, unless it was a compile-only test that could be cross-compiled. We do talk regularly with some of Android's developers and coordinate with them on the implementation, but there are only so many hours in the day and it's easy for something subtle to slip beneath notice because it currently works "enough" and no one doublechecked it since the target was originally contributed. This often was done by a non-expert when it comes to the targets we've had since before my time, like Android. Or sometimes the target has meaningfully changed.

And for some of these patches, well, it took a fair amount of time for me to get the signal handler code reviewed but it would be very easy for me to review a change to it.

This is not the only distribution which has chosen to consistently avoid upstreaming patches. I just don't understand why, so I asked. "Thought it had to come with a test" is useful information.

In this case I think Android should probably be using ELF TLS, though. Maybe it requires adjusting which linker we use for the target by default, but that's probably fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment.

Actually issue #26682 stems from differences between Android's bionic libc and other libcs (such as GNU libc). Currently, Rust uses pthread_key_create to simulate TLS on targets that don't support thread_local. In Android's bionic libc, the maximum number of pthread keys is 128. Using this simulation method, with a large number of thread_local variables, it easily reaches the 128-key limit, causing a panic due to the inability to generate thread_locals.

The reason for not using ELF TLS on Termux is that Android only supports ELF TLS from API 28 onwards, while all binaries in Termux are currently compiled at API 24. IIRC the default API Level in Rust for Android is currently 21.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the patch causes

however, there is currently no known alternative patch.

@robertkirkman robertkirkman Jul 2, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New testing by me on Rust 1.96.0 indicates that the original test cases no longer reproduce the error for me, even when the 0007-use-emulated-tls-on-android.patch is removed, indicating that it might no longer be necessary.

However, workingjubilee has hypothesized in discord that possibly, a change might have just resulted in the problem ceasing to be reproducible with small projects and instead beginning to require specific, unknown larger projects to reproduce.

I might continue testing to try to see if building any large projects results in a return of errors related to thread-local storage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomJo2000

Copy link
Copy Markdown
Member

We are open to upstreaming patches, but intent to do so is up to the individual contributors.

truboxl added a commit to truboxl/termux-packages that referenced this pull request Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't run any rust program with rust=1.90.0

5 participants