Skip to content

Fixes for QNX SDP 8#158697

Open
jonathanpallant wants to merge 9 commits into
rust-lang:mainfrom
ferrocene:qnx-sdp-8-fixes
Open

Fixes for QNX SDP 8#158697
jonathanpallant wants to merge 9 commits into
rust-lang:mainfrom
ferrocene:qnx-sdp-8-fixes

Conversation

@jonathanpallant

Copy link
Copy Markdown
Contributor

This PR contains libstd fixes so libstd can be build for QNX SDP 8.

It requires patches to libc-0.2 and cc-rs. The cc-rs patch was merged already. I have a patch for libc-1.0 here which will need backporting to libc-0.2 once merged.

With these in place, I was able to remotely test tests/ui library/std library/alloc library/core for x86_64-pc-qnx using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two tests/ui/codegen/huge-stacks.rs tests, and I did not have enough RAM to run them.

japaric added 2 commits July 2, 2026 15:03
Linux [1], FreeBSD [2] and the Open Group [3] manuals for both setsid and
setpgrp state that the calling process will be assigned a process group ID that
matches its process ID so check that's the case in the test by calling
getpgid on the child process ID.

on QNX8 (as of GA8.0.2) libc::kill(pgid) appears unable to terminate the
child process so skip that check on that target as it's behavior that
libstd provides no API for

[1]: https://man7.org/linux/man-pages/man2/setsid.2.html
[2]: https://man.freebsd.org/cgi/man.cgi?query=setsid&sektion=2
[3]: https://pubs.opengroup.org/onlinepubs/000095399/functions/setsid.html
also extend the existing tests to exercise the getsockname(2) and
getpeername(2) paths with both named and unnamed Unix sockets
@rustbot

rustbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 2, 2026
@rustbot

rustbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

r? @aapoalas

rustbot has assigned @aapoalas.
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 6 candidates

@rustbot

This comment has been minimized.

jonathanpallant and others added 5 commits July 2, 2026 16:11
Additional fixes library/std after earlier PR renamed some targets
Standardise on QNX SDP, because that's the thing you install and build against. QNX Neutrino and QNX OS are run-time details that are chosen for you by the SDP you have installed.
Tests ignored on target_os = "nto" should also be ignored on target_os = "qnx".
cc-rs now knows about QNX so the environment isn't required
@rustbot

rustbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/doc/rustc/src/platform-support

cc @Noratrieb

@jonathanpallant

Copy link
Copy Markdown
Contributor Author

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

Removed.

@aapoalas aapoalas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me from an "I know barely nothing about QNX and all that" standpoint.

Had a couple of questions or nits to pick that I'd like to see addressed.

View changes since this review

assert_eq!(pid, pgid, "child process ID does not match its process group ID");

if cfg!(target_os = "qnx") {
// kill(-pgid) appears to be unable to terminate the child process on QNX8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: This seems like a fairly big discrepancy - does this cause issues with user-facing process APIs as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Paging @japaric on that one

@japaric japaric Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@aapoalas short answer: no; longer answer:

  1. AFAICT, this only affects kill with negative arguments to send the signal to a whole process group
  2. the libstd does not expose a public API that does kill(-pgid) to terminate a process group; only these tests are using libc::kill(-pgid)
  3. we believe this could be a bug in the QNX8 kernel or userspace given that the test does pass (i.e. kill(-pgid) works) on QNX7.1 (target_os="nto") and have reported the issue to Blackberry
  4. we have seen no test failures in any other libstd test that uses the libc::kill API, e.g. std::process::tests

Comment thread library/std/src/sys/thread_local/key/racy.rs Outdated
Comment thread tests/ui/abi/stack-probes.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

4 participants