From b8bb4d3316137dc2a9a0ac6049ab85e96c1405aa Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 19 Feb 2025 10:35:53 +0000 Subject: [PATCH] Add Windows ARM 64 package (#624) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .github/workflows/build_and_deploy.yaml | 2 +- .github/workflows/build_and_test.yaml | 2 +- .github/workflows/build_windows.yaml | 17 ++++++++++++----- docs/windows-requirements.md | 7 +++++++ package.json | 2 +- scripts/cl.bat | 7 +++++++ 6 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 scripts/cl.bat diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index c167dfe6..0aea2b39 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -62,7 +62,7 @@ jobs: name: Windows ${{ matrix.arch }} strategy: matrix: - arch: [ia32, x64] + arch: [ia32, x64, arm64] uses: ./.github/workflows/build_windows.yaml secrets: inherit with: diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index c0874163..0cea1bd2 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -22,7 +22,7 @@ jobs: uses: ./.github/workflows/build_windows.yaml strategy: matrix: - arch: [x64, ia32] + arch: [x64, ia32, arm64] with: arch: ${{ matrix.arch }} diff --git a/.github/workflows/build_windows.yaml b/.github/workflows/build_windows.yaml index a553027d..b48760d6 100644 --- a/.github/workflows/build_windows.yaml +++ b/.github/workflows/build_windows.yaml @@ -74,11 +74,6 @@ jobs: path: | ./.hak - - name: Set up build tools - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - with: - arch: ${{ steps.config.outputs.arch || inputs.arch }} - # ActiveTCL package on choco is from 2015, # this one is newer but includes more than we need - name: Choco install tclsh @@ -110,6 +105,18 @@ jobs: - name: Install Deps run: "yarn install --frozen-lockfile" + - name: Set up sqlcipher macros + if: steps.cache.outputs.cache-hit != 'true' && contains(inputs.arch, 'arm') + shell: pwsh + run: | + echo "NCC=${{ github.workspace }}\scripts\cl.bat" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Set up build tools + if: steps.cache.outputs.cache-hit != 'true' + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + with: + arch: ${{ steps.config.outputs.arch || inputs.arch }} + - name: Build Natives if: steps.cache.outputs.cache-hit != 'true' run: | diff --git a/docs/windows-requirements.md b/docs/windows-requirements.md index 774b3478..135032d3 100644 --- a/docs/windows-requirements.md +++ b/docs/windows-requirements.md @@ -12,6 +12,13 @@ If you want to build native modules, make sure that the following tools are inst - [Strawberry Perl](https://strawberryperl.com/) - [Rustup](https://rustup.rs/) - [NASM](https://www.nasm.us/) + +You can install the above tools using [Chocolatey](https://chocolatey.org/install): + +```cmd +choco install --no-progress -y git nodejs-lts yarn python StrawberryPerl rustup.install nasm magicsplat-tcl-tk +``` + - [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with the following configuration: - On the Workloads tab: - Desktop & Mobile -> C++ build tools diff --git a/package.json b/package.json index cc024799..4fffc000 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "typescript": "5.7.3" }, "hakDependencies": { - "matrix-seshat": "^4.0.0", + "matrix-seshat": "^4.0.1", "keytar": "^7.9.0" }, "resolutions": { diff --git a/scripts/cl.bat b/scripts/cl.bat new file mode 100644 index 00000000..e5ee0ec5 --- /dev/null +++ b/scripts/cl.bat @@ -0,0 +1,7 @@ +REM Batch file to aid in cross-compiling sqlcipher for Windows ARM64 +REM Full path should be passed to Makefile.msc as NCC env var + +setlocal +call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VSCMD_ARG_HOST_ARCH% +cl.exe %* +endlocal