mobilecoinfoundation / mobilecoin

Private payments for mobile devices.
Other
1.16k stars 148 forks source link

mobilecoind does not compile for Windows #97

Open rjwalters opened 4 years ago

rjwalters commented 4 years ago

One of the cardinal rules for MobileCoin is that users should never have to share their private keys with a remote server. This implies that all of the participants in the test network need to be able to run a local instance of mobilecoind to sync the ledger and build transactions.

Attempting to build mobilecoind for Windows (without Docker) looks like this:

PS C:\Users\Robb\Desktop\GitHub\mobilecoin\mobilecoind> cargo +nightly-2019-12-19 build --release
   Compiling mbedtls v0.5.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6)
error: failed to run custom build command for `mbedtls v0.5.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6)`

Caused by:
  process didn't exit successfully: `C:\Users\Robb\Desktop\GitHub\mobilecoin\target\release\build\mbedtls-06d16eacb65d7eef\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("adx,aes,avx,avx2,bmi1,bmi2,cmpxchg16b,f16c,fma,fxsr,lzcnt,mmx,movbe,pclmulqdq,popcnt,rdrand,rdseed,sse,sse2,sse3,sse4.1,sse4.2,ssse3,xsave,xsavec,xsaveopt,xsaves")
DEBUG = Some("false")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-W4" "-FoC:\\Users\\Robb\\Desktop\\GitHub\\mobilecoin\\target\\release\\build\\mbedtls-10cea2e2cc320eb5\\out\\src/rust_printf.o" "-c" "src/rust_printf.c"
rust_printf.c
src/rust_printf.c(25): error C2057: expected constant expression
src/rust_printf.c(25): error C2466: cannot allocate an array of constant size 0
src/rust_printf.c(25): error C2133: 'p': unknown size
exit code: 2

MobileCoin depends on a fork of a Fortanix project in which we have updated bindgen (see https://github.com/fortanix/rust-mbedtls/issues/5).

However we have not yet fixed some other issues there related to Windows support (see https://github.com/fortanix/rust-mbedtls/issues/84).

Patching rust-mbedtls to work on Windows seems like the next step towards inviting Windows users to try out MobileCoin!

xoloki commented 4 years ago

Is compiling natively on Windows, or using Windows Subsystem for Linux?

sintaxx commented 3 years ago

Is compiling natively on Windows, or using Windows Subsystem for Linux?

Based upon his output, that's Windows.