rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.09k stars 1.04k forks source link

Libc-test fails on NetBSD #1197

Open inferiorhumanorgans opened 5 years ago

inferiorhumanorgans commented 5 years ago

I'm not sure what the support expectations are here as NetBSD is listed as an untested platform, but here's the output of the tests on NetBSD 8.0.

/home/worker/test-rust-libc.sh
 in dir /home/worker/buildbot/nbsd8-build/build (timeout 1200 secs)
 watching logfiles {}
 argv: [b'/home/worker/test-rust-libc.sh']
 environment:
  EDITOR=vi
  ENV=/home/worker/.shrc
  HOME=/home/worker
  LOGNAME=worker
  MAIL=/var/mail/worker
  OLDPWD=/home/worker
  PATH=/home/worker/.cargo/bin:/home/worker/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin
  PKG_PATH=ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All/
  PWD=/home/worker/buildbot/nbsd8-build/build
  SHELL=/usr/pkg/bin/bash
  SHLVL=1
  SUDO_COMMAND=/usr/pkg/bin/bash
  SUDO_GID=100
  SUDO_UID=1001
  TERM=xterm-256color
  USER=worker
  USERNAME=worker
  _=/usr/pkg/bin/buildbot-worker3.6
 using PTY: False
NetBSD  8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
info: syncing channel updates for 'stable-x86_64-unknown-netbsd'
info: checking for self-updates
info: downloading self-update

  stable-x86_64-unknown-netbsd unchanged - rustc 1.31.1 (b6c32da9b 2018-12-18)

rustc 1.31.1 (b6c32da9b 2018-12-18)
    Finished dev [unoptimized + debuginfo] target(s) in 0.45s
     Running /home/worker/buildbot/nbsd8-build/build/target/debug/deps/linux_fcntl-6f4169ac44ebdb2e
RUNNING ALL TESTS
PASSED 0 tests
     Running /home/worker/buildbot/nbsd8-build/build/target/debug/deps/main-9aae4aee8abc9d16
RUNNING ALL TESTS
bad ifaddrs size: rust: 56 (0x38) != c 64 (0x40)
bad NET_MAXID value at byte 0: rust: 35 (0x23) != c 36 (0x24)
bad NET_RT_OOIFLIST value at byte 0: rust: 3 (0x3) != c 4 (0x4)
bad NET_RT_OIFLIST value at byte 0: rust: 4 (0x4) != c 5 (0x5)
bad NET_RT_IFLIST value at byte 0: rust: 5 (0x5) != c 6 (0x6)
bad NET_RT_MAXID value at byte 0: rust: 6 (0x6) != c 7 (0x7)
thread 'main' panicked at 'some tests failed', /home/worker/buildbot/nbsd8-build/build/target/debug/build/libc-test-2a6b9a208facfc9b/out/main.rs:11:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: test failed, to rerun pass '--test main'
program finished with exit code 101
elapsedTime=1.697112
gnzlbg commented 5 years ago

We are only testing that libc builds properly on NetBSD, we are not testing that its ABI is correct.

PRs welcome.

gnzlbg commented 5 years ago

Also ideally, one only needs to contribute a qemu-system build job that runs the tests on a netbsd image. We do this for sparc, s390x, and freebsd, so it shouldn't be hard.

gnzlbg commented 5 years ago

Renamed the issue, since the build actually works on NetBSD. What's failing are the libc-tests. Since NetBSD is not tested on CI, that's to be expected. PRs welcome.