Skip to content

std: fix platform checks for hermit - #164771

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xtqqczze:GH94678
Nov 2, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xtqqczze:GH94678

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #164495.

Found this while working on Hermit OS support for Rustix (bytecodealliance/rustix#1672)

$ cargo +nightly check -q -Zbuild-std --target x86_64-unknown-hermit
error[E0425]: cannot find value `IPV6_UNICAST_HOPS` in crate `c`
   --> ~/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/net/connection/socket/mod.rs:534:61
    |
534 |                 setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_UNICAST_HOPS, limit as c_int)
    |                                                             ^^^^^^^^^^^^^^^^^ not found in `c`
...
error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in crate `c`
   --> ~/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/net/connection/socket/mod.rs:957:61
    |
957 |                 setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_MULTICAST_HOPS, limit as c_int)
    |                                                             ^^^^^^^^^^^^^^^^^^^ not found in `c`
    |

cc: @Mallets

@rustbot rustbot added 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. labels Oct 22, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@xtqqczze
xtqqczze marked this pull request as ready for review October 23, 2026 01:17
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 23, 2026
@rustbot

rustbot commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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 37 candidates
  • Random selection from 6 candidates

@xtqqczze
xtqqczze marked this pull request as draft October 23, 2026 01:26
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 23, 2026
@xtqqczze

xtqqczze commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

The same issue also exists for target_os = "solid_asp3" e.g. aarch64-kmc-solid_asp3.

@xtqqczze xtqqczze changed the title std: fix for hermit targets std: fix platform checks for hermit and solid_asp3 Oct 23, 2026
@xtqqczze xtqqczze changed the title std: fix platform checks for hermit and solid_asp3 std: fix platform checks for hermit Oct 23, 2026
@rust-log-analyzer

This comment has been minimized.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

r? jhpratt

@xtqqczze
xtqqczze marked this pull request as ready for review October 23, 2026 09:08
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 23, 2026

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

Please flip the cfg_select! arms so that the fallback case is the unsupported one – that makes it much less confusing .

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 1, 2026
@rustbot

rustbot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot

This comment has been minimized.

@rustbot

rustbot commented Nov 1, 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.

@xtqqczze

xtqqczze commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2026
@joboet

joboet commented Nov 2, 2026

Copy link
Copy Markdown
Member

Thanks!
@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e0b8689 has been approved by joboet

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 2, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #163764 (Tweak suggestion of "unreachable due to never pattern")
 - #164771 (std: fix platform checks for hermit)
 - #165070 (create mir for direct-rhs consts)
 - #165121 (test DSL evaluate sequentially)
 - #165288 (Add assembly test for masked index without redundant shifts)
 - #165307 (test(lexer): Add test that ZWJ/ZWNJ are accepted in identifiers)
@rust-bors
rust-bors Bot merged commit fefa0d8 into rust-lang:main Nov 2, 2026
14 checks passed
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup merge of #164771 - xtqqczze:GH94678, r=joboet

std: fix platform checks for hermit

Closes #164495.

Found this while working on Hermit OS support for Rustix (bytecodealliance/rustix#1672)

```console
$ cargo +nightly check -q -Zbuild-std --target x86_64-unknown-hermit
error[E0425]: cannot find value `IPV6_UNICAST_HOPS` in crate `c`
   --> ~/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/net/connection/socket/mod.rs:534:61
    |
534 |                 setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_UNICAST_HOPS, limit as c_int)
    |                                                             ^^^^^^^^^^^^^^^^^ not found in `c`
...
error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in crate `c`
   --> ~/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/net/connection/socket/mod.rs:957:61
    |
957 |                 setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_MULTICAST_HOPS, limit as c_int)
    |                                                             ^^^^^^^^^^^^^^^^^^^ not found in `c`
    |
```

cc: @Mallets
@rustbot rustbot added this to the 1.101.0 milestone Nov 2, 2026
@xtqqczze
xtqqczze deleted the GH94678 branch November 2, 2026 21:14
ubiratansoares pushed a commit to ubiratansoares/rust-analyzer that referenced this pull request Nov 19, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#163764 (Tweak suggestion of "unreachable due to never pattern")
 - rust-lang/rust#164771 (std: fix platform checks for hermit)
 - rust-lang/rust#165070 (create mir for direct-rhs consts)
 - rust-lang/rust#165121 (test DSL evaluate sequentially)
 - rust-lang/rust#165288 (Add assembly test for masked index without redundant shifts)
 - rust-lang/rust#165307 (test(lexer): Add test that ZWJ/ZWNJ are accepted in identifiers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

hermit building failed due to IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS missing

6 participants