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

dependency: [WIP] Update Electron to 34 #31260

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ mainBuildFilters: &mainBuildFilters
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'ryanm/chore/add_internal_studio'
- 'electron-34'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -50,7 +51,8 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/fix-binary-due-to-proxy-from-env', << pipeline.git.branch >> ]
- equal: [ 'feat/implement_bidi', << pipeline.git.branch >> ]
- equal: [ 'electron-34', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -84,7 +86,8 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'ryanm/chore/fix-binary-due-to-proxy-from-env', << pipeline.git.branch >> ]
- equal: [ 'feat/implement_bidi', << pipeline.git.branch >> ]
- equal: [ 'electron-34', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -93,7 +96,7 @@ executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/base-internal:20.18.1-bullseye
- image: cypress/base-internal:20.18.3-bullseye
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
Expand All @@ -102,7 +105,7 @@ executors:

kitchensink-executor:
docker:
- image: cypress/base-internal:20.18.1-bullseye
- image: cypress/base-internal:20.18.3-bullseye
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
Expand All @@ -112,7 +115,7 @@ executors:
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/base-internal:20.18.1-bullseye
- image: cypress/base-internal:20.18.3-bullseye
user: node
environment:
PLATFORM: linux
Expand Down Expand Up @@ -160,7 +163,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/chore/fix-binary-due-to-proxy-from-env" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "electron-34" ]]; then
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
Expand Down Expand Up @@ -625,7 +628,7 @@ commands:
apt update && apt install -y docker.io
docker run -d --name better-sqlite3-builder cypress/base-internal:20.15.0-buster-python3.8-gcc-10.5 /bin/bash -c "sleep 1000000000"
docker cp ~/cypress/node_modules/better-sqlite3 better-sqlite3-builder:/better-sqlite3
docker exec -it better-sqlite3-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 33.2.1 --include-regex 'better_sqlite3.node$'"
docker exec -it better-sqlite3-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 34.3.3 --include-regex 'better_sqlite3.node$'"
docker cp better-sqlite3-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
docker rm -f better-sqlite3-builder
cp ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/better_sqlite3.node
Expand Down Expand Up @@ -1953,7 +1956,7 @@ jobs:
working_directory: ~/cypress
docker:
# we need an image with yarn 4 berry installed on it to run this test
- image: cypress/base-internal:20.18.1-yarn-berry
- image: cypress/base-internal:20.18.3-yarn-berry
environment:
# needed to inform the bootstrap-docker-container.sh script to link the binary in the system-test project directory
REPO_DIR: /root/cypress
Expand Down Expand Up @@ -1987,7 +1990,7 @@ jobs:
parallelism: 1
working_directory: ~/cypress
docker:
- image: cypress/base-internal:20.18.1-bullseye
- image: cypress/base-internal:20.18.3-bullseye
environment:
# needed to inform the bootstrap-docker-container.sh script to link the binary in the system-test project directory
REPO_DIR: /root/cypress
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.1
placeholder: ex. v20.18.3
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-memory-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.1
placeholder: ex. v20.18.3
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3-install-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v20.18.1
placeholder: ex. v20.18.3
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.1
20.18.3
10 changes: 10 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 14.2.1

_Released 3/25/2025 (PENDING)_

**Dependency Updates:**

- Upgraded `electron` from `33.2.1` to `34.3.3`. Addresses [#31245](https://github.com/cypress-io/cypress/issues/31245). Addressed in [#31260](https://github.com/cypress-io/cypress/pull/31260).
- Upgraded bundled Node.js version from `20.18.1` to `20.18.3`. Addresses [#31245](https://github.com/cypress-io/cypress/issues/31245). Addressed in [#31260](https://github.com/cypress-io/cypress/pull/31260).
- Upgraded bundled Chromium version from `130.0.6723.137` to `132.0.6834.210`. Addresses [#31245](https://github.com/cypress-io/cypress/issues/31245). Addressed in [#31260](https://github.com/cypress-io/cypress/pull/31260).

## 14.2.0

_Released 3/12/2025_
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
- .:/opt/cypress
ci:
# This should mirror the image used in workflows.yml
image: cypress/base-internal:20.18.1-bullseye
image: cypress/base-internal:20.18.3-bullseye
ports:
- 5566:5566
- 5567:5567
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"dedent": "^0.7.0",
"del": "3.0.0",
"detect-port": "^1.6.1",
"electron": "33.2.1",
"electron": "34.3.3",
"electron-builder": "^25.1.8",
"enzyme-adapter-react-16": "1.12.1",
"eslint": "^8.56.0",
Expand Down Expand Up @@ -214,7 +214,7 @@
"yarn-deduplicate": "3.1.0"
},
"engines": {
"node": ">=20.18.1",
"node": ">=20.18.3",
"yarn": ">=1.22.22"
},
"productName": "Cypress",
Expand Down Expand Up @@ -279,6 +279,7 @@
"@types/react": "18.3.12",
"browserify-sign": "4.2.2",
"devtools-protocol": "0.0.1413303",
"node-abi": "3.74.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sharp": "0.29.3",
"vue-template-compiler": "2.6.12"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/data-context/src/data/ProjectConfigIpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ export class ProjectConfigIpc extends EventEmitter {
// If they've got TypeScript installed, we can use
// ts-node for CommonJS
// ts-node/esm for ESM
if (hasTypeScriptInstalled(this.projectRoot)) {
// If we're in a cy in cy project, we will handle registering typescript directly in the server entry point
if (!process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT && hasTypeScriptInstalled(this.projectRoot)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Electron must have changed something with their spawn call. We're unsure what, but when cy-in-cy all of this logic is unnecessary.

debug('found typescript in %s', this.projectRoot)
if (isProjectUsingESModules) {
debug(`using --experimental-specifier-resolution=node with --loader ${tsNodeEsm}`)
Expand Down
9 changes: 9 additions & 0 deletions packages/electron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ Upgrading `electron` involves more than just bumping this package's `package.jso

*Solution*: This is often due to a mismatched prebuild of `better-sqlite3`. Ensure your repository is clear of untracked files with `git clean -xfd`, and run `yarn` again. If the issue persists, ensure you are running the latest version of your operating system. Electron prebuilds key to darwin/linux/windows, and do not differentiate between versions of the same.

#### node-abi out of date

If you run into an error like below, please try some of the strategies below.

```shell
Could not detect abi for version X.X.X and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
```

*Solution*: See if there's a new version of `@electron/rebuild` with a newer version of `node-abi` within it. If there is not a newer version, find the [latest release](https://github.com/electron/node-abi/releases) of `node-abi` that has an updated ABI registry with an `abi` entry matching the major version of Electron that you're updating to. Set this `node-abi` version in the `resolutions` of our [package.json](./package.json) file and rerun `yarn`.
2 changes: 1 addition & 1 deletion scripts/binary/trigger-publish-binary-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { getNextVersionForBinary } = require('../get-next-version')
job_name: process.env.CIRCLE_JOB,
triggered_workflow_id: process.env.CIRCLE_WORKFLOW_ID,
triggered_job_url: process.env.CIRCLE_BUILD_URL,
branch: process.env.CIRCLE_BRANCH,
branch: 'electron-34',
should_persist_artifacts: Boolean(process.env.SHOULD_PERSIST_ARTIFACTS),
binary_version: nextVersion,
},
Expand Down
2 changes: 1 addition & 1 deletion system-tests/test-binary/module_api_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import systemTests from '../lib/system-tests'
describe('module API', () => {
systemTests.it('can run module API Mocha spec', {
timeout: 240000,
dockerImage: 'cypress/base-internal:20.18.1-bullseye',
dockerImage: 'cypress/base-internal:20.18.3-bullseye',
withBinary: true,
project: 'module-api',
browser: 'electron',
Expand Down
23 changes: 8 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15035,10 +15035,10 @@ electron-to-chromium@^1.5.4:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6"
integrity sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==

electron@33.2.1:
version "33.2.1"
resolved "https://registry.yarnpkg.com/electron/-/electron-33.2.1.tgz#d0d7bba7a7abf4f14881d0a6e03c498b301a2d5f"
integrity sha512-SG/nmSsK9Qg1p6wAW+ZfqU+AV8cmXMTIklUL18NnOKfZLlum4ZsDoVdmmmlL39ZmeCaq27dr7CgslRPahfoVJg==
electron@34.3.3:
version "34.3.3"
resolved "https://registry.yarnpkg.com/electron/-/electron-34.3.3.tgz#2979329d182a195756bfbf6e5687a835cd65a2ec"
integrity sha512-7m1FiO1mwc1K/UqqnnkG7Ik/kAngDzmLfHwcl+xaWgCQ+Sts9rlEqzOh6g1GHhDqebrbs4bO/aU+NDi32fCciQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^20.9.0"
Expand Down Expand Up @@ -23607,17 +23607,10 @@ [email protected]:
lodash "^4.17.21"
propagate "^2.0.0"

node-abi@^2.7.0:
version "2.30.1"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.30.1.tgz#c437d4b1fe0e285aaf290d45b45d4d7afedac4cf"
integrity sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==
dependencies:
semver "^5.4.1"

node-abi@^3.3.0, node-abi@^3.45.0:
version "3.68.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.68.0.tgz#8f37fb02ecf4f43ebe694090dcb52e0c4cc4ba25"
integrity sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==
[email protected], node-abi@^2.7.0, node-abi@^3.3.0, node-abi@^3.45.0:
version "3.74.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.74.0.tgz#5bfb4424264eaeb91432d2adb9da23c63a301ed0"
integrity sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==
dependencies:
semver "^7.3.5"

Expand Down
Loading