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

electron-rebuild better-sqlite3 deprecation warnings starting with v13.2.0 #27891

Closed
MikeMcC399 opened this issue Sep 24, 2023 · 2 comments · Fixed by #27968
Closed

electron-rebuild better-sqlite3 deprecation warnings starting with v13.2.0 #27891

MikeMcC399 opened this issue Sep 24, 2023 · 2 comments · Fixed by #27968

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Sep 24, 2023

Current behavior

Building Cypress from source with yarn results in multiple deprecation and other warnings such as V8_DEPRECATED at the step:

electron-rebuild -o better-sqlite3

This is a regression compared to Cypress v13.1.0.

Desired behavior

The current default branch https://github.com/cypress-io/cypress should install without deprecation and other warnings and produce output similar to

$ electron-rebuild -o better-sqlite3
✔ Rebuild Complete

as was the case in Cypress 13.1.0 before the Electron upgrade from 21.0.0 to 25.8.0 in Cypress 13.2.0.

Test code to reproduce

Prerequisites

npm install yarn@latest -g
sudo apt install g++ make cmake

Execute

git clone https://github.com/cypress-io/cypress
cd cypress

git checkout v13.1.0
n auto # or similar to set node to 16.16.0
yarn # no issue with electron-rebuild -o better-sqlite3

git checkout v13.2.0
n auto # or similar to set node to 18.15.0
yarn # multiple deprecation warnings for electron-rebuild -o better-sqlite3

git checkout develop
n auto # or similar to set node to 18.15.0
git clean -x -d -f
yarn # multiple deprecation warnings also for develop branch

Cypress Version

First reported on version: 13.2.0
Reproducible also on version: 13.3.0

Node version

18.15.0

Operating System

Ubuntu 22.04.3 LTS

Debug Logs

$ electron-rebuild -o better-sqlite3
⠦ Building module: better-sqlite3, Completed: 0make: Entering directory '/home/mike/github/cypress-io/cypress/node_modules/better-sqlite3/build'
  TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
⠇ Building module: better-sqlite3, Completed: 0  TOUCH Release/obj.target/deps/locate_sqlite3.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
⠦ Building module: better-sqlite3, Completed: 0  AR(target) Release/obj.target/deps/sqlite3.a
  COPY Release/sqlite3.a
⠧ Building module: better-sqlite3, Completed: 0  CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
⠼ Building module: better-sqlite3, Completed: 0In file included from /home/mike/.electron-gyp/25.8.1/include/node/v8-object.h:10,
                 from /home/mike/.electron-gyp/25.8.1/include/node/v8-array-buffer.h:13,
                 from /home/mike/.electron-gyp/25.8.1/include/node/v8.h:24,
                 from /home/mike/.electron-gyp/25.8.1/include/node/node.h:79,
                 from ./src/better_sqlite3.lzz:11,
                 from ../src/better_sqlite3.cpp:4:
/home/mike/.electron-gyp/25.8.1/include/node/v8-persistent-handle.h:245:44: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
  245 |   using CopyablePersistent = Persistent<T, CopyablePersistentTraits<T>>;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/.electron-gyp/25.8.1/include/node/v8-persistent-handle.h:244:48: note: declared here
  244 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
⠧ Building module: better-sqlite3, Completed: 0In file included from ../src/better_sqlite3.cpp:4:
./src/util/macros.lzz:31:69: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
In file included from /home/mike/.electron-gyp/25.8.1/include/node/v8-object.h:10,
                 from /home/mike/.electron-gyp/25.8.1/include/node/v8-array-buffer.h:13,
                 from /home/mike/.electron-gyp/25.8.1/include/node/v8.h:24,
                 from /home/mike/.electron-gyp/25.8.1/include/node/node.h:79,
                 from ./src/better_sqlite3.lzz:11,
                 from ../src/better_sqlite3.cpp:4:
/home/mike/.electron-gyp/25.8.1/include/node/v8-persistent-handle.h:244:48: note: declared here
  244 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
⠇ Building module: better-sqlite3, Completed: 0In file included from ./src/better_sqlite3.lzz:11,
                 from ../src/better_sqlite3.cpp:4:
/home/mike/.electron-gyp/25.8.1/include/node/node.h:1013:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to ‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)’} [-Wcast-function-type]
 1013 |       (node::addon_context_register_func) (regfunc),                  \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/.electron-gyp/25.8.1/include/node/node.h:1031:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
 1031 |   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mike/.electron-gyp/25.8.1/include/node/node.h:1062:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
 1062 |   NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,                     \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
./src/objects/database.lzz: In static member function ‘static void Database::JS_new(const v8::FunctionCallbackInfo<v8::Value>&)’:
./src/objects/database.lzz:180:21: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
⠹ Building module: better-sqlite3, Completed: 0./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
./src/util/data.lzz:73:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:73:197: note: here
./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
./src/util/data.lzz:77:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:77:175: note: here
⠋ Building module: better-sqlite3, Completed: 0  SOLINK_MODULE(target) Release/obj.target/better_sqlite3.node
⠙ Building module: better-sqlite3, Completed: 0  COPY Release/better_sqlite3.node
⠹ Building module: better-sqlite3, Completed: 0  CC(target) Release/obj.target/test_extension/deps/test_extension.o
⠸ Building module: better-sqlite3, Completed: 0  SOLINK_MODULE(target) Release/obj.target/test_extension.node
  COPY Release/test_extension.node
rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
make: Leaving directory '/home/mike/github/cypress-io/cypress/node_modules/better-sqlite3/build'
✔ Rebuild Complete

Other

Versions

  • electron@25.8.1
  • better-sqlite3@8.2.0

Suggestions

It seems that a minimum of better-sqlite3@8.5.0 would be needed. The latest version for consideration is currently better-sqlite3@8.6.0.

better-sqlite3/releases/tag/v8.5.0 mentions "Add support for electron v25 prebuilds". This is the version of Electron bundled with Cypress 13.2.0.

@MikeMcC399
Copy link
Contributor Author

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2023

Released in 13.3.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.3.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant