signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.69k stars 2.68k forks source link

Signal 7.23.0 not building for/on Windows arm64 (sqlite3 bug already fixed upstream) #7010

Closed dennisameling closed 2 months ago

dennisameling commented 2 months ago

Using a supported version?

Overall summary

When building Signal Desktop for/on Windows arm64 using your official repo (https://github.com/signalapp/Signal-Desktop), the better-sqlite3 dependency installation fails with:

C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\obj\global_intermediate\sqlite3\sqlite3.c(25013,3): error C2099: initializer is not a constant [C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\deps\sqlite3.vcxproj]

An example build log (from an x64 host) can be found here.

This bug was already reported and fixed upstream in June of this year (here, and here), so Signal would just need to update sqlite3 to the latest version to fix this. Otherwise, the reported workaround may also work for now.

I'd love to help, but it looks like you're building sqlchiper in-house, and I can't seem to find where the source code is located.

Let me know if there's anything I can do to help! 🙏🏼

Steps to reproduce

  1. Clone this repo (https://github.com/signalapp/Signal-Desktop) on Windows arm64 (or try to cross-compile it on an x64 host, see build commands here)
  2. Run npm install
  3. This error gets shown:
npm error code 1
npm error path C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c npm run download && npm run build-release
npm error > @signalapp/better-sqlite3@8.8.1 download
npm error > node ./deps/download.js
npm error
npm error downloading https://build-artifacts.signal.org/desktop/sqlcipher-4.6.1--3.0.7--0.2.1-7c30de8bcb5d21127803f5ab19a097e1b508d05744aca3ac6166352506b5f451.tar.gz
npm error
npm error > @signalapp/better-sqlite3@8.8.1 build-release
npm error > node-gyp rebuild --release
npm error
npm error
npm error
npm error   extract_sqlite3
npm error   Copying C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\/obj/global_intermediate/sqlite3/OpenSSL-win-arm64/libssl.lib to C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\
npm error           1 file(s) copied.
npm error   Copying C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\/obj/global_intermediate/sqlite3/OpenSSL-win-arm64/libcrypto.lib to C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\
npm error           1 file(s) copied.
npm error   Copying C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\/obj/global_intermediate/sqlite3/signal-tokenizer/aarch64-pc-windows-msvc/signal_tokenizer.lib to C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\
npm error           1 file(s) copied.
npm error   sqlite3.c
npm error C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\Release\obj\global_intermediate\sqlite3\sqlite3.c(25013,3): error C2099: initializer is not a constant [C:\repos\signal-desktop\node_modules\@signalapp\better-sqlite3\build\deps\sqlite3.vcxproj]
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.0.1
npm error gyp info using node@20.16.0 | win32 | arm64
npm error gyp info find Python using Python version 3.11.9 found at "C:\Users\dennisameling\AppData\Local\Programs\Python\Python311-arm64\python.exe"
npm error gyp info find VS using VS2022 (17.11.35222.181) found at:
npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp info spawn C:\Users\dennisameling\AppData\Local\Programs\Python\Python311-arm64\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\\repos\\signal-desktop\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\repos\\signal-desktop\\node_modules\\@signalapp\\better-sqlite3\\build\\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\repos\\signal-desktop\\node_modules\\node-gyp\\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\dennisameling\\AppData\\Local\\node-gyp\\Cache\\20.16.0\\include\\node\\common.gypi',

Expected result

I expect the build to succeed, like it did up until v7.22.2. In 7.23.0, the Signal team updated @signalapp/better-sqlite3 to 8.8.1, which broke the build.

Actual result

The build fails with the error reported above.

Screenshots

No response

Signal version

7.22.2

Operating system

Windows 11

Version of Signal on your phone

No response

Link to debug log

No response

scottnonnenberg-signal commented 2 months ago

We need to wait for sqlcipher to pick up sqlite updates, so it may be a while.

In the meantime, what version of visual studio tooling do you have on your windows machine?

Lastly, I'm going to close this since issues in this repository are focused on the user experience, not the developer experience.