Coder Social home page Coder Social logo

rust-cross / cargo-xwin Goto Github PK

View Code? Open in Web Editor NEW
304.0 4.0 24.0 615 KB

Cross compile Cargo project to Windows MSVC target with ease

License: Other

Rust 93.06% CMake 2.81% Dockerfile 4.13%
cargo-subcommand msvc xwinbuild clang-cl lld lld-link xwin cargo-xwin

cargo-xwin's Introduction

cargo-xwin

formerly cargo-xwinbuild

CI Crates.io docs.rs PyPI Docker Image

🚀 Help me to become a full-time open-source developer by sponsoring me on GitHub

Cross compile Cargo project to Windows msvc target with ease.

By using this software you are consented to accept the license at https://go.microsoft.com/fwlink/?LinkId=2086102

Prerequisite

  1. For pure Rust project, no prerequisites needed.
  2. For C/C++ dependencies, install clang (On macOS run brew install llvm and you're good to go).
  3. For assembly dependencies, install llvm-tools-preview component via rustup component add llvm-tools-preview or install llvm.

Installation

cargo install cargo-xwin

You can also install it using pip:

pip install cargo-xwin

We also provide a Docker image which has wine pre-installed in addition to cargo-xwin and Rust, for example to build for x86_64 Windows:

docker run --rm -it -v $(pwd):/io -w /io messense/cargo-xwin \
  cargo xwin build --release --target x86_64-pc-windows-msvc

Usage

  1. Install Rust Windows msvc target via rustup, for example, rustup target add x86_64-pc-windows-msvc
  2. Run cargo xwin build, for example, cargo xwin build --target x86_64-pc-windows-msvc

Run tests with wine

With wine installed, you can run tests with the cargo xwin test command, for example, cargo xwin test --target x86_64-pc-windows-msvc

Customization

The Microsoft CRT and Windows SDK can be customized using the following environment variables or CLI options.

Environment Variable CLI option Description
XWIN_ARCH --xwin-arch The architectures to include, defaults to x86_64,aarch64, possible values: x86, x86_64, aarch, aarch64
XWIN_VARIANT --xwin-variant The variants to include, defaults to desktop, possible values: desktop, onecore, spectre
XWIN_VERSION --xwin-version The version to retrieve, defaults to 16, can either be a major version of 15 or 16, or a <major>.<minor> version
XWIN_CACHE_DIR --xwin-cache-dir xwin cache directory to put CRT and SDK files
XWIN_INCLUDE_DEBUG_LIBS --xwin-include-debug-libs Whether or not to include debug libs in installation (default false).

CMake Support

Some Rust crates use the cmake crate to build C/C++ dependencies, cargo-xwin will generate a CMake toolchain file automatically to make cross compilation work out of the box.

ninja is required to enable CMake support.

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.

cargo-xwin's People

Contributors

brooooooklyn avatar c-nixon avatar dependabot[bot] avatar jaysonsantos avatar justtryingthingsout avatar kcking avatar messense avatar msdrigg avatar nyanshell avatar owen-ch-leung avatar shivaraj-bh avatar sporif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cargo-xwin's Issues

cargo-xwin ignores rustflags from cargo config file

I have the following in the <project>/.cargo/config.toml file:
[target.x86_64-pc-windows-msvc]
rustflags = "-C target-feature=+crt-static"

This seems to be ignored by cargo xwin build command. When setting it through env variable it works fine:
RUSTFLAGS="-C target-feature=+crt-static" cargo xwin build --target=x86_64-pc-windows-msvc

But that's not ideal.

Test and Run support

Would it be possible to add support for cargo test and cargo run? I'm trying to test blake3 using CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER=wine but building the tests with xwinbuild and then trying cargo test --target x86_64-pc-windows-msvc does a rebuild that fails with error: linker link.exe not found.

Build fails due to bindgen being unable to find Windows include directories

  --- stderr
  cargo:rustc-link-lib=static=lzvn
  cargo:rustc-link-search=native=/io/target/x86_64-pc-windows-msvc/release/build/sepsplit-rs-hash/out
  cargo:rerun-if-changed=wrapper.h

  --- stderr
  ./src/ext/lzvn/FastCompression.h:8:10: fatal error: 'stdlib.h' file not found
  thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("./src/ext/lzvn/FastCompression.h:8:10: fatal error: 'stdlib.h' file not found\n")', build.rs:34:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This issue seems to be caused by bindgen being unable to find the Windows include directories, as it seems to not be passed the proper arguments for directories as compared to the cc crate's builder. A temporary fix for this would be to include the proper directory from the cache of cargo-xwin using .clang_args(), but that would not work cross-platform as each platform has a different location for the cache.

error: failed to run custom build command for `ring v0.16.20`

root@vultr:/home/rustdesk2023# cargo xwin build --target x86_64-pc-windows-msvc -p hbbs -Z namespaced-features --bin my-relay-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:   /home/rustdesk2023/libs/hyper-0.14.20/Cargo.toml
workspace: /home/rustdesk2023/Cargo.toml
warning: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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: /home/rustdesk2023/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.
   Compiling libc v0.2.141
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.56
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling version_check v0.9.4
   Compiling syn v2.0.13
   Compiling cfg-if v1.0.0
   Compiling jobserver v0.1.26
   Compiling cc v1.0.79
   Compiling log v0.4.17
   Compiling winapi v0.3.9
   Compiling serde_derive v1.0.159
   Compiling typenum v1.16.0
   Compiling generic-array v0.14.7
   Compiling serde v1.0.159
   Compiling futures-core v0.3.28
   Compiling pkg-config v0.3.26
   Compiling lock_api v0.4.9
   Compiling parking_lot_core v0.9.7
   Compiling getrandom v0.2.8
   Compiling slab v0.4.8
   Compiling windows_x86_64_msvc v0.42.2
   Compiling thiserror v1.0.40
   Compiling tokio-macros v2.0.0
   Compiling futures-channel v0.3.28
   Compiling futures-task v0.3.28
   Compiling thiserror-impl v1.0.40
   Compiling futures-util v0.3.28
   Compiling memchr v2.5.0
   Compiling rand_core v0.6.4
   Compiling futures-macro v0.3.28
   Compiling pin-project-lite v0.2.9
   Compiling once_cell v1.17.1
   Compiling windows-targets v0.42.2
   Compiling bytes v1.4.0
   Compiling scopeguard v1.1.0
   Compiling windows-sys v0.45.0
   Compiling ahash v0.7.6
   Compiling crossbeam-utils v0.8.15
   Compiling crypto-common v0.1.6
   Compiling openssl-src v111.25.2+1.1.1t
   Compiling openssl-sys v0.9.84
   Compiling socket2 v0.4.9
   Compiling num_cpus v1.15.0
   Compiling itoa v1.0.6
   Compiling smallvec v1.10.0
   Compiling tokio v1.27.0
   Compiling parking_lot v0.12.1
   Compiling mio v0.8.6
   Compiling io-lifetimes v1.0.10
   Compiling futures-sink v0.3.28
   Compiling bitflags v1.3.2
   Compiling futures-io v0.3.28
   Compiling httparse v1.8.0
   Compiling memoffset v0.8.0
   Compiling subtle v2.4.1
   Compiling libz-sys v1.1.8
   Compiling crossbeam-epoch v0.9.14
   Compiling either v1.8.1
   Compiling pin-utils v0.1.0
   Compiling hashbrown v0.12.3
   Compiling cpufeatures v0.2.6
   Compiling block-buffer v0.10.4
   Compiling zstd-sys v1.6.2+zstd.1.5.1
   Compiling indexmap v1.9.3
   Compiling fnv v1.0.7
   Compiling rustix v0.37.7
   Compiling syn v1.0.109
   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.70
   Compiling protobuf v3.2.0
   Compiling linux-raw-sys v0.3.1
   Compiling tracing-core v0.1.30
   Compiling curl-sys v0.4.61+curl-8.0.1
   Compiling openssl v0.10.49
   Compiling rayon-core v1.11.0
   Compiling same-file v1.0.6
   Compiling percent-encoding v2.2.0
   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 v0.7.20
   Compiling time-macros v0.2.4
   Compiling crossbeam-queue v0.3.8
   Compiling regex-syntax v0.6.29
   Compiling regex v1.7.3
   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 fastrand v1.9.0
   Compiling zstd-safe v4.1.3+zstd.1.5.1
   Compiling native-tls v0.2.10 (/home/rustdesk2023/libs/native-tls-0.2.10)
   Compiling tempfile v3.5.0
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/home/rustdesk2023/target/debug/build/ring-ed7a4a5e2e940340/build-script-build` (exit status: 101)
  --- stdout
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = Some("--target=x86_64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/root/.cache/cargo-xwin/xwin/crt/include /imsvc/root/.cache/cargo-xwin/xwin/sdk/include/ucrt /imsvc/root/.cache/cargo-xwin/xwin/sdk/include/um /imsvc/root/.cache/cargo-xwin/xwin/sdk/include/shared  ")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("crt-static,fxsr,sse,sse2")
  DEBUG = Some("true")

  --- stderr
  running "clang-cl" "-nologo" "-MT" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/root/.cache/cargo-xwin/xwin/crt/include" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/um" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/shared" "-I" "include" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Od" "/RTCsu" "-DNDEBUG" "-c" "/Fo/home/rustdesk2023/target/x86_64-pc-windows-msvc/debug/build/ring-53ea7d966016045d/out/aes_nohw.obj" "crypto/fipsmodule/aes/aes_nohw.c"
  thread 'main' panicked at 'failed to execute ["clang-cl" "-nologo" "-MT" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/root/.cache/cargo-xwin/xwin/crt/include" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/um" "/imsvc/root/.cache/cargo-xwin/xwin/sdk/include/shared" "-I" "include" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Od" "/RTCsu" "-DNDEBUG" "-c" "/Fo/home/rustdesk2023/target/x86_64-pc-windows-msvc/debug/build/ring-53ea7d966016045d/out/aes_nohw.obj" "crypto/fipsmodule/aes/aes_nohw.c"]: No such file or directory (os error 2)', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.16.20/build.rs:653:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
root@vultr:/home/rustdesk2023#

SKD/CRT get downloaded every `xwin-arch` change

Definitely a weird one. I'm cross-compiling a project multiple times, and every time i switch xwin-arch from 64 to 86 and back, they get re-downloaded. as if one overwrites the other, and they are not cached.

Fail to link C++ std

I tried to build project with https://github.com/rust-skia/rust-skia but it makes error when I tried to build with xwin,

error: linking with `lld-link` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/namse/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/namse/.local/bin:/usr/bin:/home/namse/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:/home/namse/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/android-sdk/tools/bin:/usr/lib/android-sdk/platform-tools:/usr/lib/android-sdk/cmdline-tools/latest/bin:/home/namse/.cache/cargo-xwin" VSLANG="1033" "lld-link" "-flavor" "link" "/NOLOGO" "/tmp/rustcmpCc3q/symbols.o" "/home/namse/namseent/namui/sample/rect/target/namui/target/x86_64-pc-windows-msvc/debug/deps/namui_runtime_x86_64_pc_windows_msvc.rect-0b8dba757410072d.11gq2n56xg0uouz2.rcgu.o.rcgu.o" "/LIBPATH:/home/namse/namseent/namui/sample/rect/target/namui/target/x86_64-pc-windows-msvc/debug/deps" "/LIBPATH:/home/namse/namseent/namui/sample/rect/target/namui/target/debug/deps" "/LIBPATH:/home/namse/.cache/cargo-xwin/xwin/crt/lib/x86_64" "/LIBPATH:/home/namse/.cache/cargo-xwin/xwin/sdk/lib/um/x86_64" "/LIBPATH:/home/namse/.cache/cargo-xwin/xwin/sdk/lib/ucrt/x86_64" "/LIBPATH:/home/namse/namseent/namui/sample/rect/target/namui/target/x86_64-pc-windows-msvc/debug/build/skia-bindings-f2ce96920157071e/out/skia" "/LIBPATH:/home/namse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/windows_x86_64_msvc-0.52.0/lib" "/LIBPATH:/home/namse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/windows_x86_64_msvc-0.48.5/lib" "/LIBPATH:/home/namse/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib" "/home/namse/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libcompiler_builtins-3447ff57d35e742b.rlib" "advapi32.lib" "cfgmgr32.lib" "fwpuclnt.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "ntdll.lib" "opengl32.lib" "shell32.lib" "shlwapi.lib" "user32.lib" "winspool.lib" "ws2_32.lib" "windows.0.52.0.lib" "windows.0.52.0.lib" "skia.lib" "skia-bindings.lib" "usp10.lib" "ole32.lib" "user32.lib" "gdi32.lib" "fontsub.lib" "d3d12.lib" "dxgi.lib" "d3dcompiler.lib" "bcrypt.lib" "advapi32.lib" "ntdll.lib" "windows.0.48.5.lib" "kernel32.lib" "advapi32.lib" "bcrypt.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "ws2_32.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:/home/namse/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib" "/OUT:/home/namse/namseent/namui/sample/rect/target/namui/target/x86_64-pc-windows-msvc/debug/deps/namui_runtime_x86_64_pc_windows_msvc.exe" "/OPT:REF,ICF" "/DEBUG"
  = note: lld-link: error: undefined symbol: __std_max_element_2
          >>> referenced by skia.lib(skia.SkSLRasterPipelineBuilder.obj):(public: void __cdecl SkSL::RP::Program::Dumper::dump(class SkWStream *, bool))
          >>> referenced by skia.lib(skia.SkSLRasterPipelineBuilder.obj):(public: class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> __cdecl SkSL::RP::Program::Dumper::swizzlePtr<unsigned short const>(void const *, class SkSpan<unsigned short const>) const)
          
          lld-link: error: undefined symbol: __std_max_element_1
          >>> referenced by skia.lib(skia.SkSLRasterPipelineBuilder.obj):(public: class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>> __cdecl SkSL::RP::Program::Dumper::swizzlePtr<unsigned char>(void const *, class SkSpan<unsigned char>) const)
          
          lld-link: error: undefined symbol: __std_find_trivial_8
          >>> referenced by skia.lib(skia.SkNWayCanvas.obj):(public: virtual void __cdecl SkNWayCanvas::removeCanvas(class SkCanvas *))
          >>> referenced by skia.lib(skia.SkSLFindAndDeclareBuiltinFunctions.obj):(void __cdecl SkSL::Transform::FindAndDeclareBuiltinFunctions(struct SkSL::Program &))
          >>> referenced by skia.lib(skia.SkSLFindAndDeclareBuiltinVariables.obj):(public: void __cdecl SkSL::Transform::`anonymous namespace'::BuiltinVariableScanner::addDeclaringElement(class Transform::Symbol const *))
          
          lld-link: error: undefined symbol: __std_find_trivial_4
          >>> referenced by skia.lib(spirv_cross.spirv_cfg.obj):(private: void __cdecl spirv_cross::CFG::add_branch(unsigned int, unsigned int))
          >>> referenced by skia.lib(spirv_cross.spirv_cfg.obj):(private: void __cdecl spirv_cross::CFG::add_branch(unsigned int, unsigned int))
          

error: could not compile `namui-runtime-x86_64-pc-windows-msvc` (bin "namui-runtime-x86_64-pc-windows-msvc") due to previous error

I'm using ubuntu and clang is already installed. Somebody said it would be fixed by linking stdc++ but I have no idea.

Certain directories aren't included that need to be to compile some packages.

I had to add these cxx and c flags in order to get cmake to compile my library, is this something that should be added directly to xwin or is there some reason why /include and /include/winrt and /include/winrt/wrl aren't a part of it?

cmake_config.cxxflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/cppwinrt");
cmake_config.cflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/cppwinrt");
cmake_config.cxxflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/winrt");
cmake_config.cflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/winrt");
cmake_config.cxxflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include");
cmake_config.cflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include");
cmake_config.cxxflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/winrt/wrl");
cmake_config.cflag("/imsvc/home/malek/.cache/cargo-xwin/xwin/sdk/include/winrt/wrl");

Thoughts? Recommendations? There is probably a better way to do this that I don't know about and I would prefer to do it that way.

Command failed: Command failed: cargo-xwin build --release --target x86_64-pc-windows-msvc --features napi-rs

when run Command : cargo-xwin build --release --target x86_64-pc-windows-msvc --features napi-rs,

error: https://download.visualstudio.microsoft.com/download/pr/073b1532-3df8-4e05-b9a8-79f449244243/199fb5a69ee7f9609044239061d0960e/windows%20sdk%20desktop%20headers%20x64-x86_en-us.msi: status code 400
You are cross compiling x86_64-pc-windows-msvc target on linux host
Internal Error: Command failed: cargo-xwin build --release --target x86_64-pc-windows-msvc --features napi-rs
at checkExecSyncError (child_process.js:611:11)
at Object.execSync (child_process.js:647:15)
at BuildCommand. (/ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:11515:30)
at Generator.next ()
at /ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:3552:69
at new Promise ()
at __awaiter$1 (/ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:3548:10)
at BuildCommand.execute (/ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:11292:16)
at BuildCommand.validateAndExecute (/ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:2113:37)
at /ws/41063/LinkMicSDK_Rust/link_mic_sdk_nodejs/node_modules/@napi-rs/cli/scripts/index.js:3154:53
error Command failed with exit code 1.

it seem to network error?
how do i solve it?

Adding icon to exe, rc.exe missing?

Hi,

Thanks for the great project. I would like to add an icon to the executable with the winresource (https://github.com/BenjaminRi/winresource) crate (fork of https://docs.rs/winres/latest/winres/)

I have the following build.rs

use {
    std::{
        env,
        io,
    },
    winresource::WindowsResource,
};

fn main() -> io::Result<()> {
    if env::var_os("CARGO_CFG_WINDOWS").is_some() {
        WindowsResource::new()
            .set_icon("assets/icon.ico")
            .compile().unwrap();
    }
    Ok(())
}

it works, if I cross compile from linux directly to windows-gnu with cargo build --target x86_64-pc-windows-gnu --profile=release, but when compiling with cargo-xwin (docker) it complains, that it cannot find rc.exe. I am not sure if one would use the rc.exe with wine or the windres binary from mingw in the container, but I could not find any in the container's filesystem.

Does anyone have experience with adding icons to the exe file with cargo xwin?

Build fails on macOS due to clang-cl mistaking directory for flag

  running: "clang-cl" "-nologo" "-MD" "-O2" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/plx/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/plx/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/plx/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/plx/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-Fo/Users/plx/Documents/Github/sepsplit-rs/target/x86_64-pc-windows-msvc/release/build/sepsplit-rs-hash/out/lzvn_decode.o" "-c" "/Users/plx/Documents/Github/sepsplit-rs/src/ext/lzvn/lzvn_decode.c"
  cargo:warning=clang-15: warning: '/Users/plx/Documents/Github/sepsplit-rs/src/ext/lzvn/lzvn_decode.c' treated as the '/U' option [-Wslash-u-filename]
  cargo:warning=clang-15: note: use '--' to treat subsequent arguments as filenames
  cargo:warning=clang-15: error: no input files
  exit status: 1

This error seems to occur as macOS puts the user directory inside of /Users and clang-cl, due to CL.EXE compatibility, thinks the flag /U is being specified. I am unable to specify -- in clang-cl to solve this problem as adding it to cc::Build as a flag causes it to regard flags that come after it as filenames.

Let `XWIN_CACHE_DIR` override cmake cache

The <cache-path> in <cache-path>/cargo-xwin/xwin is overridden by XWIN_CACHE_DIR env as defined here:

cargo-xwin/src/common.rs

Lines 78 to 85 in 28cd46e

let xwin_cache_dir = self.xwin_cache_dir.clone().unwrap_or_else(|| {
dirs::cache_dir()
// If the really is no cache dir, cwd will also do
.unwrap_or_else(|| env::current_dir().expect("Failed to get current dir"))
.join(env!("CARGO_PKG_NAME"))
.join("xwin")
});
fs::create_dir_all(&xwin_cache_dir)?;

But the cmake cache (cache-path>/cargo-xwin/cmake) always sets its <cache-path> to the default given by dirs crate, as can be seen here:

cargo-xwin/src/common.rs

Lines 398 to 403 in 28cd46e

fn setup_cmake_toolchain(&self, target: &str, xwin_cache_dir: &Path) -> Result<PathBuf> {
let cache_dir = dirs::cache_dir()
.unwrap_or_else(|| env::current_dir().expect("Failed to get current dir"))
.join(env!("CARGO_PKG_NAME"));
let cmake = cache_dir.join("cmake");
fs::create_dir_all(&cmake)?;

Will a PR here to let XWIN_CACHE_DIR override the <cache-path> for cmake be appreciated?

Context:

I was trying to use cargo-xwin here, and nix doesn't allow the builder write to paths outside build directory -- that's when I observed this bug.

trouble to run test, `bcryptprimitives.dll`

When I run test cargo xwin test --target x86_64-pc-windows-msvc --xwin-arch x86_64 --xwin-version, it make a error like below,

    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.04s
     Running unittests src/lib.rs (target/x86_64-pc-windows-msvc/debug/deps/namui_type-cd05c476bca47a34.exe)
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `wine /home/ubuntu/namseent/namui/namui-type/target/x86_64-pc-windows-msvc/debug/deps/namui_type-cd05c476bca47a34.exe` (exit status: 53)
note: test exited abnormally; to see the full output pass --nocapture to the harness.

So I directly run wine /home/ubuntu/namseent/namui/namui-type/target/x86_64-pc-windows-msvc/debug/deps/namui_type-cd05c476bca47a34.exe, It shows,

0050:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
00d4:err:module:import_dll Library bcryptprimitives.dll (which is needed by L"Z:\\home\\ubuntu\\namseent\\namui\\namui-type\\target\\x86_64-pc-windows-msvc\\debug\\deps\\namui_type-cd05c476bca47a34.exe") not found
00d4:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\ubuntu\\namseent\\namui\\namui-type\\target\\x86_64-pc-windows-msvc\\debug\\deps\\namui_type-cd05c476bca47a34.exe" failed, status c0000135

It's suddenly happened.

clang-cl missing on macOS (Install Apple Command Line Developer tools)

This is simply a solution on how to fix an error I encountered during a build using a crate that has C/C++ dependencies on macOS.

The Problem

When building a crate with C/C++ dependencies on macOS, you get a system prompt asking you to install the command line tools again, even if you already have them installed. (Installing them again also does not fix the issue.)

@messense Perhaps there could be a more descriptive error message for macOS specifically, although the issue is easy enough to fix on the user's end (see below). Also, thank you for this amazing project (& zigbuild)!

The Fix

From the README:

  1. For C/C++ dependencies, install clang.

Run brew install llvm (you don't need to adjust your path at all, just the brew install is fine), because Apple's llvm/clang does not have clang-cl. Brew's llvm has clang-cl bundled with it and that solves the issue.

Use `cargo` build target

Instead of adding --target to each command it would save time if xwin build and test read cargo configs.

Given this .cargo/config:

[build]
target = "x86_64-pc-windows-msvc"

I expect that cargo xwin build gives the same result as cargo xwin build --target x86_64-pc-windows-msvc. However, the former fails on mac os:

error: linker `link.exe` not found
  |
  = note: No such file or directory (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option

there is still a build error

Command: cargo xwin build --target x86_64-pc-windows-msvc.

The error is following:

... 

error: failed to run custom build command for `rust-crypto v0.2.36`

Caused by:
  process didn't exit successfully: `/Users/lei/Desktop/Rust/learn_rust/target/debug/build/rust-crypto-a19246e40d1c0ac5/build-script-build` (exit status: 101)
  --- stdout
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  TARGET = Some("x86_64-pc-windows-msvc")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  CC_x86_64-pc-windows-msvc = None
  CC_x86_64_pc_windows_msvc = Some("clang-cl --target=x86_64-pc-windows-msvc")
  TARGET = Some("x86_64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  CFLAGS_x86_64-pc-windows-msvc = None
  CFLAGS_x86_64_pc_windows_msvc = Some("-Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/shared")
  DEBUG = Some("true")
  running: "clang-cl --target=x86_64-pc-windows-msvc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/lei/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-g" "--target=x86_64-pc-windows-msvc" "-Wall" "-Wextra" "/Fo/Users/lei/Desktop/Rust/learn_rust/target/x86_64-pc-windows-msvc/debug/build/rust-crypto-21fe17a56301ca99/out/src/util_helpers.o" "/c" "src/util_helpers.c"

--- stderr
  thread 'main' panicked at '

  Internal error occurred: Failed to find tool. Is `clang-cl --target=x86_64-pc-windows-msvc` installed?

Maybe my Cargo.toml configuration caused the problem, how to fix it? tks.

Cargo.toml

[target.x86_64-pc-windows-msvc]
linker = "/opt/homebrew/opt/llvm/bin/lld"

this linker is a valid path.

Fail to build sqlite/rusqlite

Trying to build https://github.com/rusqlite/rusqlite:

cargo 1.58.0 (f01b232bc 2022-01-19)

main.rs

use rusqlite::{params, Connection, Result};

#[derive(Debug)]
struct Person {
    id: i32,
    name: String,
    data: Option<Vec<u8>>,
}

fn main() -> Result<()> {
    let conn = Connection::open_in_memory()?;

    conn.execute(
        "CREATE TABLE person (
                  id              INTEGER PRIMARY KEY,
                  name            TEXT NOT NULL,
                  data            BLOB
                  )",
        [],
    )?;
    let me = Person {
        id: 0,
        name: "Steven".to_string(),
        data: None,
    };
    conn.execute(
        "INSERT INTO person (name, data) VALUES (?1, ?2)",
        params![me.name, me.data],
    )?;

    let mut stmt = conn.prepare("SELECT id, name, data FROM person")?;
    let person_iter = stmt.query_map([], |row| {
        Ok(Person {
            id: row.get(0)?,
            name: row.get(1)?,
            data: row.get(2)?,
        })
    })?;

    for person in person_iter {
        println!("Found person {:?}", person.unwrap());
    }
    Ok(())
}

cargo.toml

[package]
name = "corelib"
version = "0.3.0"
edition = "2018"

[dependencies]
rusqlite = { version = "0.25.3", features = ["bundled", "backup", "column_decltype", "functions", "chrono"] }

it fails on OSX/M1 with:

error: linking with `lld-link` failed: exit status: 1
  |
  = note: "lld-link" "/NOLOGO" "/Users/mamcx/Proyectos/RustStore/target/x86_64-pc-windows-msvc/debug/deps/sync.12by7064d768pkl7.rcgu.o" "/Users/mamcx/Proyectos/RustStore/target/x86_64-pc-windows-msvc/debug/deps/sync.16yejtl1x75cipb5.rcgu.o" "/Users/mamcx/Proyectos/RustStore/target/x86_64-pc-windows-msvc/debug/deps/sync.170wpi8pokg8zudu.rcgu.o" "/Users/mamcx/Proyecto


..a lot more

corelib.exe" "/OPT:REF,NOICF" "/DEBUG"
  = note: lld-link: error: undefined symbol: localtime_r
          >>> referenced by /Users/mamcx/.cargo/registry/src/github.com-1ecc6299db9ec823/libsqlite3-sys-0.22.2/sqlite3/sqlite3.c:22525
          >>>               liblibsqlite3_sys-7bb4f894f9f2b876.rlib(sqlite3.o):(osLocaltime)

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

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#

Unable to build for the x86_64-pc-windows-msvc target on M2 mac.

I tried running cargo build with the following commands:

cargo xwin build --target x86_64-pc-windows-msvc
RUSTFLAGS='-C target-feature=+crt-static' cargo xwin build --target x86_64-pc-windows-msvc (To try statically link the c runtime)

Error produced:

warning: memset((void*)u, 0, sizeof(struct ud));
warning: ^
warning: libudis86/udis86.c(47,3): note: include the header <string.h> or explicitly provide a declaration for 'memset'
warning: 1 error generated.

error: failed to run custom build command for libudis86-sys v0.2.1

Caused by:
process didn't exit successfully: /Users/someone/dev/osrs-rust/target/debug/build/libudis86-sys-2670e41d3afb8a2e/build-script-build (exit status: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("aarch64-apple-darwin")
cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
CC_x86_64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
CC_x86_64_pc_windows_msvc = Some("clang-cl")
cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
CFLAGS_x86_64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
CFLAGS_x86_64_pc_windows_msvc = Some("--target=x86_64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared ")
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = Some("true")
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/decode.o" "-c" "--" "libudis86/decode.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
exit status: 0
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/itab.o" "-c" "--" "libudis86/itab.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
exit status: 0
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/syn-att.o" "-c" "--" "libudis86/syn-att.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
exit status: 0
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/syn-intel.o" "-c" "--" "libudis86/syn-intel.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
exit status: 0
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/syn.o" "-c" "--" "libudis86/syn.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
exit status: 0
running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/udis86.o" "-c" "--" "libudis86/udis86.c"
cargo:warning=clang-16: warning: unknown argument ignored in clang-cl: '-includestring.h' [-Wunknown-argument]
cargo:warning=libudis86/udis86.c(47,3): error: call to undeclared library function 'memset' with type 'void *(void , int, unsigned long long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
cargo:warning= memset((void
)u, 0, sizeof(struct ud));
cargo:warning= ^
cargo:warning=libudis86/udis86.c(47,3): note: include the header <string.h> or explicitly provide a declaration for 'memset'
cargo:warning=1 error generated.
exit status: 1

--- stderr

error occurred: Command "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/someone/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/rase/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-includestring.h" "-Fo/Users/rase/dev/osrs-rust/target/x86_64-pc-windows-msvc/debug/build/libudis86-sys-3f31a6f01443dcdf/out/libudis86/udis86.o" "-c" "--" "libudis86/udis86.c" with args "clang-cl" did not execute successfully (status code exit status: 1).

Initial build fails if /tmp and /home/USER are not the same partition

E.g. because /tmp is a tmpfs (i.e. mounted in the RAM, not on a disk).

Error: failed to splat Microsoft.VC.14.29.16.10.CRT.Headers.base.vsix

Caused by:
0: failed to move /tmp/.tmpEiI3xs/unpack/Microsoft.VC.14.29.16.10.CRT.Headers.base.vsix/include/pplcancellation_token.h to /home/YOUR_NAME/.cache/cargo-xwinbuild/xwin/crt/include/pplcancellation_token.h
1: Invalid cross-device link (os error 18)

This problem can be circumvented by

  1. creating a folder /tmp/cargo-xwinbuild, then soft linking /home/YOUR_NAME/.cache/cargo-xwinbuild to it,
  2. building your program,
  3. removing the soft link and moving the directory.

Afterwards everything will work fine for later executions of cargo xwinbuild.

Thank you for this fine tool! I'm astonished how fast the compilation is! (And that it actually works :) )

How to build using nightly Rust?

While building with stable toolchain works, I can't seem to get it working with nightly.

When running cargo +nightly xwin build --target i686-pc-windows-msvc, the build fails at linking the executable:

error: linking with `lld-link` failed: exit status: 127
  |
  = note: "lld-link" "-flavor" "link" "/DEF:/tmp/rustcfIuPMF/lib.def" "/NOLOGO" "/LARGEADDRESSAWARE" "/SAFESEH" ...
  = note: lld-link: error while loading shared libraries: libLLVM-14-rust-1.60.0-stable.so: cannot open shared object file: No such file or directory```

cargo-xwin panics when building inside a dockerfile

Hey there, while building an image to build windows binaries I've faced a panic when xwin tries to splat files.

With this Dockerfile you can reproduce the error:

FROM rust:1.65

ENV XWIN_VERSION 'v0.14.3'
ENV XWIN_URL "https://github.com/rust-cross/cargo-xwin/releases/download/${XWIN_VERSION}/cargo-xwin-${XWIN_VERSION}.x86_64-unknown-linux-musl.tar.gz"
ENV XWIN_VERSION 17
ENV XWIN_ARCH x86_64

RUN apt update && apt install -y curl clang pkg-config && rm -rf /var/lib/apt/lists/*
RUN curl -sL "${XWIN_URL}" | tar xz -C /usr/local/bin && chmod 755 /usr/local/bin/cargo-xwin


RUN rustup target add x86_64-pc-windows-msvc \
    && rustup component add clippy llvm-tools-preview \
    && rustup toolchain install nightly -c rustfmt --profile minimal

RUN cd $(mktemp -d) && cargo new download && cd download && cargo xwin build --target x86_64-pc-windows-msvc --release && cd .. && rm $PWD

When cargo xwin starts, after a while it will crash with the following message:

#0 0.902      Created binary (application) `download` package
#0 126.8 thread 'main' panicked at 'already have /root/.cache/cargo-xwin/xwin/sdk/include/um/appnotify.h matching /root/.cache/cargo-xwin/xwin/sdk/include/um/appnotify.h', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/xwin-0.2.12/src/splat.rs:641:17

Error: no cab files were referenced by the MSI

Since yesterday cargo-xwin fails with the error message:

Error: no cab files were referenced by the MSI

Steps to reproduce:

# optional
# rustup update
# cargo install cargo-xwin
cargo new test-xwin
cd test-xwin
# in case it's already cached
# export XWIN_CACHE_DIR=/tmp/xwin
cargo xwin build --release --target x86_64-pc-windows-msvc

I'm working on this issue, just wanted to open a ticket in case somebody else is experiencing the same thing.

The files can be download via xwin but I'm not sure how to use them in xwin-cargo. I can see xwin has had a release recently so I'm investigating in that direction.

How Do I Fix Compiling Errors With Some Crates?

For Example:
error: failed to run custom build command for rust-crypto v0.2.36
Internal error occurred: Failed to find tool. Is clang-cl --target=x86_64-pc-windows-msvc installed?
This is my rustup install:

RUN rustup default nightly && \
    rustup target add x86_64-pc-windows-msvc && \
    rustup component add llvm-tools-preview && \
    rustup toolchain install nightly && \
    rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && \
    rustup target add x86_64-unknown-linux-musl

Is there something i need to install / edit in the docker file, i am using a fork of this docker file, so this shouldn't be an issues installing stuff.
i have tried:
RUN apt-get install musl-tools -y
RUN apt-get install -y clang-tools
but still no luck.

Build Scripts ignore target cfg

Hi there! Want to just preface this by saying thank you for making this tool, it's been a great help!

It seems that build scripts will ignore target os, when building for windows, on linux

fn main() {
    #[cfg(target_os = "windows")]
    {
        println!("cargo:warning=Linking Exports File..");
        use std::path::Path;
        let lib_path = Path::new("deps").join("Exports.def");
        let absolute_path = std::fs::canonicalize(&lib_path).unwrap();
        println!(
            "cargo:rustc-cdylib-link-arg=/DEF:{}",
            absolute_path.display()
        );
    }
}

building this with cargo xwin build --target x86_64-pc-windows-msvc on linux, will result in no output, and no linking of the definition file. if i remove the target_os attribute, linking succeeds. Obviously this is not good if we're not compiling for windows, as it would require a manual change to the build.rs each time.

Unable to build for aarch64-pc-windows-msvc target with ring 0.17.5 dependency

As far as I understand ring 0.17 supports aarch64-cp-windows-msvc target, however when trying to build it with xwin I get the following error:

error: failed to run custom build command for `ring v0.17.5`

Caused by:
  process didn't exit successfully: `/tmp/test-ring/target/debug/build/ring-2031b15c66896d66/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_5_
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("crt-static,neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/home/user/.cache/cargo-xwin/xwin/crt/include /imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/ucrt /imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/um /imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/shared  ")

  --- stderr
  running "clang" "-O0" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "--target=aarch64-pc-windows-msvc" "--target=aarch64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/home/user/.cache/cargo-xwin/xwin/crt/include" "/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/um" "/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/shared" "-I" "include" "-I" "/tmp/test-ring/target/aarch64-pc-windows-msvc/debug/build/ring-8705dbada3a9c548/out" "-fvisibility=hidden" "-std=c1x" "-pedantic" "-Wall" "-Wextra" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-g3" "-DNDEBUG" "-c" "-o/tmp/test-ring/target/aarch64-pc-windows-msvc/debug/build/ring-8705dbada3a9c548/out/aesv8-armx-win64.o" "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.5/pregenerated/aesv8-armx-win64.S"
  clang: error: no such file or directory: '/imsvc/home/user/.cache/cargo-xwin/xwin/crt/include'
  clang: error: no such file or directory: '/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/ucrt'
  clang: error: no such file or directory: '/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/um'
  clang: error: no such file or directory: '/imsvc/home/user/.cache/cargo-xwin/xwin/sdk/include/shared'
  thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.5/build.rs:676:9:
  execution failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

could not find `um` in `winapi`

Hello.

First, thanks for building this project,
this makes cross compiling much easier.

Now, let's introduce my problem.
I'm trying to build a project that uses the winapi crate.

I'm compiling the project with this command:
cargo xwin build --target x86_64-pc-windows-msvc

But after that, my crate produces this error:
could not find 'um' in 'winapi'

After a little bit of investigation (just building with verbose activated 😂),
I've found that my crate was not linked to the windows api even though cargo xwin downloaded all the needed files in ~/.cache/cargo-xwin/.

It seems to be the only exception that does not compile.
It do not linked the windows API to every crate but these ones compile fine, so I guess that it only linked to crates that use windows API except mine.

Here the compile command for my crate (with just -v passed):
/home/AntwortEinesLebens/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name build_script_build --edition=2021 build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=280 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=26c3f6829815e3b9 -C extra-filename=-26c3f6829815e3b9 --out-dir /var/home/AntwortEinesLebens/Documents/DevelopmentProjects/Windows_Artefact_Generator/target/debug/build/wag-26c3f6829815e3b9 -C incremental=/var/home/AntwortEinesLebens/Documents/DevelopmentProjects/Windows_Artefact_Generator/target/debug/incremental -L dependency=/var/home/AntwortEinesLebens/Documents/DevelopmentProjects/Windows_Artefact_Generator/target/debug/deps --extern winapi=/var/home/AntwortEinesLebens/Documents/DevelopmentProjects/Windows_Artefact_Generator/target/debug/deps/libwinapi-60576e424869f99e.rlib --extern winres=/var/home/AntwortEinesLebens/Documents/DevelopmentProjects/Windows_Artefact_Generator/target/debug/deps/libwinres-d9419c2d8e80c623.rlib

Here some other information:

I'm running Fedora Silverblue but I do all my coding activities inside containers.
I'm using toolbox for that and running Fedora 38-39 inside them.
My cargo version is cargo 1.72.0 (103a7ff2e 2023-08-15).
I'm using cargo xwin version 0.14.7.

I also put the log file for the building process (still with just -v passed):
build.log

Thanks for reading and have a good day / night.

Link error when using with `paho-mqtt`. Missing file `msvcrtd.lib`

Getting everything built fine, but erroring out before the binary gets built at

= note: lld-link: error: could not open 'msvcrtd.lib': No such file or directory

My minimum reproducible build is this:

use paho_mqtt::PersistenceType;

fn main() {
    println!("{:?}", PersistenceType::File)
}
[package]
name = "simple_test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
paho-mqtt = { version = "0.12.1", default-features = false, features = [
    "bundled",
] }
Full Logs

Compiling simple_test v0.1.0 (/home/usr/Projects/simple_test) error: linking with `lld-link` failed: exit status: 1 | = note: LC_ALL="C" PATH="/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/User/.vscode-server/bin/e7e037083ff4455cf320e344325dacb480062c3c/bin/remote-cli:/home/User/.local/bin:/home/User/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/User/.local/bin:/home/User/.local/bin:/home/User/.cache/cargo-xwin" VSLANG="1033" "lld-link" "-flavor" "link" "/NOLOGO" "/tmp/rustcjTKpE3/symbols.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.3jr9repigvj00l8f.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.4isulp28qd5cz1z4.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.4mw5soifddteuifw.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.4q2ul9u4rbatfoje.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.4vaebkea8k87ulb.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.5a86i4ceihmh0154.rcgu.o" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.5aeci9rt0ff2xc35.rcgu.o" "/LIBPATH:/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps" "/LIBPATH:/home/User/Projects/simple_test/target/debug/deps" "/LIBPATH:/home/User/.cache/cargo-xwin/xwin/crt/lib/x86_64" "/LIBPATH:/home/User/.cache/cargo-xwin/xwin/sdk/lib/um/x86_64" "/LIBPATH:/home/User/.cache/cargo-xwin/xwin/sdk/lib/ucrt/x86_64" "/LIBPATH:/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/build/paho-mqtt-sys-dd65cbb17af06882/out/lib" "/LIBPATH:/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libpaho_mqtt-a95092e26cc6d2f1.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/liblibc-b328a3feab365bf2.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libthiserror-9fc7b4f3816f9aba.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_timer-1383099af1a8cc42.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures-3dae168ddf23ec12.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_executor-9136db4953843f0c.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_util-eb6f26ab0a718799.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libmemchr-ce558974a75412f7.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_io-74af30cfaa64019c.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libslab-cfc5f45f2af938b3.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_channel-7423866b630d1987.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libpin_project_lite-e86431b1d0d4a0b2.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_sink-f0157c7c34bf7e7c.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_task-8d14163c82fcd09b.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libpin_utils-a31b2450b47f8e88.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libcrossbeam_channel-aeea553b861bb157.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libasync_channel-260cdc41ec5ec842.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libfutures_core-58fe1011a42ac1c2.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libevent_listener-391ab901e13c80b8.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libconcurrent_queue-ef99aa6c44d8f036.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libcrossbeam_utils-0cf5bcac7f50da24.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libcfg_if-73311efafa1f74ad.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/libpaho_mqtt_sys-a7fc2278b79ab098.rlib" "/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/liblog-dea3dae10da49ccf.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd-6d80dd4621b609ca.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libpanic_unwind-28e98873675f19a9.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_demangle-4de870115f3f458f.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd_detect-ffc9fccfd2140b69.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libhashbrown-8a83799ae3c10d1a.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_std_workspace_alloc-fe19ee773224879a.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libminiz_oxide-654d17813ba7bea6.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libadler-f8fe6b4f80df7ee8.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libunwind-33080a7794fe111b.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libcfg_if-927908925e399197.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/liblibc-bb1b1a6951ff0244.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/liballoc-e2d4eb855c49fe9e.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_std_workspace_core-1dfd0cc5ad1fd4f1.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libcore-09e8922577df7322.rlib" "/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib/libcompiler_builtins-d1b73685f2fdc914.rlib" "legacy_stdio_definitions.lib" "kernel32.lib" "advapi32.lib" "bcrypt.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "ws2_32.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:/home/User/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-msvc/lib" "/OUT:/home/User/Projects/simple_test/target/x86_64-pc-windows-msvc/debug/deps/simple_test.exe" "/OPT:REF,NOICF" "/DEBUG"

= note: lld-link: error: could not open 'msvcrtd.lib': No such file or directory

error: could not compile simple_test (bin "simple_test") due to previous error

Failed to build for napi-rs

I'm trying to build from macos to windows using napi-rs. is error below a problem with node.js?

$ cargo xwin build --target x86_64-pc-windows-msvc

error: linking with `lld-link` failed: exit status: 1
  |
  = note: "lld-link" "-flavor" "link" "/DEF:/var/folders/06/l583zd5n1m34myqg90t3w95r0000gy/T/rustcTMvSwV/lib.def" "/NOLOGO" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.1jyy8w734oyjlkdw.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.3xmzi2f6yznmvke9.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.4457gy7djbbkza6s.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.45jrnfsrzqei5we0.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.56sz58ybl1qgjd5.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.d0str2lc3s7lntb.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.gms10agia86rl0.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.l7s8ragl3zmtnsh.rcgu.o" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.537dtz2pacykn2fi.rcgu.o" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/debug/deps" "/LIBPATH:/Users/kerui.lian/Library/Caches/cargo-xwin/xwin/crt/lib/x86_64" "/LIBPATH:/Users/kerui.lian/Library/Caches/cargo-xwin/xwin/sdk/lib/um/x86_64" "/LIBPATH:/Users/kerui.lian/Library/Caches/cargo-xwin/xwin/sdk/lib/ucrt/x86_64" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/build/node-15b4b75853f51642/out" "/LIBPATH:/Users/kerui.lian/.cargo/registry/src/github.com-1ecc6299db9ec823/windows_x86_64_msvc-0.30.0/lib" "/LIBPATH:/Users/kerui.lian/.cargo/registry/src/github.com-1ecc6299db9ec823/windows_x86_64_msvc-0.32.0/lib" "/LIBPATH:core/log/lib/windows/win" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/build/libz-sys-579dd9dad8ffb161/out/lib" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/build/libz-sys-579dd9dad8ffb161/out/lib" "/LIBPATH:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/build/ring-8d11c4034bf497dc/out" "/LIBPATH:/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib" "node-x64.lib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnapi-9b89c7caa2a8d66b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnapi_sys-b13266caa9c08ec8.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwindows-e6dbf8fdb3bea8e4.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libsdk-72e1e84cb3a1a923.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libpanic_monitor-e240300347cf893e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtoml-2ebb99f1f20fc0dc.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libos_info-31323bed7050c922.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnetwork-fc5794228f500bcb.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwebpki_roots-fcaa37611ff02697.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libhex-98baf40e2799672b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librmp_serde-54a4f6bb6dd4a760.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librmp-bd810c53610e15fe.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnum_traits-e050119b9b030ae0.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtokio_tungstenite-315c4cfbee1930e1.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libpin_project-a0301659b38d6bb7.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtokio_native_tls-d5a84412649a904c.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtungstenite-7158f7a58360cb9f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbase64-8b1979a762d92b3f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librand-cd6d4e57cecc359b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librand_chacha-3011c25a6f54a97d.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libppv_lite86-61794855a1dec592.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librand_core-e2d720e4aa83de03.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libgetrandom-d79c42f12f71f6ef.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libutf8-035957444fc0789e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbyteorder-c2da14bf6673182f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libsha1-54f75ad970d6d6ca.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libopaque_debug-270c61b02f97deae.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libcpufeatures-a6d5c29ffae468eb.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libblock_buffer-189911a4d77613f8.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libdigest-ac0eb717dcf8058f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libgeneric_array-5080313a96c6753a.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtypenum-66b79020dc253618.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libinput_buffer-21c21724b3cfc735.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libhttparse-fb067e79c7083a4f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnative_tls-ed695a5db8bc43af.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libschannel-b578ca66f99f8cd2.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liburl-872d77527d996a22.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libidna-141143cbdf51eb2f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libunicode_normalization-69f36f68f7796d8e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtinyvec-850f66873a5e19b7.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtinyvec_macros-bc3813f134893656.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libunicode_bidi-ccf7e8a7676619d2.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libform_urlencoded-9e92acf0013961db.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libpercent_encoding-9fc886178857cb3a.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libmatches-64c7b9c7046ed63e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libhttp-cb07233c1bf79385.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libitoa-a5d3bf6e6cd5d690.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfnv-43b57e363d26fd7c.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtokio_rustls-e210c8f59c40bcf0.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librustls-db626de07e601a50.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libsct-dee3abc5aab3d5f2.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwebpki-e0cecf7fbdae74df.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libring-bb15a59360850de6.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libspin-d98c5c11558efa7d.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libuntrusted-2f562de7d25d2d12.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtokio_util-210a5ff842bcf0b0.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfailure-be4ac953a30ef908.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbacktrace-b19046e9b06fae23.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/librustc_demangle-941082f64d25acf5.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libserde-ed248b61327ab54b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnom-c99f8977f7436b41.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblexical_core-d08c1f633cebf2b9.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbitflags-4d0dc71f4fad52ea.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libryu-499b13adf5e77612.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libstatic_assertions-cd423e24f46ae17a.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libarrayvec-a2e061e42ae3aa91.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbitvec-704eb8910cea9db1.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfunty-7ebf4b21be3c4bec.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwyz-e81e56cd0a97fc7c.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtap-08a0e83d89156d20.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libradium-ca5c0fd6a624b0d4.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libliblog-680bb57935afaa82.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libgettid-78fbe751e5e9d955.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblibz_sys-f5bb5e757e9087c6.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblibc-44f74c4dafcf2b42.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblink_cplusplus-c065282f4745bd1c.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbridge-50a53808b816b224.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libprost-fef7b26f57e90f0e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libthiserror-f3ff810216b6f176.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libtokio-1df9e9adfbdb3d84.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libnum_cpus-e1511d1ff4dadbba.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libsocket2-953e20a378cae557.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libonce_cell-8c21e38169e63852.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libbytes-6ed18ad6b538b9f5.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libmio-3c5a75d35ed462d4.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libmiow-562889d46b1176fa.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libntapi-1bb4b27b2c9ef753.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblog-8be6f97d784bb53b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwinapi-f98a2a883ddfef5d.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libparking_lot-4637368cd0b264b3.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libparking_lot_core-2fb1ba8782208b87.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libwindows_sys-fc4662ecbe525d4b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libcfg_if-5c0d39d12e2c7f2e.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libsmallvec-9efc3eaa72ef0b12.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblock_api-dcd8aa6a16319bbf.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libscopeguard-37dc9e4c1e67f454.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/liblazy_static-72808a07df37bcf6.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures-039a4165ee4ab78f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_executor-63274d892f2ff0e5.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_util-d389eaab597409fb.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libmemchr-a3defd4cb4654fa6.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_io-46eed63d6014b5a4.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libslab-79a114736344531b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_channel-0ecb81eff8e6a78b.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libpin_project_lite-d0c2b2363b603bac.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_sink-1d3fe470657c285f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_task-8d78a7d4f8948a4f.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libpin_utils-c4b8786a2e06c746.rlib" "/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/libfutures_core-2c8b147798d4bc9a.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd-9505d954cc550ca4.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libpanic_unwind-4368ec34df66b968.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_demangle-c4e960482b87deda.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd_detect-3e30157661c6e929.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libhashbrown-441bbf33311d8f21.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_std_workspace_alloc-a65adc14aa7ec78a.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libunwind-754bada3b2f76f43.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libcfg_if-bbc7454d63bcee48.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/liblibc-083a8721e26e7568.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/liballoc-fc82f5be4815a343.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/librustc_std_workspace_core-14f675cf009ff7ec.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libcore-39142ba17f25ae37.rlib" "/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib/libcompiler_builtins-1a5802a39db22341.rlib" "windows.lib" "kernel32.lib" "oleaut32.lib" "ole32.lib" "oleaut32.lib" "kernel32.lib" "bcrypt.lib" "xlog.lib" "c++.lib" "ntdll.lib" "advapi32.lib" "bcrypt.lib" "cfgmgr32.lib" "credui.lib" "crypt32.lib" "cryptnet.lib" "fwpuclnt.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "mswsock.lib" "ncrypt.lib" "ntdll.lib" "opengl32.lib" "secur32.lib" "synchronization.lib" "user32.lib" "winspool.lib" "ws2_32.lib" "windows.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:/Users/kerui.lian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-msvc/lib" "/OUT:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.dll" "/OPT:REF,NOICF" "/DLL" "/IMPLIB:/Users/kerui.lian/works/shopee/works/rust/seatalk-sdk/target/x86_64-pc-windows-msvc/debug/deps/node.dll.lib" "/DEBUG" "delayimp.lib" "/DELAYLOAD:node.exe"
  = note: lld-link: error: could not open 'c++.lib': No such file or directory
          

warning: `node` (lib) generated 5 warnings
error: could not compile `node` due to previous error; 5 warnings emitted

Error building from AArch64 Apple host to AArch64 MSVC target with `ring-0.16.20`

ring + cargo xwin build --target=aarch64-pc-windows-msvc fails.
Building for native arch (cargo build) with ring and cross-building without ring both work fine.

Minimal repro:

  • Be on apple silicon
  • Install required tools
cargo install cargo-xwin
brew install llvm
rustup target add aarch64-pc-windows-msvc
rustup component add llvm-tools-preview
  • Create new rust project, add ring, try and build
cargo new cargo-xwin-ring
cd cargo-xwin-ring
cargo add ring
cargo xwin build --target=aarch64-pc-windows-msvc # ERROR

The error is extremely long (mostly consisting of crypto/fipsmodule C warnings), here is the start & end of it:

start

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/Users/johnk/repos/cargo-xwin-ring/target/debug/build/ring-371cd9d42b03462b/build-script-build` (exit status: 101)
  --- stdout
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")
  OPT_LEVEL = Some("0")
  TARGET = Some("aarch64-pc-windows-msvc")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
  CC_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
  CC_aarch64_pc_windows_msvc = Some("clang-cl")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
  CFLAGS_aarch64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
  CFLAGS_aarch64_pc_windows_msvc = Some("--target=aarch64-pc-windows-msvc -Wno-unused-command-line-argument -fuse-ld=lld-link /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um /imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared  ")

  --- stderr
  running "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "--target=aarch64-pc-windows-msvc" "--target=aarch64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/johnk/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "include" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Od" "/RTCsu" "-DNDEBUG" "-c" "/Fo/Users/johnk/repos/cargo-xwin-ring/target/aarch64-pc-windows-msvc/debug/build/ring-d315a09b728de0b0/out/aes_nohw.obj" "crypto/fipsmodule/aes/aes_nohw.c"

end

  thread 'main' panicked at '"/Users/johnk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.16.20/pregenerated/aesv8-armx-linux64.obj": Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/johnk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.16.20/build.rs:769:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Invalid cross-device link (os error 18)

Getting this error when trying to use cargo xwinbuild on my server running Arch Linux.

From what I could find, it seems like this error probably means it's making the unsafe assumption that /tmp is on the same filesystem as /home and trying to rename files across filesystems.

putty_y7by8j8KMA

Unable to build with `embed-resource` dependency

Host machine: aarch64-apple-darwin

Context: I trying to cross-compile tauri, which uses winres (and embed-resource), tauri-apps/tauri#7816

Minimal repro with only embed_resource as build-dependency:
Following code

// build.rs

fn main() {
    embed_resource::compile(
        "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore", // Absolute path includes */U*
        embed_resource::NONE,
    )
}

With build command

cargo xwin build --target x86_64-pc-windows-msvc

Causes compile error; stderr:

The following warnings were emitted during compilation:

�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: warning: '/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore' treated as the '/U' option [-Wslash-u-filename]
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: note: use '--' to treat subsequent arguments as filenames
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: error: no input files

�[1m�[31merror�[0m�[1m:�[0m failed to run custom build command for `embed-resources v0.1.0 (/Users/pavel.smirnov/Source/temp/embed-resources)`

Caused by:
  process didn't exit successfully: `/Users/pavel.smirnov/Source/temp/embed-resources/target/debug/build/embed-resources-e8182c710fae58ac/build-script-build` (exit status: 1)
  --- stdout
  running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "/Users/pavel.smirnov/Source/temp/embed-resources/target/x86_64-pc-windows-msvc/debug/build/embed-resources-4f8e1beb062f0e0a/out" "-xc" "-DRC_INVOKED" "-E" "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore"
  cargo:warning=clang-cl: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]

  cargo:warning=clang-cl: warning: '/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore' treated as the '/U' option [-Wslash-u-filename]

  cargo:warning=clang-cl: note: use '--' to treat subsequent arguments as filenames

  cargo:warning=clang-cl: error: no input files

  exit status: 1

  --- stderr


  error occurred: Command "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "/Users/pavel.smirnov/Source/temp/embed-resources/target/x86_64-pc-windows-msvc/debug/build/embed-resources-4f8e1beb062f0e0a/out" "-xc" "-DRC_INVOKED" "-E" "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore" with args "clang-cl" did not execute successfully (status code exit status: 1).

Building works for `x86_64-pc-windows-msvc` but not `i686-pc-windows-msvc`

Apple M1 on macOS.
I installed x86_64-pc-windows-msvc via rustup target add x86_64-pc-windows-msvc, and cargo xwin --target=x86_64-pc-windows-msvc works great.

However, when I added i686-pc-windows-msvc, I get a large number of linker errors:

  = note: lld-link: error: could not open 'kernel32.lib': No such file or directory
          lld-link: error: could not open 'ntdll.lib': No such file or directory
          lld-link: error: could not open 'bcrypt.lib': No such file or directory
          lld-link: error: could not open 'advapi32.lib': No such file or directory
          lld-link: error: could not open 'advapi32.lib': No such file or directory
          lld-link: error: could not open 'cfgmgr32.lib': No such file or directory
          lld-link: error: could not open 'credui.lib': No such file or directory
          lld-link: error: could not open 'fwpuclnt.lib': No such file or directory
          lld-link: error: could not open 'gdi32.lib': No such file or directory
          lld-link: error: could not open 'kernel32.lib': No such file or directory
          lld-link: error: could not open 'msimg32.lib': No such file or directory
          lld-link: error: could not open 'ntdll.lib': No such file or directory
          lld-link: error: could not open 'ole32.lib': No such file or directory
          lld-link: error: could not open 'opengl32.lib': No such file or directory
          lld-link: error: could not open 'secur32.lib': No such file or directory
          lld-link: error: could not open 'shell32.lib': No such file or directory
          lld-link: error: could not open 'user32.lib': No such file or directory
          lld-link: error: could not open 'winspool.lib': No such file or directory
          lld-link: error: could not open 'ws2_32.lib': No such file or directory
          lld-link: error: could not open 'kernel32.lib': No such file or directory
          lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)

I am assuming this is user error and I have forgotten a step, but I am not sure what it is

Build fail with `llvm-lib cq: no such file or directory`

llvm installed, llvm-ar command exists, but it makes error like below.

cargo:warning=cq: no such file or directory

--- stderr

error occurred: Command ZERO_AR_DATE="1" "llvm-lib" "cq" "/home/ubuntu/namseent/jigcle/target/namui/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-381b4b54e8abb0eb/out/libmimalloc.a" "/home/ubuntu/namseent/jigcle/target/namui/target/x86_64-pc-windows-msvc/debug/build/libmimalloc-sys-381b4b54e8abb0eb/out/98cfcaec7182b1d8-static.o" with args llvm-lib did not execute successfully (status code exit status: 1).

Linker args in rustflags

I'm trying to set linker flags for identical code folding with xwin using

-Clink-args=-fuse-ld=lld -Clink-args=-Wl,--icf=all

However, both this and -Clink-args=-fuse-ld=rust-lld.exe (set as the linker in .cargo/config of Bevy fast builds) do not work as the code sizes seem to be exactly the same. Should I use a different compiler flag to set a linker for msvc or does the linker have a different name?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.