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 node-gyp to 7.0.0 #8216

Merged
merged 2 commits into from
Aug 12, 2020

Conversation

adamretter
Copy link
Contributor

@adamretter adamretter commented Jul 21, 2020

What it does

Fixes: #8332

Updates the version of node-gyp to 7.0.0 to resolve issues with compilation on macOS Catalina. Also resolves issues with compilation when using Python3.

The related discussion is here - #7349 (comment)

How to test

Run the CI.

Review checklist

Reminder for reviewers

@adamretter adamretter marked this pull request as draft July 21, 2020 15:37
@adamretter adamretter force-pushed the update-node-gyp branch 2 times, most recently from fae4530 to 2058164 Compare July 21, 2020 18:30
@vince-fugnitto vince-fugnitto added the dependencies pull requests that update a dependency file label Jul 21, 2020
@adamretter adamretter marked this pull request as ready for review July 21, 2020 20:34
@adamretter
Copy link
Contributor Author

@kittaakos Here is the PR for updating node-gyp that I promised.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@adamretter thank you for the changes, I have a few comments regarding the pull-request:

Can you be please sure to squash your commits when you are satisfied for a review.
In general we request that a pull-request includes a single commit unless it can be broken down logically.

I don't think the extra builds are necessary (2x from previously) and overall it only makes CI and development slower.
There was an original comment made on the issue regarding this point:

I will send a separate PR to increase the number of your Travis CI jobs
Watch out, that might get rejected as we do not want to unnecessarily increase the build time.

If such CI tests are useful for your use-cases, you can include them in your own pipelines but for the overall project it might not be the case, and due to shared resources it will actually slow down development.

@vince-fugnitto vince-fugnitto added the ci issues related to CI / tests label Jul 21, 2020
@kittaakos
Copy link
Contributor

Here is the PR for updating node-gyp that I promised.

Thank you, @adamretter. @marechal-p, can you please help with the review? No hurry though, the PR should be on hold until 30.7.

@duncdrum
Copy link

@vince-fugnitto currently Theia has a hard dependency on EOL python2, and so do all downstream devs. This PR introduces the possibility to drop python2 and use python3. I see value in theia actually running tests for both python versions here, at least until the transition from 2 to 3 is deemed complete.

@adamretter
Copy link
Contributor Author

adamretter commented Jul 22, 2020

Can you be please sure to squash your commits when you are satisfied for a review.
In general we request that a pull-request includes a single commit unless it can be broken down logically.

@vince-fugnitto Sure of course, I wanted to keep it fat until I got some feedback. As it is easier to remove a commit than edit existing commits.

I don't think the extra builds are necessary (2x from previously) and overall it only makes CI and development slower.

I fear without the CI tests you will have regressions. At the moment Theia does not build on all platforms with both Python 2 and 3, as a project you might not have been aware of that as you don't have appropriate CI tests for that.
This PR fixes that issue and adds tests to prove it is working. If you want to keep both Python 2 and 3 compatibility, I think you must have tests for that, otherwise you can't know if it is working. Otherwise, do you just want to move to Python 3? It's an option but there are a lot of installed Python2 bases out there!

@adamretter
Copy link
Contributor Author

No hurry though, the PR should be on hold until 30.7.

@kittaakos Does this mean that this PR will not be in the next release? I was really hoping that it would so that updating to the next release will fix the problems we have been experiencing.

@kittaakos
Copy link
Contributor

@kittaakos Does this mean that this PR will not be in the next release?

Correct. You can try to find someone for the review and the verifications, but probably this change won't make it to the next release. As a workaround, you can use resolutions.

@vince-fugnitto
Copy link
Member

vince-fugnitto commented Jul 22, 2020

@adamretter @duncdrum a compromise would be to include one new job which targets python3 so we can test for regressions, but now we have double the jobs straining the CI resources and also making development much slower. We also have theia-apps where CI is run if you're interested in including tests there.

I also don't expect regressions since packages will slowly phase python2 which is EOL.
node-gyp did not support python2 previously and now that it has been updated why do we expect that this will regress?

@kittaakos Does this mean that this PR will not be in the next release? I was really hoping that it would so that updating to the next release will fix the problems we have been experiencing.

If the node-gyp update is critical for the release, you can open a pull-request or update this one which only updates the dependency and I'd be happy to try and review it before the release.


cc @marcdumais-work what do you think of doubling all our CI jobs to test python3.

@adamretter
Copy link
Contributor Author

adamretter commented Jul 22, 2020

@adamretter @duncdrum a compromise would be to include one new job which targets python3 so we can test for regressions, but now we have double the jobs straining the CI resources and also making development much slower. We also have theia-apps where CI is run if you're interested in including tests there.

You previously had 4 jobs, I only added 2 more... so not quite double ;-) Regardless, I agree a compromise would be to only test Python 3 on either Linux or Mac, and I can make that the case if you like. It is worth being aware perhaps that we saw different issues on each of those platforms in our testing (before this PR). Let me know if you would like me to reduce the 2 jobs to 1, and if so, should I test for Python3 on Linux or Mac?

I also don't expect regressions since packages will slowly phase python2 which is EOL.
node-gyp did not support python2 previously and now that it has been updated why do we expect that this will regress?

I think you mean "node-gyp DID support"? I guess I am cautious, in my experience things do break upstream when you don't expect them - so I tend to add plenty of CI to ensure no regressions.

If the node-gyp update is critical for the release, you can open a pull-request or update this one which only updates the dependency and I'd be happy to try and review it before the release.

Hopefully if you can advise on the CI issue, and we make the changes, then this can be that PR ;-) Also it's not neccessarily critical as kittaakos pointed out, we can use the resolutions element in the mean time.

@vince-fugnitto
Copy link
Member

vince-fugnitto commented Jul 22, 2020

@adamretter @duncdrum a compromise would be to include one new job which targets python3 so we can test for regressions, but now we have double the jobs straining the CI resources and also making development much slower. We also have theia-apps where CI is run if you're interested in including tests there.

You previously had 4 jobs, I only added 2 more... so not quite double ;-) Regardless, I agree a compromise would be to only test Python 3 on either Linux or Mac, and I can make that the case if you like. It is worth being aware perhaps that we saw different issues on each of those platforms in our testing (before this PR). Let me know if you would like me to reduce the 2 jobs to 1, and if so, should I test for Python3 on Linux or Mac?

We have 4 jobs temporarily at the moment (until node 10 is dropped), but with these changes we've increased to 5 always (reason I was hesitant due to resources and development time). I'll leave others like @marcdumais-work @svenefftinge to make that decision as I shared my opinion for now, I don't think we should increase the number of jobs.

The total CI time increased from 1 hr 38 min 34 sec (master) to 2 hrs 21 min 55 sec (if the jobs are all counted).

@kittaakos
Copy link
Contributor

It is worth being aware perhaps that we saw different issues on each of those platforms in our testing

Building or testing? I thought you had an issues with rebuilding the natives.

@duncdrum
Copy link

duncdrum commented Jul 22, 2020

@kittaakos building, node-gyp has some known oddities and reported issues with different macOS releases. On a clean system / VMs these are easy to avoid, but on real world systems where ppl have other python or node projects it can become messy very quickly.

@kittaakos
Copy link
Contributor

@kittaakos building, node-gyp has some known oddities and reported issues with different macOS releases.

I see; we can run the build with different Python versions if the community agrees, but not the tests. I do not want to test Python2, or Python3, or node-gyp. Do I overlook something?

@adamretter
Copy link
Contributor Author

@kittaakos The issues were when building Theia using node-gyp and different Python versions and different platforms.

The problem was not so much node-gyp - but Theia's use of a very old node-gyp.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I ran a license compatibility check for the updated node-gyp dependency based on our documented steps and everything looks good from that point of view 👍

For the case of the additional jobs, I think a single new linux job (to test building with python3) would be sufficient at this time. I'll open an issue to phase out support for EOL python2 which we can then use to update the CI jobs and documentation to only use python3. For the new job, we should only run the build however and not the test suite as Akos previously mentioned.

@adamretter
Copy link
Contributor Author

@vince-fugnitto Okay cool thanks. I have pushed that now.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

A couple of things:

.travis.yml Outdated
@@ -114,18 +115,38 @@ jobs:
fast_finish: true
include:
- stage: test
name: Ubuntu 16.04 / NodeJS 10 / Python 2
Copy link
Member

Choose a reason for hiding this comment

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

I think simpler names for all the jobs would be sufficient and better as they will be less likely subject to change (since travis controls the default operating system version and it can be updated in the future). In addition, most of the information added to the build name is already displayed:

Screen Shot 2020-07-25 at 1 02 38 PM

Something like (Linux - Python2) can be sufficient.

@adamretter
Copy link
Contributor Author

@vince-fugnitto I think I have addressed your suggestions now - let me know if any more changes are needed. Thanks

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@vince-fugnitto I think I have addressed your suggestions now - let me know if any more changes are needed. Thanks

The following comment hasn't been resolved in the latest changes: #8216 (comment).
In addition, it looks like the mac build was bumped to use node 12 in this pull-request, what is the reason behind it?

.travis.yml Outdated
dist: xenial
node_js: 12
- stage: test
name: Ubuntu / Node 12 / Python 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor (optional): reflect in the job name that this one only builds (no tests)?

Copy link
Contributor

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @adamretter.

I added one small comment, about one of the job's names, that I do not care about strongly enough to block merging - you may address it if you happen to agree.

@vince-fugnitto
Copy link
Member

@adamretter sorry, I wasn't notified of the recent changes, do you mind rebasing the pull-request to resolve the conflict and I'll merge?

semver "~5.3.0"
tar "^2.0.0"
which "1"

node-gyp@^6.0.1:
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we still have node-gyp 6.

Signed-off-by: Adam Retter <adam.retter@googlemail.com>
Signed-off-by: Adam Retter <adam.retter@googlemail.com>
@adamretter
Copy link
Contributor Author

@vince-fugnitto I have now rebased this onto master as requested.

@akosyakov I notice that there us dependency on electron-rebuild, which itself also has a dependency on node-gyp 6. I have sent a PR also to that project to resolve that - electron/rebuild#379. In the meantime should I override the dependency from electron-rebuild? or wait for a new release of that project?

@akosyakov
Copy link
Member

I see I think you can go on as is if it solves your issues and send another PR when electron builder is upgraded.

@adamretter
Copy link
Contributor Author

@akosyakov okay great, so this is ready to merge then?

@marcdumais-work
Copy link
Contributor

Ci for Mac had failed, because of a problem with vscode-ripgrep, that seems unrelated to this PR.I have restarted that build.

@akosyakov
Copy link
Member

@vince-fugnitto @marcdumais-work Can you merge when you think it is fine?

@marcdumais-work
Copy link
Contributor

Just to be safe, I pushed a copy of this PR on my fork and will let CI do its work there. With the benefit of a configured GH token, I hope CI will pass and confirm the PR is ok.

@marcdumais-work
Copy link
Contributor

Mac CI passed on my fork: https://travis-ci.org/github/marcdumais-work/theia/jobs/717297793, so I think we're good here.
Merging.

@marcdumais-work marcdumais-work merged commit 67e466c into eclipse-theia:master Aug 12, 2020
@adamretter
Copy link
Contributor Author

Thanks everybody :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci issues related to CI / tests dependencies pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node-gyp@3.8.0 outmoded in yarn.lock and cause an error
6 participants