Open yurivict opened 3 years ago
It fails to build on NetBSD, 32 bits as well with a very similar output while building nushell
,
The following warnings were emitted during compilation:
warning: c/netbsd.c:44:10: error: conflicting types for 'get_cpu_speed'
warning: uint64_t get_cpu_speed(void) {
warning: ^~~~~~~~~~~~~
warning: In file included from c/netbsd.c:18:0:
warning: c/info.h:31:15: note: previous declaration of 'get_cpu_speed' was here
warning: unsigned long get_cpu_speed(void);
warning: ^~~~~~~~~~~~~
error: failed to run custom build command for `sys-info v0.9.0`
Caused by:
process didn't exit successfully: `/tmp/work/shells/nushell/work/nushell-0.37.0/target/release/build/sys-info-43fe4771b44c5a77/build-script-build` (exit status: 1)
--- stdout
cargo:rustc-flags=-l pthread
TARGET = Some("i586-unknown-netbsd")
OPT_LEVEL = Some("z")
HOST = Some("i586-unknown-netbsd")
CC_i586-unknown-netbsd = None
CC_i586_unknown_netbsd = None
HOST_CC = None
CC = Some("gcc")
CFLAGS_i586-unknown-netbsd = None
CFLAGS_i586_unknown_netbsd = None
HOST_CFLAGS = None
CFLAGS = Some("-O2 -fPIC -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include")
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = None
running: "gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m32" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I/usr/X11R7/include" "-o" "/tmp/work/shells/nushell/work/nushell-0.37.0/target/release/build/sys-info-120d345b9c012806/out/c/netbsd.o" "-c" "c/netbsd.c"
cargo:warning=c/netbsd.c:44:10: error: conflicting types for 'get_cpu_speed'
cargo:warning= uint64_t get_cpu_speed(void) {
cargo:warning= ^~~~~~~~~~~~~
cargo:warning=In file included from c/netbsd.c:18:0:
cargo:warning=c/info.h:31:15: note: previous declaration of 'get_cpu_speed' was here
cargo:warning= unsigned long get_cpu_speed(void);
cargo:warning= ^~~~~~~~~~~~~
exit status: 1
--- stderr
error occurred: Command "gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m32" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I/usr/X11R7/include" "-o" "/tmp/work/shells/nushell/work/nushell-0.37.0/target/release/build/sys-info-120d345b9c012806/out/c/netbsd.o" "-c" "c/netbsd.c" with args "gcc" did not execute successfully (status code exit status: 1).
warning: build failed, waiting for other jobs to finish...
error: build failed
*** Error code 101
It builds fine on x86_64
Returning uint64_t
from these functions looks bogus in the first place, CPU count and speed are naturally not that huge and would hardly ever overflow even a short int
. :-)
Workaround by replacing "unsigned long" with "uint64_t" fix build/run.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267290
Should we wait for a better and correct fix for this or is it ok to use this workaround?
Thanks @danfe
Please see a complete log: http://beefy17.nyi.freebsd.org/data/main-i386-default/p560362_s58661b3ba9/logs/starship-0.48.0.log (IPv6 URL).