Skip to content

library: motor: bump moto-rt ABI ver to 17 - #160392

Open
lasiotus wants to merge 1 commit into
rust-lang:mainfrom
moturus:motor-os-rt-v17
Open

library: motor: bump moto-rt ABI ver to 17#160392
lasiotus wants to merge 1 commit into
rust-lang:mainfrom
moturus:motor-os-rt-v17

Conversation

@lasiotus

@lasiotus lasiotus commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Also plumb through several missing pieces that come with the new ABI

@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

These commits modify the library/Cargo.lock file. Unintentional changes to library/Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 2, 2026
@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

r? @LawnGnome

rustbot has assigned @LawnGnome.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from 8 candidates

@lasiotus

lasiotus commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

This PR fixes #160366

@lasiotus
lasiotus force-pushed the motor-os-rt-v17 branch 2 times, most recently from 44a90a0 to 026855b Compare August 6, 2026 22:43
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lasiotus

Copy link
Copy Markdown
Contributor Author

@tgross35 Trevor, maybe you can look at this PR? It's been gathering dust for 2+ weeks...

@tgross35 tgross35 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.

I'm not really doing r-l/r reviews as of late so might not be the best one to ping - you can always @rustbot reroll if 2-4 weeks go by without hearing back (though pinging the reviewer after a little bit never hurts).

That said, this was pretty tiny so I was able to do a pretty quick review, few minor requests. Could you also add a summary of what changed to the PR description? Looks like vectored reads/writes is the main thing.

View changes since this review

Comment on lines 19 to 32
#[cfg(target_os = "android")]
fn shell_cmd() -> Command {
Command::new("/system/bin/sh")
}

#[cfg(not(target_os = "android"))]
#[cfg(target_os = "motor")]
fn shell_cmd() -> Command {
Command::new("/system/bin/sh")
}

#[cfg(not(any(target_os = "android", target_os = "motor")))]
fn shell_cmd() -> Command {
Command::new("/bin/sh")
}

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.

Mind just cleaning this up a bit while you're here?

fn shell_cmd() -> Command {
    if cfg!(target_os = "android") || cfg!(target_os = "motor") {
        Command::new("/system/bin/sh")
    } else {
        Command::new("/bin/sh")
    }
}

Comment on lines +365 to +374
// Motor pids are u64 in the ABI, but the kernel bounds them to the
// i32-positive range, so the cast below is exact (pid-refactoring-design.md).
// The pid lives in the kernel-provided read-only ProcessStaticPage; its
// address and layout are part of the kernel ABI (see ProcessStaticPage in
// Motor OS's moto-sys crate).
const PROCESS_STATIC_PAGE_VADDR: usize = 0x3F7F_FFC0_0000;
const PID_OFFSET: usize = 8;
unsafe {
*crate::ptr::with_exposed_provenance::<u64>(PROCESS_STATIC_PAGE_VADDR + PID_OFFSET) as u32
}

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.

Would it make sense to just have these constants in moto-rt? Also, perhaps worth a debug_assert that the cast is okay?

Please also add a // SAFETY: comment (we're starting to enforce these)

Comment on lines +18 to +20
// There is no public `From<io::Stdin>` conversion yet.
#[allow(dead_code)]
ParentStdin,

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.

Change allow to expect so this shows up if it starts being used

Comment on lines 60 to 80
pub fn temp_dir() -> PathBuf {
PathBuf::from(moto_rt::fs::TEMP_DIR)
temp_dir_from(crate::env::var_os("TMPDIR"))
}

fn temp_dir_from(tmpdir: Option<OsString>) -> PathBuf {
tmpdir.map(PathBuf::from).unwrap_or_else(|| PathBuf::from("/user/tmp"))
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn temp_dir_uses_motor_fallback_and_explicit_value() {
assert_eq!(temp_dir_from(None), PathBuf::from("/user/tmp"));
assert_eq!(
temp_dir_from(Some(OsString::from("/devtools/tmp"))),
PathBuf::from("/devtools/tmp")
);
}
}

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 test doesn't seem super useful, it's basically testing unwrap_or_else. Would a UI/integration test make more sense? Something single-threaded so you could env::set_var("TMPDIR", ...).

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 20, 2026
@rustbot

rustbot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 20, 2026
@tgross35

Copy link
Copy Markdown
Member

r? me

@rustbot rustbot assigned tgross35 and unassigned LawnGnome Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants