rust-cross / cargo-xwin

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

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

Closed Kijewski closed 2 years ago

Kijewski commented 2 years ago

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 :) )

messense commented 2 years ago

Thanks for the report, I'm glad it worked for you in the end.

I plan to add some options to let you customize CRT/SDK cache directory in the next release, hopefully it will improve the current situation.

messense commented 2 years ago

https://github.com/messense/cargo-xwinbuild#customization

Please give v0.2.0 a try, you can now specify cache directory via XWIN_CACHE_DIR env var or --xwin-cache-dir CLI option.