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

Freebsd items #2451

Merged
merged 5 commits into from
Oct 20, 2021
Merged

Freebsd items #2451

merged 5 commits into from
Oct 20, 2021

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

@rust-highfive
Copy link

r? @JohnTitor

(rust-highfive has picked a reviewer for you, use r? to override)

@JohnTitor
Copy link
Member

Seems you messed up the branch.

@GuillaumeGomez
Copy link
Member Author

I didn't finish the rebase for whatever reason. Should be better now. Let's see if CI is happy, I think a few things will be broken so I'll look how to fix them and check how to ignore some fields checks as well if needed.

@GuillaumeGomez GuillaumeGomez force-pushed the freebsd-items branch 4 times, most recently from 13d0662 to e4c578a Compare October 15, 2021 19:24
@GuillaumeGomez
Copy link
Member Author

@JohnTitor: Any idea why it's complaining about constants not being used?

error: constant is never used: `PRIO_PROCESS`
    --> src/unix/bsd/freebsdlike/freebsd/mod.rs:1814:1
     |
1814 | pub const PRIO_PROCESS: ::c_int = 0;
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@JohnTitor
Copy link
Member

Because it's already declared on a parent module:

pub const PRIO_PROCESS: ::c_int = 0;

@GuillaumeGomez
Copy link
Member Author

Ah nice! Less work for me. :3

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 16, 2021

I updated locally the link to ctest2 until it's published. So now I get:

  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26555:23: error: redefinition of '__test_size_rusage'
  cargo:warning=             uint64_t __test_size_rusage(void) { return sizeof(struct rusage); }
  cargo:warning=                      ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2621:23: note: previous definition is here
  cargo:warning=             uint64_t __test_size_rusage(void) { return sizeof(struct rusage); }
  cargo:warning=                      ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26556:23: error: redefinition of '__test_align_rusage'
  cargo:warning=             uint64_t __test_align_rusage(void) {
  cargo:warning=                      ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2622:23: note: previous definition is here
  cargo:warning=             uint64_t __test_align_rusage(void) {
  cargo:warning=                      ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26568:27: error: redefinition of '__test_offset_rusage_ru_utime'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_utime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2634:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_utime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26571:27: error: redefinition of '__test_fsize_rusage_ru_utime'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_utime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2637:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_utime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26577:34: error: redefinition of '__test_field_type_rusage_ru_utime'
  cargo:warning=                 struct timeval* __test_field_type_rusage_ru_utime(struct rusage* b) {
  cargo:warning=                                 ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2643:34: note: previous definition is here
  cargo:warning=                 struct timeval* __test_field_type_rusage_ru_utime(struct rusage* b) {
  cargo:warning=                                 ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26582:27: error: redefinition of '__test_offset_rusage_ru_stime'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_stime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2648:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_stime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26585:27: error: redefinition of '__test_fsize_rusage_ru_stime'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_stime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2651:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_stime(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26591:34: error: redefinition of '__test_field_type_rusage_ru_stime'
  cargo:warning=                 struct timeval* __test_field_type_rusage_ru_stime(struct rusage* b) {
  cargo:warning=                                 ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2657:34: note: previous definition is here
  cargo:warning=                 struct timeval* __test_field_type_rusage_ru_stime(struct rusage* b) {
  cargo:warning=                                 ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26596:27: error: redefinition of '__test_offset_rusage_ru_maxrss'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_maxrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2662:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_maxrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26599:27: error: redefinition of '__test_fsize_rusage_ru_maxrss'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_maxrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2665:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_maxrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26605:25: error: redefinition of '__test_field_type_rusage_ru_maxrss'
  cargo:warning=                  long* __test_field_type_rusage_ru_maxrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2671:25: note: previous definition is here
  cargo:warning=                  long* __test_field_type_rusage_ru_maxrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26610:27: error: redefinition of '__test_offset_rusage_ru_ixrss'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_ixrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2676:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_ixrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26613:27: error: redefinition of '__test_fsize_rusage_ru_ixrss'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_ixrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2679:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_ixrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26619:25: error: redefinition of '__test_field_type_rusage_ru_ixrss'
  cargo:warning=                  long* __test_field_type_rusage_ru_ixrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2685:25: note: previous definition is here
  cargo:warning=                  long* __test_field_type_rusage_ru_ixrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26624:27: error: redefinition of '__test_offset_rusage_ru_idrss'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_idrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2690:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_idrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26627:27: error: redefinition of '__test_fsize_rusage_ru_idrss'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_idrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2693:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_idrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26633:25: error: redefinition of '__test_field_type_rusage_ru_idrss'
  cargo:warning=                  long* __test_field_type_rusage_ru_idrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2699:25: note: previous definition is here
  cargo:warning=                  long* __test_field_type_rusage_ru_idrss(struct rusage* b) {
  cargo:warning=                        ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26638:27: error: redefinition of '__test_offset_rusage_ru_isrss'
  cargo:warning=                 uint64_t __test_offset_rusage_ru_isrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2704:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_offset_rusage_ru_isrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:26641:27: error: redefinition of '__test_fsize_rusage_ru_isrss'
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_isrss(void) {
  cargo:warning=                          ^
  cargo:warning=/root/libc/target/x86_64-unknown-freebsd/debug/build/libc-test-809464fa918cfbf9/out/main.c:2707:27: note: previous definition is here
  cargo:warning=                 uint64_t __test_fsize_rusage_ru_isrss(void) {
  cargo:warning=                          ^
  cargo:warning=fatal error: too many errors emitted, stopping now [-ferror-limit=]
  cargo:warning=20 errors generated.
  exit status: 1

The fields don't seem duplicated so I'm not sure what would be the issue here. Any idea maybe?

@JohnTitor
Copy link
Member

I guess some headers have rusage and it causes a conflict.

@GuillaumeGomez
Copy link
Member Author

What do you mean? We have two ".h" including the same one you mean? Shouldn't #ifndef protects us from such cases to happen?

@JohnTitor
Copy link
Member

JohnTitor commented Oct 16, 2021

I guess so because I remember that the same (or similar) failure happened in the past and it was due to import some similar header files (IIRC something like sys/foo.h was involved). But I'm not too familiar with FreeBSD, I would need some debugging to provide further help (looking at the generated C file would be a help, I imagine).

@GuillaumeGomez GuillaumeGomez force-pushed the freebsd-items branch 2 times, most recently from b14a3b7 to d7dfd3a Compare October 18, 2021 16:10
@GuillaumeGomez
Copy link
Member Author

The last error is pretty interesting:

cargo:warning=/tmp/cirrus-ci-build/target/x86_64-unknown-freebsd/debug/build/libc-test-46bad6d5373dd9cb/out/main.c:33091:65: error: use of undeclared identifier 'KVME_TYPE_GUARD'
  cargo:warning=            static const int __test_const_KVME_TYPE_GUARD_val = KVME_TYPE_GUARD;

The KVME_TYPE_GUARD is defined in the sys/user.h header (which is added by the test script) alongside a few others KVME_* constants (which are found). How strange.

@JohnTitor
Copy link
Member

It's newly added and hasn't been released yet, I think: freebsd/freebsd-src@25c6318

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 18, 2021

Ah, I shouldn't have look at the freebsd source code directly then haha. Thanks a lot for the information!

@GuillaumeGomez GuillaumeGomez force-pushed the freebsd-items branch 3 times, most recently from f300a01 to 00a8ef9 Compare October 18, 2021 19:46
@GuillaumeGomez
Copy link
Member Author

I fixed the PartialEq issue using the usual hack: I simply changed the array into [[c_char; 23]; 2] and now it's happy. I'm currently looking into the rust-semver issue: it seems to be compatible when changing private fields.

bors added a commit to rust-lang/rust-semverver that referenced this pull request Oct 19, 2021
More flexible rule around adding public fields to struct with private fields

This comes from rust-lang/libc#2451.

Before this PR, the `kinfo_proc` struct only had one field which was private. I added the missing fields and made them all public. It doesn't seem to be a semver breaking change as the code using this struct previously will still work exactly the same.
@JohnTitor
Copy link
Member

As the above comment says, we should also update the nightly version in the CI config.

@GuillaumeGomez
Copy link
Member Author

Where is it set? I looked in the ci folder but didn't find it...

@JohnTitor
Copy link
Member

Here:

semver_linux:
name: Semver Linux
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Setup Rust toolchain
# Should update the semverver revision in semver.sh if we touch nightly ver.
run: TOOLCHAIN=nightly-2021-07-23 sh ./ci/install-rust.sh
- name: Check breaking changes
run: sh ci/semver.sh linux
semver_macos:
name: Semver macOS
runs-on: macos-11
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Setup Rust toolchain
# Pin nightly version to make semverver compilable.
run: TOOLCHAIN=nightly-2021-07-23 sh ./ci/install-rust.sh
- name: Check breaking changes
run: sh ci/semver.sh macos

@GuillaumeGomez
Copy link
Member Author

I was simply not looking at the right place. Thanks!

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 20, 2021

Updated the CI nightly version as well!

@JohnTitor
Copy link
Member

🎉, let's give it another try.
@bors r+

@bors
Copy link
Contributor

bors commented Oct 20, 2021

📌 Commit b540e1b has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Oct 20, 2021

⌛ Testing commit b540e1b with merge 6492988...

@bors
Copy link
Contributor

bors commented Oct 20, 2021

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

@bors bors merged commit 6492988 into rust-lang:master Oct 20, 2021
@GuillaumeGomez GuillaumeGomez deleted the freebsd-items branch October 20, 2021 19:46
@GuillaumeGomez
Copy link
Member Author

Thanks a lot for your help @JohnTitor ! :)

@lnicola
Copy link
Member

lnicola commented Nov 2, 2021

This will break rust-lang/rust on the next update, filed rust-lang/rust#90495.

@GuillaumeGomez
Copy link
Member Author

@lnicola Good catch, thanks!

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2021
Pull in `libkvm` on FreeBSD

This is needed when updating `libc` after rust-lang/libc#2451.

Spotted in rust-lang#90464 where it caused `rust-analyzer` to fail to link.

Similar to rust-lang#88676.
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.

6 participants