Skip to content

Conversation

k0tran
Copy link

@k0tran k0tran commented Sep 24, 2025

Summary of the PR

This will help building codex (and other crates that depend on seccompiler) on loongarch64.
There is one problem with test_tsync which should be addressed by you.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Testing

I tested this on loongarch64 machine with the following

cargo build
cargo build --release
cargo test -- --skip=test_tsync
cargo test --release -- --skip=test_tsync

it works

test_tsync

The error is:

thread 'test_tsync' panicked at tests/multi_thread.rs:37:5:
assertion `left == right` failed: there should be no errors
  left: 2
 right: 0

Which is reproducable with this:

fn main() {
    let errno2 = std::io::Error::last_os_error().raw_os_error().unwrap();
    println!("before: {errno2}"); // outputs 2
    let pid = unsafe { libc::getpid() };
    let errno = std::io::Error::last_os_error().raw_os_error().unwrap();
    println!("after: {errno}"); // outputs 2 again
}

What should be the correct way to handle it? Should getpid os error codes be checked at all? Man page says it's always succesfull.

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.

1 participant