mullvad / mullvadvpn-app

The Mullvad VPN client app for desktop and mobile
https://mullvad.net/
GNU General Public License v3.0
5.07k stars 337 forks source link

windows build failure on arm64 #6879

Open orvitpng opened 1 month ago

orvitpng commented 1 month ago

Is it a bug?

I have checked if others have reported this already

Current Behavior

The cargo build --release command is executed and the following error is provided during the building of mullvad-daemon:

> cargo build --release
   Compiling talpid-wireguard v0.0.0 (C:\Users\carter\Documents\build\mullvadvpn-app\talpid-wireguard)
warning: mullvad-daemon@0.0.0: Skipping mullvad-daemon manifest
   Compiling mullvad-cli v0.0.0 (C:\Users\carter\Documents\build\mullvadvpn-app\mullvad-cli)
   Compiling talpid-core v0.0.0 (C:\Users\carter\Documents\build\mullvadvpn-app\talpid-core)
   Compiling mullvad-daemon v0.0.0 (C:\Users\carter\Documents\build\mullvadvpn-app\mullvad-daemon)
   Compiling mullvad-setup v0.0.0 (C:\Users\carter\Documents\build\mullvadvpn-app\mullvad-setup)
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostARM64\\arm64\\link.exe" "/NOLOGO" "C:\\Users\\carter\\AppData\\Local\\Temp\\rustcP8lho9\\symbols.o" "C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\deps\\mullvad_setup.mullvad_setup.a648357a7a6512c6-cgu.01.rcgu.o" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\deps" "/LIBPATH:C:\\Users\\carter\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\windows_aarch64_msvc-0.52.6\\lib" "/LIBPATH:C:\\Users\\carter\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\windows_aarch64_msvc-0.48.5\\lib" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\atlmfc\\lib\\arm64" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\build\\blake3-5eb6678dbb987c7d\\out" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\build\\ring-826db3ddd5757ad4\\out" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\build\\mullvad-daemon-36729f2b94f984f4\\out" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\talpid-core\\..\\windows\\winfw\\bin\\ARM64-Release" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\talpid-core\\../build/lib\\aarch64-pc-windows-msvc" "/LIBPATH:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\talpid-wireguard\\../dist-assets/binaries\\aarch64-pc-windows-msvc" "/LIBPATH:C:\\Users\\carter\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\windows_aarch64_msvc-0.42.2\\lib" "/LIBPATH:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\aarch64-pc-windows-msvc\\lib" "C:\\Users\\carter\\AppData\\Local\\Temp\\rustcP8lho9\\libblake3-092990d3686c9a6d.rlib" "C:\\Users\\carter\\AppData\\Local\\Temp\\rustcP8lho9\\libring-f0b3a2d81ef2f8ac.rlib" "C:\\Users\\carter\\AppData\\Local\\Temp\\rustcP8lho9\\libstd-41b9f7027d45f548.rlib" "C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\aarch64-pc-windows-msvc\\lib\\libcompiler_builtins-7ce0954d5cc9490d.rlib" "dbghelp.lib" "resource.lib" "dnsapi.lib" "winfw.lib" "windows.lib" "advapi32.lib" "advapi32.lib" "cfgmgr32.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "user32.lib" "winspool.lib" "legacy_stdio_definitions.lib" "windows.0.52.0.lib" "iphlpapi.lib" "windows.0.48.5.lib" "windows.0.52.0.lib" "bcrypt.lib" "advapi32.lib" "windows.0.48.5.lib" "windows.0.52.0.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "kernel32.lib" "/defaultlib:libcmt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\aarch64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\carter\\Documents\\build\\mullvadvpn-app\\target\\release\\deps\\mullvad_setup.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\carter\\.rustup\\toolchains\\stable-aarch64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: LINK : fatal error LNK1181: cannot open input file 'winfw.lib'

error: could not compile `mullvad-setup` (bin "mullvad-setup") due to 1 previous error

Expected Behavior

The build is successful and the program runs faultlessly.

Steps to Reproduce

  1. Use an arm64 device.
  2. Install all required programs within the BuildInstructions.md file.
  3. Attempt to build the program.

Failure Logs

No response

Operating system version

Windows 11 arm64

Mullvad VPN app version

No response

Additional Information

No response

dlon commented 1 month ago

In general, we do not currently support building on Windows ARM64, only cross-compiling from x86_64. It may be easily fixed, though.

If you have not done so, you could try first running build-windows-modules.sh with the env CPP_BUILD_TARGET=ARM64 and see if that helps. If you have already built the Windows libraries, I'm guessing that the library search paths are off.