Skip to content

OpenBSD is broken due to char_def #4209

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

Closed
semarie opened this issue Dec 18, 2024 · 6 comments · Fixed by #4210
Closed

OpenBSD is broken due to char_def #4209

semarie opened this issue Dec 18, 2024 · 6 comments · Fixed by #4210
Labels
C-bug Category: bug

Comments

@semarie
Copy link
Contributor

semarie commented Dec 18, 2024

My daily CI on OpenBSD (x86_64) failed (testing 5f41b7a)

As several PR regarding char_def was merged, I am unsure which one caused the regression.

Cc: @taiki-e @tgross35

Wed Dec 18 08:00:11 CET 2024: run_test: build and run the testsuite
+ mirrors_url=https://ci-mirrors.rust-lang.org/libc
+ target=x86_64-unknown-openbsd
+ export RUST_BACKTRACE=1
+ [ -n  ]
+ cmd=cargo test --target x86_64-unknown-openbsd 
+ cmd=cargo test --target x86_64-unknown-openbsd  --workspace
+ [ x86_64-unknown-openbsd = s390x-unknown-linux-gnu ]
+ cargo test --target x86_64-unknown-openbsd --workspace --no-default-features
    Updating crates.io index
     Locking 42 packages to latest compatible versions
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling libc v0.2.168
   Compiling serde v1.0.216
   Compiling memchr v2.7.4
   Compiling cfg-if v0.1.10
   Compiling dirs-sys v0.3.7
   Compiling semver v1.0.24
   Compiling serde_json v1.0.133
   Compiling dirs v2.0.2
   Compiling ryu v1.0.18
   Compiling term v0.6.1
   Compiling quote v1.0.37
   Compiling itoa v1.0.14
   Compiling unicode-xid v0.2.6
   Compiling libc v1.0.0-alpha.1 (/data/semarie/repos/rust/libc-rs)
   Compiling syn v2.0.90
   Compiling aho-corasick v1.1.3
   Compiling bitflags v1.3.2
   Compiling regex-syntax v0.8.5
   Compiling shlex v1.3.0
   Compiling serde_derive v1.0.216
   Compiling log v0.4.22
   Compiling cc v1.2.4
   Compiling regex-automata v0.4.9
   Compiling rustc_version v0.4.1
   Compiling regex v1.11.1
   Compiling garando_pos v0.1.0
   Compiling garando_errors v0.1.0
   Compiling garando_syntax v0.1.1
   Compiling ctest2 v0.4.9
   Compiling libc-test v0.1.0 (/data/semarie/repos/rust/libc-rs/libc-test)
The following warnings were emitted during compilation:

warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:87:68: error: use of undeclared identifier 'char_def'
warning: [email protected]:              uint64_t __test_size_c_char_def(void) { return sizeof(char_def); }
warning: [email protected]:                                                                    ^
warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:91:19: error: unknown type name 'char_def'
warning: [email protected]:                   char_def v;
warning: [email protected]:                   ^
warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:101:27: error: use of undeclared identifier 'char_def'
warning: [email protected]:                 return (((char_def) -1) < 0);
warning: [email protected]:                           ^
warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:110:14: error: unknown type name 'char_def'
warning: [email protected]:              char_def __test_roundtrip_c_char_def(
warning: [email protected]:              ^
warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:111:37: error: unknown type name 'char_def'
warning: [email protected]:                  int32_t rust_size, char_def value, int* error, unsigned char* pad
warning: [email protected]:                                     ^
warning: [email protected]: /data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:114:40: error: use of undeclared identifier 'char_def'
warning: [email protected]:                 int size = (int)sizeof(char_def);
warning: [email protected]:                                        ^
warning: [email protected]: 6 errors generated.

error: failed to run custom build command for `libc-test v0.1.0 (/data/semarie/repos/rust/libc-rs/libc-test)`

Caused by:
  process didn't exit successfully: `/data/semarie/repos/rust/build-libc/build/debug/build/libc-test-e9442936c835ae21/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=build.rs
  OUT_DIR = Some(/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out)
  OPT_LEVEL = Some(0)
  TARGET = Some(x86_64-unknown-openbsd)
  HOST = Some(x86_64-unknown-openbsd)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-openbsd
  CC_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_openbsd
  CC_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = Some(/usr/local/bin/sccache)
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-openbsd
  CFLAGS_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_openbsd
  CFLAGS_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:rerun-if-env-changed=AR_x86_64-unknown-openbsd
  AR_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_openbsd
  AR_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-openbsd
  ARFLAGS_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_openbsd
  ARFLAGS_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rustc-link-lib=static=cmsg
  cargo:rustc-link-search=native=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out
  OUT_DIR = Some(/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out)
  OPT_LEVEL = Some(0)
  TARGET = Some(x86_64-unknown-openbsd)
  HOST = Some(x86_64-unknown-openbsd)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-openbsd
  CC_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_openbsd
  CC_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = Some(/usr/local/bin/sccache)
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-openbsd
  CFLAGS_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_openbsd
  CFLAGS_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:rerun-if-env-changed=AR_x86_64-unknown-openbsd
  AR_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_openbsd
  AR_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-openbsd
  ARFLAGS_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_openbsd
  ARFLAGS_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rustc-link-lib=static=makedev
  cargo:rustc-link-search=native=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out
  -----------------------------------------
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/lib.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/macros.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/fixed_width_ints.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/unix/mod.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/unix/bsd/mod.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/unix/bsd/netbsdlike/mod.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/unix/bsd/netbsdlike/openbsd/mod.rs
  cargo:rerun-if-changed=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/src-hotfix/unix/bsd/netbsdlike/openbsd/x86_64.rs
  TARGET = Some(x86_64-unknown-openbsd)
  OPT_LEVEL = Some(0)
  HOST = Some(x86_64-unknown-openbsd)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-openbsd
  CC_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_openbsd
  CC_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = Some(/usr/local/bin/sccache)
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-openbsd
  CFLAGS_x86_64-unknown-openbsd = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_openbsd
  CFLAGS_x86_64_unknown_openbsd = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:87:68: error: use of undeclared identifier 'char_def'
  cargo:warning=             uint64_t __test_size_c_char_def(void) { return sizeof(char_def); }
  cargo:warning=                                                                   ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:91:19: error: unknown type name 'char_def'
  cargo:warning=                  char_def v;
  cargo:warning=                  ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:101:27: error: use of undeclared identifier 'char_def'
  cargo:warning=                return (((char_def) -1) < 0);
  cargo:warning=                          ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:110:14: error: unknown type name 'char_def'
  cargo:warning=             char_def __test_roundtrip_c_char_def(
  cargo:warning=             ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:111:37: error: unknown type name 'char_def'
  cargo:warning=                 int32_t rust_size, char_def value, int* error, unsigned char* pad
  cargo:warning=                                    ^
  cargo:warning=/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c:114:40: error: use of undeclared identifier 'char_def'
  cargo:warning=                int size = (int)sizeof(char_def);
  cargo:warning=                                       ^
  cargo:warning=6 errors generated.

  --- stderr
  rust version: 1.83.0

  error occurred in cc-rs: Command LC_ALL="C" "/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-77b22fe3739726bb/out/41f048999db2a035-main.o" "-c"
"/data/semarie/repos/rust/build-libc/build/x86_64-unknown-openbsd/debug/build/libc-test-77b22fe3739726bb/out/main.c" with args cc did not execute successfully (status code exit status: 1).
@semarie semarie added the C-bug Category: bug label Dec 18, 2024
@tgross35
Copy link
Contributor

Could you confirm whether c_char should be i8 or u8 on that target? Nothing x86 should have changed so this one is a bit surprising.

@tgross35
Copy link
Contributor

Oh, this is the problem from ctest rather than the incorrect sign. I'll take a look.

@taiki-e
Copy link
Member

taiki-e commented Dec 18, 2024

This is an issue introduced in #4198.

We should add skip_type like the following to test_openbsd.

    cfg.skip_type(move |ty| {
        match ty {
            // `c_char_def` is always public but not always reexported.
            "c_char_def" => true,

            _ => false,
        }
    });

fn test_openbsd(target: &str) {

(I think the best way would be to remove c_char_def itself though: #4202)

tgross35 added a commit to tgross35/rust-libc that referenced this issue Dec 18, 2024
@tgross35
Copy link
Contributor

Fix up at #4210, would you be able to test this @semarie?

(I think the best way would be to remove c_char_def itself though: #4202)

Indeed, but I want to double check that each target is consistent so I won't be able to get it into today's release.

@tgross35
Copy link
Contributor

Also @semarie are these runs public on something like buildbot? I don't think we can include OpenBSD as part of our CI unless it moves up to tier 2, but maybe we could put together a dashboard for builds running on external systems.

@semarie
Copy link
Contributor Author

semarie commented Dec 18, 2024

my CI is just a daily cron task which fetch HEAD, build and run the testsuite, and I receive an email when it fails to complete. so no dashboard.

tgross35 added a commit to tgross35/rust-libc that referenced this issue Dec 18, 2024
Fixes rust-lang#4209

(backport <rust-lang#4210>)
(cherry picked from commit 9ff3409)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants