Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ucred::peer_cred on QNX targets to enable dist builds #122730

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

Hoverbear
Copy link
Contributor

After following https://doc.rust-lang.org/rustc/platform-support/nto-qnx.html I attempted to run the following x.py command:

export build_env='
    CC_aarch64-unknown-nto-qnx710=qcc
    CFLAGS_aarch64-unknown-nto-qnx710=-Vgcc_ntoaarch64le_cxx
    CXX_aarch64-unknown-nto-qnx710=qcc
    AR_aarch64_unknown_nto_qnx710=ntoaarch64-ar
    CC_x86_64-pc-nto-qnx710=qcc
    CFLAGS_x86_64-pc-nto-qnx710=-Vgcc_ntox86_64_cxx
    CXX_x86_64-pc-nto-qnx710=qcc
    AR_x86_64_pc_nto_qnx710=ntox86_64-ar'
env $build_env ./x.py --stage 2 dist rust-std  --target aarch64-unknown-nto-qnx710,x86_64-pc-nto-qnx710,x86_64-unknown-linux-gnu

The result was the following error:

   Compiling object v0.32.2
   Compiling std_detect v0.1.5 (/home/ana/git/rust-lang/rust/library/stdarch/crates/std_detect)
   Compiling addr2line v0.21.0
error: function `peer_cred` is never used
  --> library/std/src/os/unix/net/ucred.rs:89:12
   |
89 |     pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
   |            ^^^^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

error: could not compile `std` (lib) due to 1 previous error
Build completed unsuccessfully in 0:06:25

I contacted @flba-eb and @gh-tr over email and we confirmed that peer_cred here should be flagged on nto targets. This should enable the clean x.py --stage 2 dist rust-std command on these platforms.

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added O-unix Operating system: Unix-like 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 Mar 19, 2024
@Amanieu
Copy link
Member

Amanieu commented Mar 19, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 19, 2024

📌 Commit d82d419 has been approved by Amanieu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 19, 2024
@flba-eb
Copy link
Contributor

flba-eb commented Mar 20, 2024

@Hoverbear thank you very much!
@rustbot label +O-neutrino

@rustbot rustbot added the O-neutrino OS: QNX Neutrino, a POSIX-compatible real-time operating system label Mar 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#121543 (various clippy fixes)
 - rust-lang#122540 (Do not use `?`-induced skewing of type inference in the compiler)
 - rust-lang#122730 (Expose `ucred::peer_cred` on QNX targets to enable dist builds)
 - rust-lang#122732 (Remove redundant coroutine captures note)
 - rust-lang#122739 (Add "put" as a confusable for insert on hash map/set)
 - rust-lang#122748 (Reduce `pub` usage in `rustc_session`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2cf93ac into rust-lang:master Mar 20, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2024
Rollup merge of rust-lang#122730 - ferrocene:hoverbear/qnx-ucred-cfgs, r=Amanieu

Expose `ucred::peer_cred` on QNX targets to enable dist builds

After following https://doc.rust-lang.org/rustc/platform-support/nto-qnx.html I attempted to run the following `x.py` command:

```bash
export build_env='
    CC_aarch64-unknown-nto-qnx710=qcc
    CFLAGS_aarch64-unknown-nto-qnx710=-Vgcc_ntoaarch64le_cxx
    CXX_aarch64-unknown-nto-qnx710=qcc
    AR_aarch64_unknown_nto_qnx710=ntoaarch64-ar
    CC_x86_64-pc-nto-qnx710=qcc
    CFLAGS_x86_64-pc-nto-qnx710=-Vgcc_ntox86_64_cxx
    CXX_x86_64-pc-nto-qnx710=qcc
    AR_x86_64_pc_nto_qnx710=ntox86_64-ar'
env $build_env ./x.py --stage 2 dist rust-std  --target aarch64-unknown-nto-qnx710,x86_64-pc-nto-qnx710,x86_64-unknown-linux-gnu
```

The result was the following error:

```
   Compiling object v0.32.2
   Compiling std_detect v0.1.5 (/home/ana/git/rust-lang/rust/library/stdarch/crates/std_detect)
   Compiling addr2line v0.21.0
error: function `peer_cred` is never used
  --> library/std/src/os/unix/net/ucred.rs:89:12
   |
89 |     pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
   |            ^^^^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

error: could not compile `std` (lib) due to 1 previous error
Build completed unsuccessfully in 0:06:25
```

I contacted `@flba-eb` and `@gh-tr` over email and we confirmed that `peer_cred` here should be flagged on `nto` targets. This should enable the clean `x.py --stage 2 dist rust-std` command on these platforms.
@pietroalbini pietroalbini deleted the hoverbear/qnx-ucred-cfgs branch March 20, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-neutrino OS: QNX Neutrino, a POSIX-compatible real-time operating system O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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