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

Update to minimum node-gyp 9.1 for build on Windows #28766

Closed
MikeMcC399 opened this issue Jan 22, 2024 · 6 comments
Closed

Update to minimum node-gyp 9.1 for build on Windows #28766

MikeMcC399 opened this issue Jan 22, 2024 · 6 comments
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase

Comments

@MikeMcC399
Copy link
Contributor

What would you like?

Enable building Cypress from source on Windows with [email protected] or later when executing yarn on this repository according to CONTRIBUTING > Getting Started.

Why is this needed?

node-gyp recommends for Windows:

Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" if using a version older than VS2019, otherwise use "Desktop development with C++" workload) or Visual Studio Community (using the "Desktop development with C++" workload)

  • Following on from issue node-gyp build error "missing any Windows SDK" #28703, in order to build Cypress from source on Windows 10 or Windows 11, the Windows 10 SDK of Visual Studio C++ environment must be installed. If the instructions from node-gyp are followed to the letter, then only the Windows 11 SDK is installed by default on Windows 10 or Windows 11. The Cypress build uses [email protected] and fails with the error:

    stack Error: Could not find any Visual Studio installation to use

  • The workaround is to additionally install a Windows 10 SDK which allows node-gyp to recognize that Visual Studio is installed.

  • A more solid resolution (as opposed to a workaround) is to allow building Cypress from source using a version of [email protected] or higher which includes support for recognizing the presence of a Windows 11 SDK.

Other

The version of node-gyp used is not explicitly specified by Cypress. It is dependent on the versions of other npm modules installed such as semantic-release and lerna.

Note that this enhancement request is not sufficient to support building with Python 3.12. This would require a minimum of [email protected] which takes care of the removal of distutils in Python 3.12.

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

Cypress has made some progress towards node-gyp 9.1 as minimum.

The current minimum version used is [email protected] in [email protected]:

$ yarn why node-gyp
yarn why v1.22.22
[1/4] Why do we have the module "node-gyp"...?
[2/4] Initialising dependency graph...
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "[email protected]"
warning Resolution field "[email protected]" is incompatible with requested version "pretty-format@^27.0.2"
warning Resolution field "[email protected]" is incompatible with requested version "vue-template-compiler@^2.7.14"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "node-gyp"
info Reasons this module exists
   - "workspace-aggregator-8230f893-66cd-428f-855e-4413c39e4f0c" depends on it
   - Hoisted from "_project_#@packages#server#@electron#rebuild#node-gyp"
   - Hoisted from "_project_#lerna#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@lerna#legacy-package-management#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@npmcli#arborist#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#pacote#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#@cypress#schematic#@angular#cli#pacote#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@lerna#legacy-package-management#@npmcli#arborist#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@lerna#create#pacote#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@lerna#legacy-package-management#pacote#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@npmcli#arborist#@npmcli#metavuln-calculator#pacote#@npmcli#run-script#node-gyp"
   - Hoisted from "_project_#lerna#@lerna#legacy-package-management#@npmcli#arborist#@npmcli#metavuln-calculator#pacote#@npmcli#run-script#node-gyp"
info Disk size without dependencies: "3.42MB"
info Disk size with unique dependencies: "8.92MB"
info Disk size with transitive dependencies: "15.25MB"
info Number of shared dependencies: 81
=> Found "@npmcli/run-script#[email protected]"
info This module exists because "_project_#@npmcli#run-script" depends on it.
info Disk size without dependencies: "2.54MB"
info Disk size with unique dependencies: "6.15MB"
info Disk size with transitive dependencies: "11.69MB"
info Number of shared dependencies: 58
=> Found "npm#[email protected]"
info This module exists because "_project_#semantic-release#@semantic-release#npm#npm" depends on it.
info Disk size without dependencies: "1.79MB"
info Disk size with unique dependencies: "5.39MB"
info Disk size with transitive dependencies: "10.93MB"
info Number of shared dependencies: 58

@jennifer-shehane
Copy link
Member

@MikeMcC399 I feel like this changes in our Electron 29 branch - there was some battles we were having with node-gyp but I can't remember where it landed.

@MikeMcC399
Copy link
Contributor Author

@MikeMcC399
Copy link
Contributor Author

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 16, 2025

Released in 14.0.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
OS: windows process: contributing Related to contributing to the Cypress codebase
Projects
None yet
Development

No branches or pull requests

3 participants