rust-cross / cargo-xwin

Cross compile Cargo project to Windows MSVC target with ease
Other
340 stars 30 forks source link

error: failed to run custom build command for `openssl-sys v0.9.87` #50

Closed f4nff closed 1 year ago

f4nff commented 1 year ago
sudo apt-get update 
sudo apt-get install  file gcc git libssl-dev nix-bin musl-tools pkg-config make build-essential gcc-multilib mingw-w64  gcc-mingw-w64 clang llvm -y 

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup default nightly
rustup target list
cargo update
root@vultr:~/rustdesk# rustup target add x86_64-pc-windows-msvc
info: downloading component 'rust-std' for 'x86_64-pc-windows-msvc'
info: installing component 'rust-std' for 'x86_64-pc-windows-msvc'
 25.9 MiB /  25.9 MiB (100 %)  15.3 MiB/s in  1s ETA:  0s
root@vultr:~/rustdesk# cargo xwin build --target x86_64-pc-windows-msvc -p hbbs -Z namespaced-features --bin my-id-server
  Manifest [1s] ================================================== 11.38 MiB/11.38 MiB πŸ“₯ downloaded  CRT.headers [0s] ================================================= 17.50 MiB/17.50 MiB πŸ“¦ splatted  CRT.libs.x86_64.desktop [0s] =================================== 183.89 MiB/183.89 MiB πŸ“¦ splatted  CRT.libs.x86_64.store [0s] ======================================= 65.38 MiB/65.38 MiB πŸ“¦ splatted  CRT.libs.aarch64.desktop [0s] ================================== 211.59 MiB/211.59 MiB πŸ“¦ splatted  CRT.libs.aarch64.store [0s] ==================================== 114.20 MiB/114.20 MiB πŸ“¦ splatted  SDK.headers.all.none [0s] ======================================== 89.79 MiB/89.79 MiB πŸ“¦ splatted  SDK.headers.all.store [0s] ===================================== 219.85 MiB/219.85 MiB πŸ“¦ splatted  SDK.headers.x86_64.none [0s] ===================================== 45.17 KiB/45.17 KiB πŸ“¦ splatted  SDK.headers.aarch64.none [0s] ================================== 103.02 KiB/103.02 KiB πŸ“¦ splatted  SDK.libs.x86_64 [0s] ============================================= 71.15 MiB/71.15 MiB πŸ“¦ splatted  SDK.libs.aarch64 [0s] ========================================== 131.90 MiB/131.90 MiB πŸ“¦ splatted  SDK.libs.store.all [0s] ======================================== 116.26 MiB/116.26 MiB πŸ“¦ splatted  SDK.ucrt.all [0s] ============================================== 241.38 MiB/241.38 MiB πŸ“¦ splatted  symlinks [1s] β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 4611/4611warning: 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/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/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/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/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/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/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/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/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/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/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/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-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.
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/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/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/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/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/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/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/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/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/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/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.
  Downloaded schannel v0.1.21
  Downloaded windows-targets v0.48.0
  Downloaded winreg v0.6.2
  Downloaded winapi-util v0.1.5
  Downloaded errno v0.3.1
  Downloaded ntapi v0.4.1
  Downloaded windows_x86_64_gnu v0.48.0
  Downloaded windows-targets v0.42.2
  Downloaded windows_x86_64_msvc v0.48.0
  Downloaded windows_x86_64_msvc v0.42.2
  Downloaded vcpkg v0.2.15
  Downloaded winapi v0.3.9
  Downloaded windows-sys v0.45.0
  Downloaded windows-sys v0.48.0
  Downloaded windows-sys v0.42.0
  Downloaded windows v0.48.0
  Downloaded 16 crates (23.8 MB) in 1.26s (largest was `windows` at 11.9 MB)
   Compiling libc v0.2.144
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.56
   Compiling quote v1.0.27
   Compiling version_check v0.9.4
   Compiling unicode-ident v1.0.8
   Compiling syn v2.0.15
   Compiling cfg-if v1.0.0
   Compiling jobserver v0.1.26
   Compiling cc v1.0.79
   Compiling winapi v0.3.9
   Compiling log v0.4.17
   Compiling serde_derive v1.0.162
   Compiling typenum v1.16.0
   Compiling generic-array v0.14.7
   Compiling serde v1.0.162
   Compiling pkg-config v0.3.27
   Compiling futures-core v0.3.28
   Compiling lock_api v0.4.9
   Compiling parking_lot_core v0.9.7
   Compiling getrandom v0.2.9
   Compiling slab v0.4.8
   Compiling thiserror v1.0.40
   Compiling tokio-macros v2.1.0
   Compiling futures-channel v0.3.28
   Compiling futures-task v0.3.28
   Compiling thiserror-impl v1.0.40
   Compiling windows_x86_64_msvc v0.42.2
   Compiling futures-util v0.3.28
   Compiling memchr v2.5.0
   Compiling rand_core v0.6.4
   Compiling windows_x86_64_msvc v0.48.0
   Compiling futures-macro v0.3.28
   Compiling pin-project-lite v0.2.9
   Compiling once_cell v1.17.1
   Compiling bytes v1.4.0
   Compiling scopeguard v1.1.0
   Compiling windows-targets v0.48.0
   Compiling ahash v0.7.6
   Compiling crossbeam-utils v0.8.15
   Compiling windows-sys v0.48.0
   Compiling crypto-common v0.1.6
   Compiling windows-targets v0.42.2
   Compiling windows-sys v0.45.0
   Compiling openssl-src v111.25.3+1.1.1t
   Compiling openssl-sys v0.9.87
   Compiling socket2 v0.4.9
   Compiling num_cpus v1.15.0
   Compiling smallvec v1.10.0
   Compiling itoa v1.0.6
   Compiling tokio v1.28.1
   Compiling parking_lot v0.12.1
   Compiling mio v0.8.6
   Compiling httparse v1.8.0
   Compiling futures-io v0.3.28
   Compiling io-lifetimes v1.0.10
   Compiling futures-sink v0.3.28
   Compiling bitflags v1.3.2
   Compiling memoffset v0.8.0
   Compiling subtle v2.4.1
   Compiling libz-sys v1.1.9
   Compiling crossbeam-epoch v0.9.14
   Compiling pin-utils v0.1.0
   Compiling either v1.8.1
   Compiling hashbrown v0.12.3
   Compiling cpufeatures v0.2.7
   Compiling block-buffer v0.10.4
   Compiling zstd-sys v1.6.2+zstd.1.5.1
   Compiling indexmap v1.9.3
   Compiling syn v1.0.109
   Compiling rustix v0.37.19
   Compiling fnv v1.0.7
   Compiling http v0.2.9
   Compiling digest v0.10.6
   Compiling proc-macro2-diagnostics v0.10.0
   Compiling signal-hook-registry v1.4.1
   Compiling anyhow v1.0.71
   Compiling linux-raw-sys v0.3.7
   Compiling protobuf v3.2.0
   Compiling tracing-core v0.1.30
   Compiling curl-sys v0.4.61+curl-8.0.1
   Compiling same-file v1.0.6
   Compiling percent-encoding v2.2.0
   Compiling rayon-core v1.11.0
   Compiling openssl v0.10.52
   Compiling yansi v0.5.1
   Compiling walkdir v2.3.3
   Compiling tracing v0.1.37
   Compiling pin-project-internal v1.0.12
   Compiling aho-corasick v1.0.1
   Compiling time-macros v0.2.4
   Compiling crossbeam-queue v0.3.8
   Compiling regex-syntax v0.7.1
   Compiling regex v1.8.1
   Compiling libsodium-sys v0.2.7
   Compiling protobuf-support v3.2.0
   Compiling inout v0.1.3
   Compiling ring v0.16.20
   Compiling openssl-macros v0.1.1
   Compiling num-traits v0.2.15
   Compiling native-tls v0.2.10 (/root/rustdesk/libs/native-tls-0.2.10)
   Compiling zstd-safe v4.1.3+zstd.1.5.1
   Compiling fastrand v1.9.0
   Compiling tempfile v3.5.0
   Compiling cipher v0.4.4
   Compiling which v4.4.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 backtrace v0.3.67
   Compiling tinyvec_macros v0.1.1
   Compiling ref-cast v1.0.16
   Compiling tower-service v0.3.2
   Compiling crc32fast v1.3.2
   Compiling spin v0.5.2
   Compiling base64 v0.13.1
   Compiling untrusted v0.7.1
   Compiling curl v0.4.44
   Compiling tinyvec v1.6.0
   Compiling protobuf-codegen v3.2.0
   Compiling rand v0.8.5
   Compiling crossbeam-channel v0.5.8
   Compiling futures-executor v0.3.28
   Compiling pear_codegen v0.2.4
   Compiling form_urlencoded v1.1.0
   Compiling http-body v0.4.5
error: failed to run custom build command for `openssl-sys v0.9.87`

Caused by:
  process didn't exit successfully: `/root/rustdesk/target/debug/build/openssl-sys-9a17d1c01cde9991/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
  X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  running cd "/root/rustdesk/target/x86_64-pc-windows-msvc/debug/build/openssl-sys-32fc48f47499fd5a/out/openssl-build/build/src" && "perl" "./Configure" "--prefix=/root/rustdesk/target/x86_64-pc-windows-msvc/debug/build/openssl-sys-32fc48f47499fd5a/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"
  Configuring OpenSSL version 1.1.1t (0x1010114fL) for VC-WIN64A
  Using os-specific seed configuration

  --- stderr

  ******************************************************************************
  This perl implementation doesn't produce Windows like paths (with backward
  slash directory separators).  Please use an implementation that matches your
  building platform.

  This Perl version: 5.32.1 for x86_64-linux-gnu-thread-multi
  ******************************************************************************
  thread 'main' panicked at '

  Error configuring OpenSSL build:
      Command: cd "/root/rustdesk/target/x86_64-pc-windows-msvc/debug/build/openssl-sys-32fc48f47499fd5a/out/openssl-build/build/src" && "perl" "./Configure" "--prefix=/root/rustdesk/target/x86_64-pc-windows-msvc/debug/build/openssl-sys-32fc48f47499fd5a/out/openssl-build/install" "--openssldir=SYS$MANAGER:[OPENSSL]" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-asm" "VC-WIN64A"
      Exit status: exit status: 127

      ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-111.25.3+1.1.1t/src/lib.rs:506:13
  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

It is complaining about Perl which has nothing to do with cargo-xwin.

f4nff commented 1 year ago

cargo build --release --target x86_64-unknown-linux-musl -p hbbs -Z namespaced-features --bin my-id-server

I can compile successfully like this, Can you tell me how to fix it?

messense commented 1 year ago

Sorry I only have limited time and energy. Technical advice and support is only available for my GitHub Sponsors.