You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when cross-compiling for 32-bit linux, the libc::sysconf call returns a 32-bit integer which is incompatible with the i64 it wants to be stored in.
PR #430 made this change but it also removed the cast that made the previous version work on all platforms.
To Reproduce
Cross-compile using the i686-unknown-linux-musl target.
Error: --> /cargo/registry/src/github.com-1ecc6299db9ec823/prometheus-0.13.1/src/process_collector.rs:199:13
|
197 | static ref PAGESIZE: i64 = {
| --- expected i64 because of return type
198 | unsafe {
199 | libc::sysconf(libc::_SC_PAGESIZE)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i64, found i32
|
help: you can convert an i32 to an i64
|
199 | libc::sysconf(libc::_SC_PAGESIZE).into()
| +++++++
For more information about this error, try rustc --explain E0308.
error: could not compile prometheus due to 2 previous errors
Expected behavior
There is no reason why it shouldn't be able to compile on 32-bit systems.
Additional context
Ran into this problem while building multi-arch docker images. It might be an idea to add cross-compilation to CI to catch problems like this in the future
The text was updated successfully, but these errors were encountered:
Describe the bug
when cross-compiling for 32-bit linux, the
libc::sysconf
call returns a 32-bit integer which is incompatible with thei64
it wants to be stored in.PR #430 made this change but it also removed the cast that made the previous version work on all platforms.
To Reproduce
Cross-compile using the
i686-unknown-linux-musl
target.Expected behavior
There is no reason why it shouldn't be able to compile on 32-bit systems.
System information
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.61.0 (fe5b13d68 2022-05-18)
Additional context
Ran into this problem while building multi-arch docker images. It might be an idea to add cross-compilation to CI to catch problems like this in the future
The text was updated successfully, but these errors were encountered: