Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuild compilation error on win32-arm64 + Electron v25 #1192

Closed
mceachen opened this issue May 30, 2024 · 9 comments
Closed

Prebuild compilation error on win32-arm64 + Electron v25 #1192

mceachen opened this issue May 30, 2024 · 9 comments
Labels
flaky-release Issues from GHA not completing prebuilds

Comments

@mceachen
Copy link
Member

mceachen commented May 30, 2024

See https://github.com/WiseLibs/better-sqlite3/actions/runs/9306758002/job/25616996400#step:10:742 👍

...\sqlite3.c(24890,1): error C2099: initializer is not a constant [D:\a\better-sqlite3\better-sqlite3\build\deps\sqlite3.vcxproj]

I think we should drop Electron v25: it went EOL 2023-12-05.

@mceachen
Copy link
Member Author

@JoshuaWise @m4heshd

@m4heshd
Copy link
Contributor

m4heshd commented May 30, 2024

@mceachen I 100% agree on this one. As we discussed on #1061, it's a good idea to constrain building only against actively maintained (and possibly LTS) runtime versions.

For Electron, I think we can keep building for versions that internally carry any actively maintained Node runtime. Thoughts?

@lyswhut
Copy link

lyswhut commented Jun 1, 2024

Same problem: win32-arm64 + electron v28.3.3
See: https://github.com/lyswhut/lx-music-desktop/actions/runs/9327617969/job/25677745831#step:9:39

This problem appeared in better-sqlite3 v10.1.0

@dennisameling
Copy link

I'm running into the same issue with Node 20, Electron 30 on Windows arm64:

  • Electron 30.0.9
  • Node 20.14.0
  • Windows 11 22631.3593
  • VS2022 (17.9.34728.123)
Logs
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild --release
npm error copy_builtin_sqlite3
npm error   sqlite3.c
npm error C:\repos\Mailspring\app\node_modules\better-sqlite3\build\Release\obj\global_intermediate\sqlite3\sqlite3.c(24885,3): error C2099: initializer is not a constant [C:\repos\Mailspring\app\node_modules\better-sqlite3\build\deps\sqlite3.vcxproj]
npm error prebuild-install warn install No prebuilt binaries found (target=20.14.0 runtime=node arch=arm64 libc= platform=win32)
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.14.0 | win32 | arm64
npm error gyp info find Python using Python version 3.11.2 found at "C:\Program Files\Python311-arm64\python.exe"
npm error gyp info find VS using VS2022 (17.9.34728.123) 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:\Program Files\Python311-arm64\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\\repos\\Mailspring\\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\\Mailspring\\app\\node_modules\\better-sqlite3\\build\\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\repos\\Mailspring\\node_modules\\node-gyp\\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\denni\\AppData\\Local\\node-gyp\\Cache\\20.14.0\\include\\node\\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\\Users\\denni\\AppData\\Local\\node-gyp\\Cache\\20.14.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\\repos\\Mailspring\\node_modules\\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\denni\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.14.0\\\\<(target_arch)\\\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\\repos\\Mailspring\\app\\node_modules\\better-sqlite3',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\\repos\\Mailspring\\app\\node_modules\\better-sqlite3\\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\arm64\MSBuild.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'build\\binding.sln',
npm error gyp info spawn args '/clp:Verbosity=minimal',
npm error gyp info spawn args '/nologo',
npm error gyp info spawn args '/p:Configuration=Release;Platform=ARM64'
npm error gyp info spawn args ]
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\arm64\MSBuild.exe` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess. (C:\repos\Mailspring\node_modules\node-gyp\lib\build.js:209:23)
npm error gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Windows_NT 10.0.22631
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\repos\\Mailspring\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm error gyp ERR! cwd C:\repos\Mailspring\app\node_modules\better-sqlite3
npm error gyp ERR! node -v v20.14.0
npm error gyp ERR! node-gyp -v v10.0.1
npm error gyp ERR! not ok

@mceachen mceachen added the flaky-release Issues from GHA not completing prebuilds label Jun 11, 2024
@mceachen
Copy link
Member Author

Closing: we dropped support for electron v25.

@lyswhut
Copy link

lyswhut commented Jun 12, 2024

#1190 breaks the windows arm64 build, which seems to be unrelated to the electron version

@lyswhut
Copy link

lyswhut commented Jun 12, 2024

I looked into this, fixing it just required:

https://github.com/WiseLibs/better-sqlite3/pull/1190/files#diff-6af30c2dc0128235d0cd2c871adf4d8d2b9b835c54546278e335bba102fa5df0R24880-R24892

static const struct {
  u8 nName;           /* Length of the name */
  char zName[7];      /* Name of the transformation */
  float rLimit;       /* Maximum NNN value for this transform */
  float rXform;       /* Constant used for this transform */
} aXformType[] = {
  /* 0 */ { 6, "second",   4.6427e+14,         1.0  },
  /* 1 */ { 6, "minute",   7.7379e+12,        60.0  },
  /* 2 */ { 4, "hour",     1.2897e+11,      3600.0  },
  /* 3 */ { 3, "day",      5373485.0,      86400.0  },
-  /* 4 */ { 5, "month",    176546.0,  30.0*86400.0  },
-  /* 5 */ { 4, "year",     14713.0,  365.0*86400.0  },
+  /* 4 */ { 5, "month",    176546.0,     2592000.0  },
+  /* 5 */ { 4, "year",     14713.0,     31536000.0  },

};

image

@mceachen
Copy link
Member Author

Unfortunately, that file is overwritten by the SQLite tarball -- so applying that diff would require running something like patch in the update script.

@lyswhut
Copy link

lyswhut commented Jun 13, 2024

This has already been fixed upstream, looks like we just have to wait...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-release Issues from GHA not completing prebuilds
Development

No branches or pull requests

4 participants