rust-lang / rust-lang/rust

posix_spawn is not supported on Android

Open
#151,397 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion O-android
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Current posix_spawn implementation is available for Linux target_os but not Android:
https://github.com/rust-lang/rust/blob/main/library/std/src/sys/process/unix/unix.rs#L421-L436

Also, I don't quite understand why Android is considered as a completely different OS than Linux. This is making conditional compilation harder to support Android properly. It could have been just a different target_env like it is currently done with gnu and musl. Is there a specific reason to use a separate target_os?

Meta

rustc --version --verbose:

rustc 1.91.1 (ed61e7d7e 2025-11-07)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with library/std/src/sys/process/unix/unix.rs around lines 421-436 and compare the existing Linux and Android target conditionals. Determine what Android needs for posix_spawn support and clarify whether the target_os distinction affects this path; done means Android builds can use the supported implementation with appropriate coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.