My use case is cross-compiling this crate for linux on a macOS host machine. This check in the crate's build.rs erroneously uses the cargo cfg attribute which is based on the host system in a build script, instead of the target system.
// Filters are extracted from `libc` filters
#[cfg(not(any(target_os = "android", target_os = "linux", target_os = "l4re",)))]
compile_error!("Building procfs on an for a unsupported platform. Currently only linux and android are supported")
Could this condition instead check the CARGO_CFG_TARGET_OS environment variable which should correctly report the target system OS during a build script?
My use case is cross-compiling this crate for linux on a macOS host machine. This check in the crate's
build.rs
erroneously uses the cargo cfg attribute which is based on the host system in a build script, instead of the target system.Could this condition instead check the
CARGO_CFG_TARGET_OS
environment variable which should correctly report the target system OS during a build script?