refactor: migrate Windows target from x86 to x64 architecture
Update all Windows build configurations, scripts, and documentation from i686-pc-windows-msvc (x86) to x86_64-pc-windows-msvc (x64). Update npm scripts, build-tunnel-helper.sh target validation, bundled helper paths, and tunnel manager strategy references. Add XWIN_ARCH=x86_64 environment variable to Linux cross-build command and --xwin-arch flag to cargo xwin invocation.
This commit is contained in:
12
README.md
12
README.md
@@ -46,7 +46,7 @@ This repository contains the initial production-minded MVP scaffold:
|
|||||||
|
|
||||||
## Desktop Requirements
|
## Desktop Requirements
|
||||||
|
|
||||||
- Windows x86: package NexaVPN with the bundled Windows x86 tunnel helper
|
- Windows x64: package NexaVPN with the bundled Windows x64 tunnel helper
|
||||||
- macOS ARM: package NexaVPN with the bundled macOS ARM tunnel helper
|
- macOS ARM: package NexaVPN with the bundled macOS ARM tunnel helper
|
||||||
|
|
||||||
See [client-platforms.md](/mnt/c/Users/neste/Documents/GIT/NexaVPN/docs/client-platforms.md) for the current platform strategy.
|
See [client-platforms.md](/mnt/c/Users/neste/Documents/GIT/NexaVPN/docs/client-platforms.md) for the current platform strategy.
|
||||||
@@ -55,7 +55,7 @@ Helper build commands:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd desktop-client
|
cd desktop-client
|
||||||
npm run helper:windows-x86
|
npm run helper:windows-x64
|
||||||
npm run helper:macos-arm64
|
npm run helper:macos-arm64
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -64,17 +64,19 @@ Ubuntu-to-Windows `Setup.exe` build:
|
|||||||
```bash
|
```bash
|
||||||
cd desktop-client
|
cd desktop-client
|
||||||
cargo install --locked cargo-xwin
|
cargo install --locked cargo-xwin
|
||||||
rustup target add i686-pc-windows-msvc
|
rustup target add x86_64-pc-windows-msvc
|
||||||
npm install
|
npm install
|
||||||
npm run helper:windows-x86
|
npm run helper:windows-x64
|
||||||
npm run tauri:build:windows-x86:linux
|
npm run tauri:build:windows-x64:linux
|
||||||
```
|
```
|
||||||
|
|
||||||
The resulting NSIS installer is written to:
|
The resulting NSIS installer is written to:
|
||||||
|
|
||||||
- `desktop-client/src-tauri/target/i686-pc-windows-msvc/release/bundle/nsis/`
|
- `desktop-client/src-tauri/target/i686-pc-windows-msvc/release/bundle/nsis/`
|
||||||
|
- `desktop-client/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/`
|
||||||
|
|
||||||
This Linux cross-build path is intended for NSIS `Setup.exe` output. Native MSI packaging and final Windows code signing should still be done on Windows.
|
This Linux cross-build path is intended for NSIS `Setup.exe` output. Native MSI packaging and final Windows code signing should still be done on Windows.
|
||||||
|
For `x86_64-pc-windows-msvc`, the build uses the Windows `x86_64` SDK/CRT set via `cargo-xwin`.
|
||||||
|
|
||||||
Gateway utility scripts:
|
Gateway utility scripts:
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"tauri:dev": "tauri dev",
|
"tauri:dev": "tauri dev",
|
||||||
"tauri:build": "tauri build",
|
"tauri:build": "tauri build",
|
||||||
"helper:windows-x86": "bash ./scripts/build-tunnel-helper.sh i686-pc-windows-msvc",
|
"helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc",
|
||||||
"helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin",
|
"helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin",
|
||||||
"tauri:build:windows-x86:linux": "tauri build --runner cargo-xwin --target i686-pc-windows-msvc --config src-tauri/tauri.windows.conf.json"
|
"tauri:build:windows-x64:linux": "XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2.3.0",
|
"@tauri-apps/api": "^2.3.0",
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ if [ -z "${TARGET}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "${TARGET}" in
|
case "${TARGET}" in
|
||||||
i686-pc-windows-msvc)
|
x86_64-pc-windows-msvc)
|
||||||
OUTPUT_DIR="${BUNDLED_DIR}/windows-x86"
|
OUTPUT_DIR="${BUNDLED_DIR}/windows-x64"
|
||||||
OUTPUT_NAME="nexavpn-tunnel-helper.exe"
|
OUTPUT_NAME="nexavpn-tunnel-helper.exe"
|
||||||
;;
|
;;
|
||||||
aarch64-apple-darwin)
|
aarch64-apple-darwin)
|
||||||
@@ -27,7 +27,7 @@ case "${TARGET}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
if [ "${TARGET}" = "x86_64-pc-windows-msvc" ]; then
|
||||||
case "${HOST_OS}" in
|
case "${HOST_OS}" in
|
||||||
MINGW64_NT*|MSYS_NT*|CYGWIN_NT*)
|
MINGW64_NT*|MSYS_NT*|CYGWIN_NT*)
|
||||||
;;
|
;;
|
||||||
@@ -40,10 +40,10 @@ if [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Windows x86 helper builds are supported on Windows or on Linux with cargo-xwin."
|
echo "Windows x64 helper builds are supported on Windows or on Linux with cargo-xwin."
|
||||||
echo "Current host: ${HOST_OS}"
|
echo "Current host: ${HOST_OS}"
|
||||||
echo "Install the target with:"
|
echo "Install the target with:"
|
||||||
echo " rustup target add i686-pc-windows-msvc"
|
echo " rustup target add x86_64-pc-windows-msvc"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -70,8 +70,8 @@ if ! rustup target list --installed | grep -qx "${TARGET}"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${OUTPUT_DIR}"
|
mkdir -p "${OUTPUT_DIR}"
|
||||||
if [ "${HOST_OS}" = "Linux" ] && [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
if [ "${HOST_OS}" = "Linux" ] && [ "${TARGET}" = "x86_64-pc-windows-msvc" ]; then
|
||||||
cargo xwin build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
|
cargo xwin build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}" --xwin-arch x86_64
|
||||||
else
|
else
|
||||||
cargo build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
|
cargo build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
desktop-client/src-tauri/bundled/windows-x64/README.txt
Normal file
1
desktop-client/src-tauri/bundled/windows-x64/README.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Bundle the Windows x64 NexaVPN tunnel helper here.
|
||||||
@@ -7,7 +7,7 @@ use tauri::{AppHandle, Manager};
|
|||||||
|
|
||||||
pub fn current_tunnel_strategy() -> &'static str {
|
pub fn current_tunnel_strategy() -> &'static str {
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "windows") {
|
||||||
"embedded-wireguard-windows-x86"
|
"embedded-wireguard-windows-x64"
|
||||||
} else if cfg!(target_os = "macos") {
|
} else if cfg!(target_os = "macos") {
|
||||||
"embedded-wireguard-macos-arm"
|
"embedded-wireguard-macos-arm"
|
||||||
} else {
|
} else {
|
||||||
@@ -54,11 +54,11 @@ fn bundled_backend(app: &AppHandle) -> Result<PathBuf, String> {
|
|||||||
.map_err(|err| format!("Unable to resolve resource dir: {}", err))?;
|
.map_err(|err| format!("Unable to resolve resource dir: {}", err))?;
|
||||||
|
|
||||||
let relative = if cfg!(target_os = "windows") {
|
let relative = if cfg!(target_os = "windows") {
|
||||||
PathBuf::from("bundled/windows-x86/nexavpn-tunnel-helper.exe")
|
PathBuf::from("bundled/windows-x64/nexavpn-tunnel-helper.exe")
|
||||||
} else if cfg!(target_os = "macos") {
|
} else if cfg!(target_os = "macos") {
|
||||||
PathBuf::from("bundled/macos-arm64/nexavpn-tunnel-helper")
|
PathBuf::from("bundled/macos-arm64/nexavpn-tunnel-helper")
|
||||||
} else {
|
} else {
|
||||||
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x86 and macOS ARM".into());
|
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x64 and macOS ARM".into());
|
||||||
};
|
};
|
||||||
|
|
||||||
let path = resource_dir.join(relative);
|
let path = resource_dir.join(relative);
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# Desktop Platform Strategy
|
# Desktop Platform Strategy
|
||||||
|
|
||||||
## Windows x86
|
## Windows x64
|
||||||
|
|
||||||
Current MVP integration path:
|
Current MVP integration path:
|
||||||
|
|
||||||
- NexaVPN enrolls the device and stores the generated profile locally.
|
- NexaVPN enrolls the device and stores the generated profile locally.
|
||||||
- NexaVPN is intended to ship its own bundled Windows x86 tunnel helper.
|
- NexaVPN is intended to ship its own bundled Windows x64 tunnel helper.
|
||||||
- The end user should interact only with NexaVPN.
|
- The end user should interact only with NexaVPN.
|
||||||
- The bundled helper encapsulates the WireGuard runtime internally.
|
- The bundled helper encapsulates the WireGuard runtime internally.
|
||||||
|
|
||||||
Repository status:
|
Repository status:
|
||||||
|
|
||||||
- the NexaVPN tunnel helper CLI is now included in `desktop-client/tunnel-helper/`
|
- the NexaVPN tunnel helper CLI is now included in `desktop-client/tunnel-helper/`
|
||||||
- the Windows x86 build can be bundled into `src-tauri/bundled/windows-x86/`
|
- the Windows x64 build can be bundled into `src-tauri/bundled/windows-x64/`
|
||||||
- Ubuntu server builds can cross-compile the Windows x86 helper and Tauri app with `cargo-xwin`
|
- Ubuntu server builds can cross-compile the Windows x64 helper and Tauri app with `cargo-xwin`
|
||||||
- the Linux-based Windows packaging path targets NSIS `Setup.exe`; MSI packaging still requires a Windows environment
|
- the Linux-based Windows packaging path targets NSIS `Setup.exe`; MSI packaging still requires a Windows environment
|
||||||
|
|
||||||
## macOS ARM
|
## macOS ARM
|
||||||
|
|||||||
Reference in New Issue
Block a user