8000 Bump rust-version to 1.73.0 by rib · Pull Request #193 · rust-mobile/android-activity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bump rust-version to 1.73.0 #193

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

Merged
merged 1 commit into from
Apr 1, 2025
Merged

Bump rust-version to 1.73.0 #193

merged 1 commit into from
Apr 1, 2025

Conversation

rib
Copy link
Member
@rib rib commented Apr 1, 2025

bindgen-cli 0.71 (which we want to use) requires rustc >= 1.70

If we're bumping the rust version anyway it looks like it makes sense to at least bump to 1.73 which happens to fix the stat struct definition for Android.

Technically since we run bindgen-cli offline, their minimum version doesn't need to affect us but I'd rather just sync and not track multiple "minimum" versions for this crate.

Rust 1.73 was released October 2023, which is still well over a year old and very conservative.

This updates generate-bindings.sh to pass --rust-target 1.73.0 so we avoid generating bindings that require a more recent compiler.

@rib rib requested a review from MarijnS95 April 1, 2025 11:23
@rib
Copy link
Member Author
rib commented Apr 1, 2025

Btw I'll probably merge eagerly, this without blocking on review, considering that this seems pretty uncontroversial and it should be fine to follow up with any issue if necessary in another PR (and I want to stack other changes / PRs on this).

@rib rib force-pushed the rib/pr/bump-rust-version branch from 5775f17 to 825afb5 Compare April 1, 2025 11:35
@MarijnS95
Copy link
Member

but I'd rather just sync and not track multiple "minimum" versions for this crate.

I don't think we really need to "track" two versions; our developer-only build tools can just use whatever is the latest stable. At least I update my local Rust version as soon as it's released, and I think we're mostly the only two people contributing to this anyway.

Copy link
Member
@MarijnS95 MarijnS95 left a comment

Choose a reason for hiding this comment

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

Good one on setting --rust-target - doesn't that result in generated output changes though? Or was that only since 1.74?

Comment on lines 13 to 16
# We need a version > 1.70 for running bindgen-cli, and 1.73 also happens to
# have a fix for the definition of the `stat` struct on Android.
rust-version = "1.73.0"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think mentioning bindgen-cli is very relevant here (and I'd be more than happy to keep them separate). Having it in the PR description is more than enough.

@rib
Copy link
Member Author
rib commented Apr 1, 2025

Good one on setting --rust-target - doesn't that result in generated output changes though? Or was that only since 1.74?

I guess rust-bindgen could change it's output for any major version, regardless of the --rust-target version that only needs to constrain that the generated code will be backwards-compatible with that compiler version.

I guess it's also valid to pass a --rust-version that's newer than whatever rustc version was used to build bindgen-cli.

I think it's OK to leave it to the PR that's updating to GameActivity 4.0.0 for re-generating new bindings. The bindings themeselves are private, so it's up to us to choose to re-generate if we want to take advantage of new bindgen features or when changing the native GameActivity interface.

@rib
Copy link
Member Author
rib commented Apr 1, 2025

but I'd rather just sync and not track multiple "minimum" versions for this crate.

I don't think we really need to "track" two versions; our developer-only build tools can just use whatever is the latest stable. At least I update my local Rust version as soon as it's released, and I think we're mostly the only two people contributing to this anyway.

yeah, fair enough - this version bump is technically not really needed.

any particular objection to me updating the rust-version to 1.73 anyway?

there is the stat struct fix for Android that is unlikely to affect many people but could still be a reason enough to set as a minimum version.

@MarijnS95
Copy link
Member

No objections as long as it's not specifically on the merit of our developer tools/experience 👍

@rib
Copy link
Member Author
rib commented Apr 1, 2025

No objections as long as it's not specifically on the merit of our developer tools/experience 👍

I'll update the commit message / comments etc to only refer to the stat struct fix and mostly forget about the interaction with rust-bindgen which is kinda irrelevant really while it's fine to use whatever latest toolchain we like when building/running bindgen-cli.

I'll keep the --rust-target change in generate-bindings.sh since that still makes sense in the context of a rust-version bump, and we probably should have passed this before (assuming the option existed before).

@MarijnS95
Copy link
Member

Yeah, love to see the --rust-target since that sets a proper boundary on what we can use.

@rib rib force-pushed the rib/pr/bump-rust-version branch from 825afb5 to 4b11d64 Compare April 1, 2025 14:25
There was a fix for the definition of the `stat` struct on Android in
1.73, and even though it's unlikely to affect many applications it still
seems worthwhile to draw a line under this and ensure that all
android-activity based applications will have that fix.

Rust 1.73 was released October 2023, which is still well over a year old
and very conservative.

This updates `generate-bindings.sh` to pass `--rust-target 1.73.0` so we
avoid generating bindings that require a more recent compiler.

(This doesn't actually regenerate the bindings but does ensure that
future updates will be constrained to generate code that is backwards
compatible with 1.73.)
@rib rib force-pushed the rib/pr/bump-rust-version branch from 4b11d64 to b570174 Compare April 1, 2025 14:26
@rib rib merged commit db3ea33 into main Apr 1, 2025
3 checks passed
@rib rib deleted the rib/pr/bump-rust-version branch April 1, 2025 14:30
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.

2 participants
0