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

Can't build v13.0.0+ from source without g++ and make #27846

Closed
alexsch01 opened this issue Sep 19, 2023 · 19 comments · Fixed by #27878
Closed

Can't build v13.0.0+ from source without g++ and make #27846

alexsch01 opened this issue Sep 19, 2023 · 19 comments · Fixed by #27878
Labels
good first issue Good for newcomers topic: installation Issue during installation or downloading Cypress Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.

Comments

@alexsch01
Copy link
Contributor

alexsch01 commented Sep 19, 2023

Current behavior

I ran npm i -g yarn
I ran git clone https://github.com/cypress-io/cypress
I ran cd cypress
I ran yarn

This works for versions v12.17.4 and below, but fails for versions v13.0.0 and up

Debug logs

Without g++ installed

make: g++: No such file or directory

Without make installed

Error: not found: make

Cypress Version

develop - 2247ffd

Node version

v18.18.0

Package Manager

yarn

Package Manager Version

1.22.19

Operating system

Linux

Operating System Version

  • Operating System: Debian GNU/Linux 11 (bullseye)
  • Kernel: Linux 5.15.124-20260-g158060cabb35
  • Architecture: x86-64

Non-documented fix

Installing g++ and make packages seem to be required as of v13.0.0 in order to build Cypress from source - this was not the case with v12.17.4 and earlier versions

Other

If the above packages are intended to be required now, the CONTRIBUTING file should be updated to state this

@alexsch01 alexsch01 added the topic: installation Issue during installation or downloading Cypress label Sep 19, 2023
@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Sep 19, 2023

Hi @alexsch01

When I set this up for Ubuntu 22.04 I installed:

sudo apt install make
sudo apt install build-essential
sudo apt install cmake

I don't know if this is exactly the same for your OS and if that will help you.

You write Node.js v18.18.0, however it is better to use exactly what is in .node-version i.e. 18.15.0. This is the same version that Electron is built with. If you use n then n auto does it for you - see CONTRIBUTING > Requirements.

$ npx cypress version
Cypress package version: 13.2.0
Cypress binary version: 13.2.0
Electron version: 25.8.0
Bundled Node version:
18.15.0

@MikeMcC399
Copy link
Contributor

I checked on Ubuntu 22.04 and using Node.js 18.18.0 instead of the required 18.15.0 does not affect the ability to build Cypress from source.

@alexsch01
Copy link
Contributor Author

alexsch01 commented Sep 19, 2023

sudo apt install make
sudo apt install build-essential
sudo apt install cmake

@MikeMcC399 This should be in the CONTRIBUTING file if these packages are needed for Cypress to build

This is only an issue since v13.0.0
v12.17.4 doesn't have this behavior

@MikeMcC399
Copy link
Contributor

@alexsch01

Did that solve your issue?

I didn't feel experienced enough to make suggestions to change the CONTRIBUTING > Requirements section in this regard, especially as the Cypress build is very complex and I don't really understand a lot of what it does.

@alexsch01
Copy link
Contributor Author

alexsch01 commented Sep 19, 2023

Yes, it did solve the issue. But this isn't documented in the CONTRIBUTING file @jennifer-shehane

Summary: make, build-essential. and cmake packages seem to be required as of v13.0.0 in order to build Cypress from source - this was not the case with v12.17.4 and earlier versions

@alexsch01 alexsch01 changed the title Can't build Cypress from source Can't build Cypress v13.0.0+ from source without make, build-essential, and cmake Sep 19, 2023
@alexsch01 alexsch01 changed the title Can't build Cypress v13.0.0+ from source without make, build-essential, and cmake Can't build v13.0.0+ from source without make, build-essential, and cmake Sep 19, 2023
@jennifer-shehane
Copy link
Member

@alexsch01 We're open to a PR to update the contributing guide to reflect this.

@nagash77 nagash77 added external: documentation Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. good first issue Good for newcomers labels Sep 21, 2023
@Crustum7
Copy link
Contributor

I can update the contributing guide if nobody else is working on this

@MikeMcC399
Copy link
Contributor

@Crustum7

I can update the contributing guide if nobody else is working on this

I was going to make an attempt, but I'd be happy if you want to do it.

My suggestion would be to add the following to the bottom of the list below python:

  • CMake (for Unix sudo apt install cmake)

as it is not covered by the node-gyp requirements. The list is supposed to be generic and not for a specific operating system, however I think the hint about installing cmake would be OK. On Ubuntu it is also available as a snap package.

CONTRIBUTING > Requirements

@Crustum7
Copy link
Contributor

Thank you @MikeMcC399! That sounds accurate and concise

@alexsch01 alexsch01 changed the title Can't build v13.0.0+ from source without make, build-essential, and cmake Can't build v13.0.0+ from source without g++ and make Sep 22, 2023
@alexsch01 alexsch01 changed the title Can't build v13.0.0+ from source without g++ and make Can't build v13.0.0+ from source without cmake, g++ and make Sep 23, 2023
@alexsch01 alexsch01 changed the title Can't build v13.0.0+ from source without cmake, g++ and make Can't build v13.0.0+ from source without g++ and make Sep 23, 2023
@alexsch01 alexsch01 reopened this Sep 23, 2023
@MikeMcC399
Copy link
Contributor

As far as I can see whilst cross-checking on Ubuntu 22.04, the requirements for modules supporting the use of node-gyp in the build process (yarn install) did not change between Cypress v12.17.4 and v13.0.0. The main problem seems to be that the documentation is not so helpful and could be improved.

make was already recommended through
README > Requirements > node-gyp > On Unix

gcc and make alone are not enough and there is no explicit information in the documentation that you also need g++ and cmake. This is also true for Cypress v12.17.4.

Repro

To demonstrate:

sudo apt remove g++ cmake
sudo apt install gcc make
sudo apt autoremove

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

git checkout v12.17.4
n auto # or similar to set node to 16.16.0
yarn # error messages note that g++ and cmake are missing

git checkout v13.0.0
n auto # or similar to set node to 16.16.0
yarn # error messages note that g++ and cmake are missing

Now run again after executing

sudo apt install g++ cmake

@alexsch01
Copy link
Contributor Author

@MikeMcC399 On Debian, installing cmake will also install make since make is a recommended package - NOT a dependency

On other operating systems like Mac I don't know how that works

@MikeMcC399
Copy link
Contributor

@alexsch01

On Debian, installing cmake will also install make since make is a recommended package

Thank you for that hint. I will suggest a change to the PR in that case.

@alexsch01
Copy link
Contributor Author

@MikeMcC399 I meant that the install command should have g++, make, and cmake for the good path

@MikeMcC399
Copy link
Contributor

@alexsch01

Well I checked:

sudo apt remove g++ gcc cmake make
sudo apt install g++ cmake

and that was OK for yarn install

If you know some reason why:

sudo apt install g++ cmake

is not enough then please let us know.

@alexsch01
Copy link
Contributor Author

Just being more explicit since make is not technically a dependency of cmake

@MikeMcC399
Copy link
Contributor

I've reverted the suggestion to remove make from the command. If you think the PR is now OK, then you could approve it.

@alexsch01
Copy link
Contributor Author

@MikeMcC399 just did, thanks for the reminder

@MikeMcC399
Copy link
Contributor

@jennifer-shehane

We're open to a PR to update the contributing guide to reflect this.

It is suggested to add the following line to the document:

  • Note for Debian-based systems: python is pre-installed.
    sudo apt install g++ make cmake meets the additional requirements to run node-gyp in the context of building Cypress from source

@MikeMcC399
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers topic: installation Issue during installation or downloading Cypress Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
Projects
None yet
5 participants