rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.55k stars 57 forks source link

error: failed to run custom build command for `libsodium-sys v0.2.7` #133

Closed f4nff closed 1 year ago

f4nff commented 1 year ago
rustup default nightly
rustup target add x86_64-pc-windows-gnu
root@vultr:~/rustdesk# cargo zigbuild --target x86_64-pc-windows-gnu -p hbbs -Z namespaced-features --bin my-id-server
warning: flag `-Z namespaced-features` has been stabilized in the 1.60 release, and is no longer necessary
  Namespaced features are now always available.

warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /root/rustdesk/libs/hyper-0.14.20/Cargo.toml
workspace: /root/rustdesk/Cargo.toml
warning: /root/rustdesk/libs/jpeg-decoder-0.3.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/hbbs/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/hbb_common/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/native-tls-0.2.10/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/simple_rc/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/image-0.24.6/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/enigo/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/rocket-0.5.0-rc.2/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/clipboard/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/portable/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/rocket_http-0.5.0-rc.2/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/scrap/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/async-native-tls-0.4.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/rpassword-7.2.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/tao-0.18.1/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/tao-0.18.1/tao-macros/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/arboard-3.2.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/quest-0.3.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/virtual_display/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/virtual_display/dylib/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/hyper-0.14.20/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/rtoolbox-0.0.1/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/tiff-0.9.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
warning: /root/rustdesk/libs/async-speed-limit-0.4.0/Cargo.toml: the cargo feature `edition2021` has been stabilized in the 1.56 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field for more information about using this feature.
   Compiling cfg-if v1.0.0
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling winapi v0.3.9
   Compiling serde v1.0.162
   Compiling getrandom v0.2.9
   Compiling log v0.4.17
   Compiling typenum v1.16.0
   Compiling rand_core v0.6.4
   Compiling generic-array v0.14.7
   Compiling memchr v2.5.0
   Compiling pin-project-lite v0.2.9
   Compiling windows_x86_64_gnu v0.48.0
   Compiling bytes v1.4.0
   Compiling scopeguard v1.1.0
   Compiling windows-targets v0.48.0
   Compiling windows_x86_64_gnu v0.42.2
   Compiling windows-targets v0.42.2
   Compiling windows-sys v0.48.0
   Compiling crypto-common v0.1.6
   Compiling windows-sys v0.45.0
   Compiling once_cell v1.17.1
   Compiling futures-core v0.3.28
   Compiling socket2 v0.4.9
   Compiling num_cpus v1.15.0
   Compiling libc v0.2.144
   Compiling smallvec v1.10.0
   Compiling itoa v1.0.6
   Compiling parking_lot_core v0.9.7
   Compiling lock_api v0.4.9
   Compiling parking_lot v0.12.1
   Compiling mio v0.8.6
   Compiling futures-io v0.3.28
   Compiling futures-sink v0.3.28
   Compiling slab v0.4.8
   Compiling tokio v1.28.1
   Compiling subtle v2.4.1
   Compiling futures-channel v0.3.28
   Compiling futures-task v0.3.28
   Compiling pin-utils v0.1.0
   Compiling futures-util v0.3.28
   Compiling cpufeatures v0.2.7
   Compiling thiserror v1.0.40
   Compiling block-buffer v0.10.4
   Compiling fnv v1.0.7
   Compiling http v0.2.9
   Compiling digest v0.10.6
   Compiling tracing-core v0.1.30
   Compiling percent-encoding v2.2.0
   Compiling bitflags v1.3.2
   Compiling tracing v0.1.37
   Compiling crossbeam-utils v0.8.15
   Compiling inout v0.1.3
   Compiling ring v0.16.20
   Compiling cipher v0.4.4
   Compiling httparse v1.8.0
   Compiling protobuf v3.2.0
   Compiling anyhow v1.0.71
   Compiling which v4.4.0
   Compiling memoffset v0.8.0
   Compiling unicase v2.6.0
   Compiling num-integer v0.1.45
   Compiling ppv-lite86 v0.2.17
   Compiling ryu v1.0.13
   Compiling gcc v0.3.55
   Compiling rust-crypto v0.2.36
   Compiling rand_chacha v0.3.1
   Compiling protobuf-parse v3.2.0
   Compiling num-traits v0.2.15
   Compiling openssl-sys v0.9.87
   Compiling crossbeam-epoch v0.9.14
   Compiling libz-sys v1.1.9
   Compiling ahash v0.7.6
   Compiling backtrace v0.3.67
   Compiling spin v0.5.2
   Compiling tinyvec_macros v0.1.1
   Compiling tower-service v0.3.2
   Compiling base64 v0.13.1
   Compiling curl v0.4.44
   Compiling untrusted v0.7.1
   Compiling crc32fast v1.3.2
   Compiling ref-cast v1.0.16
   Compiling tinyvec v1.6.0
   Compiling protobuf-codegen v3.2.0
   Compiling rand v0.8.5
   Compiling crossbeam-channel v0.5.8
   Compiling pear_codegen v0.2.4
   Compiling futures-executor v0.3.28
   Compiling form_urlencoded v1.1.0
   Compiling http-body v0.4.5
   Compiling zstd-sys v1.6.2+zstd.1.5.1
   Compiling memoffset v0.6.5
   Compiling httpdate v1.0.2
   Compiling foreign-types-shared v0.1.1
   Compiling mime v0.3.17
   Compiling foreign-types v0.3.2
   Compiling futures v0.3.28
   Compiling hbb_common v0.1.0 (/root/rustdesk/libs/hbb_common)
   Compiling crossbeam-deque v0.8.3
   Compiling hashbrown v0.12.3
   Compiling unicode-normalization v0.1.22
   Compiling curl-sys v0.4.61+curl-8.0.1
   Compiling time v0.3.9
   Compiling tokio-util v0.7.8
   Compiling rayon-core v1.11.0
   Compiling openssl v0.10.52
   Compiling universal-hash v0.5.0
   Compiling ref-cast-impl v1.0.16
   Compiling time v0.1.45
   Compiling dirs-sys-next v0.1.2
   Compiling unicode-bidi v0.3.13
   Compiling try-lock v0.2.4
   Compiling either v1.8.1
   Compiling openssl-probe v0.1.5
   Compiling glob v0.3.1
   Compiling async-trait v0.1.68
   Compiling opaque-debug v0.3.0
   Compiling idna v0.3.0
   Compiling polyval v0.6.0
   Compiling want v0.3.0
   Compiling zstd-safe v4.1.3+zstd.1.5.1
   Compiling aes v0.8.2
   Compiling native-tls v0.2.10 (/root/rustdesk/libs/native-tls-0.2.10)
   Compiling libsodium-sys v0.2.7
   Compiling crossbeam-queue v0.3.8
   Compiling pin-project v1.0.12
   Compiling aho-corasick v1.0.1
   Compiling atty v0.2.14
   Compiling uncased v0.9.9
   Compiling cookie v0.17.0
   Compiling rand v0.4.6
   Compiling gimli v0.27.2
   Compiling bitflags v2.2.1
   Compiling rustls v0.20.8
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.7.1
   Compiling signature v1.6.4
   Compiling lexical-core v0.7.6
   Compiling byteorder v1.4.3
   Compiling overload v0.1.1
   Compiling serde_json v1.0.96
   Compiling num_threads v0.1.6
   Compiling iana-time-zone v0.1.56
   Compiling adler v1.0.2
   Compiling unicode-width v0.1.10
   Compiling dlv-list v0.3.0
   Compiling ordered-multimap v0.4.3
   Compiling textwrap v0.11.0
   Compiling miniz_oxide v0.6.2
   Compiling chrono v0.4.24
   Compiling nu-ansi-term v0.46.0
   Compiling ed25519 v1.5.3
   Compiling regex v1.8.1
   Compiling devise_core v0.4.1
   Compiling addr2line v0.19.0
   Compiling rand v0.3.23
warning: use of deprecated method `imp::openssl::pkcs12::Pkcs12Ref::parse`: Use parse2 instead
   --> libs/native-tls-0.2.10/src/imp/openssl.rs:165:29
    |
165 |         let parsed = pkcs12.parse(pass)?;
    |                             ^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated field `imp::openssl::pkcs12::ParsedPkcs12::pkey`: Use ParsedPkcs12_2 instead
   --> libs/native-tls-0.2.10/src/imp/openssl.rs:167:19
    |
167 |             pkey: parsed.pkey,
    |                   ^^^^^^^^^^^

warning: use of deprecated field `imp::openssl::pkcs12::ParsedPkcs12::cert`: Use ParsedPkcs12_2 instead
   --> libs/native-tls-0.2.10/src/imp/openssl.rs:168:19
    |
168 |             cert: parsed.cert,
    |                   ^^^^^^^^^^^

warning: use of deprecated field `imp::openssl::pkcs12::ParsedPkcs12::chain`: Use ParsedPkcs12_2 instead
   --> libs/native-tls-0.2.10/src/imp/openssl.rs:172:20
    |
172 |             chain: parsed.chain.into_iter().flatten().rev().collect(),
    |                    ^^^^^^^^^^^^

warning: `native-tls` (lib) generated 4 warnings
   Compiling url v2.3.1
   Compiling nix v0.23.2
   Compiling mime_guess v2.0.4
   Compiling rayon v1.7.0
   Compiling ghash v0.5.0
   Compiling directories-next v2.0.0
   Compiling sct v0.7.0
   Compiling webpki v0.22.0
   Compiling ctr v0.9.2
   Compiling tokio-util v0.6.10
   Compiling is-terminal v0.4.7
   Compiling hmac v0.12.1
   Compiling io-lifetimes v1.0.10
   Compiling aead v0.5.2
   Compiling object v0.30.3
   Compiling toml v0.5.11
   Compiling nom v5.1.3
   Compiling cookie v0.16.2
   Compiling indexmap v1.9.3
   Compiling num-bigint v0.4.3
   Compiling rustc-demangle v0.1.23
   Compiling inlinable_string v0.1.15
   Compiling termcolor v1.2.0
   Compiling yansi v0.5.1
   Compiling humantime v2.1.0
   Compiling strsim v0.8.0
   Compiling rustc-serialize v0.3.24
   Compiling futures-timer v3.0.2
   Compiling tower-layer v0.3.2
   Compiling vec_map v0.8.2
   Compiling static_assertions v1.1.0
   Compiling ntapi v0.4.1
   Compiling arrayvec v0.5.2
   Compiling base64 v0.21.0
   Compiling ansi_term v0.12.1
   Compiling clap v2.34.0
   Compiling hyper v0.14.26
   Compiling async-speed-limit v0.4.0 (/root/rustdesk/libs/async-speed-limit-0.4.0)
   Compiling pear v0.2.4
   Compiling flexi_logger v0.25.4
   Compiling env_logger v0.9.3
   Compiling confy v0.4.0 (https://github.com/open-trade/confy#630cc28a)
   Compiling aes-gcm v0.10.1
   Compiling hkdf v0.12.3
   Compiling tokio-socks v0.5.1-1 (https://github.com/open-trade/tokio-socks#7034e792)
   Compiling sysinfo v0.28.4
   Compiling zstd v0.9.2+zstd.1.5.1
   Compiling mac_address v1.1.4
   Compiling async-native-tls v0.4.0 (/root/rustdesk/libs/async-native-tls-0.4.0)
   Compiling sodiumoxide v0.2.7
   Compiling sha-1 v0.10.1
   Compiling devise_codegen v0.4.1
   Compiling rust-ini v0.18.0
   Compiling dirs-next v2.0.0
error: failed to run custom build command for `libsodium-sys v0.2.7`

Caused by:
  process didn't exit successfully: `/root/rustdesk/target/debug/build/libsodium-sys-423eabe9f63cb793/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=SODIUM_LIB_DIR
  cargo:rerun-if-env-changed=SODIUM_SHARED
  cargo:rerun-if-env-changed=SODIUM_USE_PKG_CONFIG
  cargo:rerun-if-env-changed=SODIUM_DISABLE_PIE
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-pc-windows-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-gnu
  CC_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_gnu
  CC_x86_64_pc_windows_gnu = Some("/root/.cache/cargo-zigbuild/0.16.7/zigcc-x86_64-pc-windows-gnu.sh")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-gnu
  CFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_gnu
  CFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  checking build system type... x86_64-pc-linux-gnu
  checking host system type...
  --- stderr
  Invalid configuration `x86_64-pc-windows-gnu': Kernel `windows' not known to work with OS `gnu'.
  configure: error: /bin/bash build-aux/config.sub x86_64-pc-windows-gnu failed
  thread 'main' panicked at '
  Failed to configure libsodium using cd "/root/rustdesk/target/x86_64-pc-windows-gnu/debug/build/libsodium-sys-8ed1534451b1b280/out/source/libsodium" && CC="/root/.cache/cargo-zigbuild/0.16.7/zigcc-x86_64-pc-windows-gnu.sh" CFLAGS="-O0 -ffunction-sections -fdata-sections -gdwarf-2 -fno-omit-frame-pointer -m64 -Wall -Wextra" "/root/rustdesk/target/x86_64-pc-windows-gnu/debug/build/libsodium-sys-8ed1534451b1b280/out/source/libsodium/configure" "--prefix=/root/rustdesk/target/x86_64-pc-windows-gnu/debug/build/libsodium-sys-8ed1534451b1b280/out/installed" "--libdir=/root/rustdesk/target/x86_64-pc-windows-gnu/debug/build/libsodium-sys-8ed1534451b1b280/out/installed/lib" "--host=x86_64-pc-windows-gnu" "--enable-shared=no"
  CFLAGS=-O0 -ffunction-sections -fdata-sections -gdwarf-2 -fno-omit-frame-pointer -m64 -Wall -Wextra
  CC=/root/.cache/cargo-zigbuild/0.16.7/zigcc-x86_64-pc-windows-gnu.sh
  ***********************************************************
  Possible missing dependencies.
  See https://github.com/sodiumoxide/sodiumoxide#cross-compiling
  ***********************************************************

  ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsodium-sys-0.2.7/build.rs:257:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
root@vultr:~/rustdesk#
messense commented 1 year ago

https://github.com/rust-cross/cargo-zigbuild/issues/89#issuecomment-1429015232