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

netbsd,openbsd: add more waitid related constants #3188

Merged
merged 1 commit into from Apr 12, 2023

Conversation

valpackett
Copy link
Contributor

@valpackett valpackett commented Apr 5, 2023

P_ALL/P_PID/WEXITED/WNOWAIT/WSTOPPED in particular are what's required for rustix to support waitid and they were missing on OpenBSD; while here add NetBSD's custom ones.

ping @semarie

@rustbot
Copy link
Collaborator

rustbot commented Apr 5, 2023

r? @JohnTitor

(rustbot has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Apr 5, 2023

Some changes occurred in OpenBSD module

cc @semarie

Some changes occurred in OpenBSD module

cc @semarie

@semarie
Copy link
Contributor

semarie commented Apr 6, 2023

the build failed on openbsd.

error[E0412]: cannot find type `idtype_t` in this scope
    --> src/unix/bsd/netbsdlike/openbsd/mod.rs:1612:18
     |
1612 | pub const P_ALL: idtype_t = 0;
     |                  ^^^^^^^^ not found in this scope
     |
help: consider importing this type alias
     |
1    | use idtype_t;
     |

error[E0412]: cannot find type `idtype_t` in this scope
    --> src/unix/bsd/netbsdlike/openbsd/mod.rs:1613:19
     |
1613 | pub const P_PGID: idtype_t = 1;
     |                   ^^^^^^^^ not found in this scope
     |
help: consider importing this type alias
     |
1    | use idtype_t;
     |

error[E0412]: cannot find type `idtype_t` in this scope
    --> src/unix/bsd/netbsdlike/openbsd/mod.rs:1614:18
     |
1614 | pub const P_PID: idtype_t = 2;
     |                  ^^^^^^^^ not found in this scope
     |
help: consider importing this type alias
     |
1    | use idtype_t;
     |

For more information about this error, try `rustc --explain E0412`.
error: could not compile `libc` due to 3 previous errors

it should be ::idtype_t instead of idtype_t.


error[E0252]: the name `WCONTINUED` is defined multiple times
    --> /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-87eded024c24e479/out/semver.rs:1731:5
     |
414  |     WCONTINUED,
     |     ---------- previous import of the value `WCONTINUED` here
...
1731 |     WCONTINUED,
     |     ^^^^^^^^^^-
     |     |
     |     `WCONTINUED` reimported here
     |     help: remove unnecessary import
     |
     = note: `WCONTINUED` must be defined only once in the value namespace of this module

For more information about this error, try `rustc --explain E0252`.
error: could not compile `libc-test` due to previous error

WCONTINUED is defined in both libc-test/semver/openbsd.txt and libc-test/semver/unix.txt (I think the same apply for netbsd.txt)


during test run:

bad idtype_t signed: rust: 1 (0x1) != c 0 (0x0)
thread 'main' panicked at 'some tests failed', /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-87eded024c24e479/out/main.rs:12:21

on C side, the type seems unsigned (as reported by test suite), so it should be ::c_uint. it will be incompatible with netbsd.

@valpackett
Copy link
Contributor Author

valpackett commented Apr 6, 2023

Oops, I was a bit confused by the src/gnu/gcc/gcc/sys-types.h definition of idtype_t..

The test suite says unsigned here because it's an enum without negative values, while NetBSD has P_MYID = -1.

Copy link
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

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

LGTM

@JohnTitor
Copy link
Member

@bors r+
Thanks a lot!

@bors
Copy link
Contributor

bors commented Apr 12, 2023

📌 Commit e57e4a7 has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 12, 2023

⌛ Testing commit e57e4a7 with merge 88740ef...

@bors
Copy link
Contributor

bors commented Apr 12, 2023

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: JohnTitor
Pushing 88740ef to master...

@bors bors merged commit 88740ef into rust-lang:master Apr 12, 2023
10 of 11 checks passed
@valpackett valpackett deleted the waitconst branch April 12, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants