jeaye/ncurses-rs

Cross-compiling breaks with ncurses-5.101.0?

Opened this issue · 3 comments

I'm trying to build a project with GitLab's CI using docker image katharostech/rust-osxcross.

It works nice for native build, however with --target=x86_64-apple-darwin it breaks like the following:

cargo build --target=x86_64-apple-darwin
   Compiling itoa v0.4.8
   Compiling ryu v1.0.6
   Compiling serde v1.0.130
   Compiling libc v0.2.109
   Compiling serde_json v1.0.72
   Compiling ncurses v5.101.0
error: failed to run custom build command for `ncurses v5.101.0`
Caused by:
  process didn't exit successfully: `/builds/me/myproject/target/debug/build/ncurses-21d2ecc62be4b2b5/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=NCURSES5_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=NCURSES_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rustc-link-lib=ncurses
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
--- stderr
cc: error: x86_64: No such file or directory
cc: error: unrecognized command line option '-arch'; did you mean '-march='?
thread 'main' panicked at 'assertion failed: command.status().expect("compilation failed").success()', /builds/me/myproject/.cargo/registry/src/github.com-1ecc6299db9ec823/ncurses-5.101.0/build.rs:105:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

And just in case on my local Ubuntu with OSXcross installed, it breaks in the similar manner, too.

Would be grateful for any hint or assistance :)

It's actually the same if trying to build i686-unknown-linux-gnu target on a x86_64 system. So, it's not really OSXCross-related issue.

But probably I'm just missing something extremely obvious? :)

Same for me. Logs can be found here.

   c1: fatal error C1083: Cannot open source file: 'D:\a\cursive-example\cursive-example\target\debug\build\ncurses-82fdfbbdf18706a5\out\chtype_size.c': Permission denied

  --- stderr
  cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
  thread 'main' panicked at 'assertion failed: command.status().expect(\"compilation failed\").success()', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ncurses-5.101.0\build.rs:105:5

No problem on x86_64-unknown-linux-gnu but both x86_64-windows-mvsc and x86_64-apple-darwin cannot compile ncurses v5.101.0 with a similar output.

I use a similar CI configuration on another project without problem since today.

@yozhgoor that's #127 ie. it doesn't support Windows