rust-lang / compiler-team

A home for compiler team planning documents, meeting minutes, and other such things.
https://rust-lang.github.io/compiler-team/
Apache License 2.0
387 stars 69 forks source link

New Tier-3 target proposal: `loongarch64-linux-android` #806

Open heiher opened 2 weeks ago

heiher commented 2 weeks ago

Proposal

This MCP proposes adding a new tier 3 target for Android on LoongArch64:

Tier 3 target requirements

A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

The target name is consistent with the one used by Android's NDK.

Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

Android NDK is Apache 2.0 licensed. There are no legal issues.

Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

OK

Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

This target will fully support std.

The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

OK

Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

OK

Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

OK

Mentors or Reviewers

Process

The main points of the Major Change Process are as follows:

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

rustbot commented 2 weeks ago

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:

 @rustbot concern reason-for-concern 
 <description of the concern> 

Concerns can be lifted with:

 @rustbot resolve reason-for-concern 

See documentation at https://forge.rust-lang.org

cc @rust-lang/compiler

saethlin commented 2 weeks ago

@rustbot second

RalfJung commented 2 weeks ago

Confusing disappearing comment? If you write something and want to take it back, better post a clarification, since email notifications have already been sent.

EDIT: Ah, it got moved to Zulip.

maurer commented 1 week ago

@rustbot concern unsupported-architecture Android (the OS trademarked and provided by Google) has no intention of supporting Loongarch in the foreseeable future. It is not supported in the NDK, it is not supported by the platform, and there are no plans to accept contributions which would change this.

If the contributor needs an android-like platform, perhaps they could select a non android name for their android-like-but-definitely-not-android operating system.

heiher commented 1 week ago

@rustbot concern unsupported-architecture Android (the OS trademarked and provided by Google) has no intention of supporting Loongarch in the foreseeable future. It is not supported in the NDK, it is not supported by the platform, and there are no plans to accept contributions which would change this.

If the contributor needs an android-like platform, perhaps they could select a non android name for their android-like-but-definitely-not-android operating system.

Thank you for the detailed feedback. I’d like to clarify that while LoongArch is not officially supported in the Android NDK or AOSP upstream yet, the LoongArch community has already made significant progress in enabling Android, including a working NDK and toolchain, as well as initial downstream AOSP support. Naming the target loongarch64-linux-android aligns with Rust’s existing conventions and avoids unnecessary renaming if LoongArch gains official support in the future. Moreover, Rust's proactive support could help break implicit cycles—similar to what was done for riscv64-linux-android—by demonstrating ecosystem readiness and fostering collaboration. This target would enable developers to experiment with Android-like environments on LoongArch, positioning Rust as a key enabler for emerging platforms while aligning with its goal of supporting diverse architectures. I hope this explanation addresses the concerns, and I’m open to further discussion to refine the proposal.

wesleywiser commented 1 week ago

This concern makes sense to me and I don't think we should use this target name if the platform has not actually defined how this target should work upstream. If Android does support LoongArch in the future and they do not exactly match what our target definition says, the effects could range from annoying (on the low end) to unsound (more likely) and fixing targets after the fact is time consuming for maintainers and potentially confusing to users who don't understand the details of what is changing and what the impacts are.

If we want this target, I suggest picking a different name that doesn't include "Android" so there is no confusion regarding conformance with the actual Android platform itself.