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

openbsd/netbsd commonize getnameinfo #3822

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

devnexen
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
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

@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2024

Some changes occurred in OpenBSD module

cc @semarie

Some changes occurred in OpenBSD module

cc @semarie

@tgross35 tgross35 changed the title openbsd/netbsd factorise getnameinfo. openbsd/netbsd commonize getnameinfo Aug 15, 2024
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 15, 2024
@tgross35 tgross35 added this pull request to the merge queue Aug 15, 2024
Merged via the queue into rust-lang:main with commit bcd5546 Aug 15, 2024
39 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 15, 2024
(backport <rust-lang#3822>)
(cherry picked from commit 5df9fa0)
@tgross35 tgross35 mentioned this pull request Aug 15, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Aug 15, 2024
@semarie
Copy link
Contributor

semarie commented Aug 16, 2024

FYI it not ok on OpenBSD.

it fails to pass the test suite:

  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-2bed02be9f63dff8/out/main.c:15285:24: error: incompatible function pointer types returning 'int (const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int)' (aka 'int (const struct sockaddr *, unsigned int, char *, unsigned long, char *, unsigned long, int)') from a function with result type 'int (*)(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int)' (aka 'int (*)(const struct sockaddr *, unsigned int, char *, unsigned int, char *, unsigned int, int)') [-Werror,-Wincompatible-function-pointer-types]
  cargo:warning=                return getnameinfo;
  cargo:warning=                       ^~~~~~~~~~~
  cargo:warning=1 error generated.

  --- stderr
  rust version: 1.80.0


  error occurred: Command "/usr/local/bin/sccache" "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "--target=x86_64-unknown-openbsd" "-Wall" "-Wextra" "-Wall" "-Wextra" "-Werror" "-Wno-unused-parameter" "-Wno-type-limits" "-Wno-address-of-packed-member" "-Wno-unknown-warning-option" "-Wno-deprecated-declarations" "-Wno-deprecated-declarations" "-o" "/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-2bed02be9f63dff8/out/63e0546644a06edb-main.o" "-c" "/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-2bed02be9f63dff8/out/main.c" with args cc did not execute successfully (status code exit status: 1).

@tgross35
Copy link
Contributor

Interesting - per https://man.freebsd.org/cgi/man.cgi?query=getnameinfo&sektion=3&format=html (tested in CI) and https://man.openbsd.org/getnameinfo.3 they have an identical function signature. Is this signature version-dependent?

@semarie
Copy link
Contributor

semarie commented Aug 16, 2024

the problem is servlen: ::socklen_t (on NetBSD) vs servlen: ::size_t (on OpenBSD and FreeBSD)

@devnexen
Copy link
Contributor Author

ah ok let s just revert it.

tgross35 added a commit to tgross35/rust-libc that referenced this pull request Aug 16, 2024
This reverts commit 5df9fa0.

The change broke builds for OpenBSD. See discussion at
<rust-lang#3822 (comment)>.
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Aug 16, 2024
This reverts commit 66cdb6b.

The change broke builds for OpenBSD. See discussion at
<rust-lang#3822 (comment)>.

Stable version: <rust-lang#3834>.
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Aug 16, 2024
This reverts commit 66cdb6b.

The change broke builds for OpenBSD. See discussion at
<rust-lang#3822 (comment)>.

`main` version: <rust-lang#3834>.
@tgross35
Copy link
Contributor

Reverts here #3834 and here #3835.

Feel free to reopen this if there is a better way to commonize things, we can make sure @semarie signs off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants