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

gyp: fix XCode CLT version detection on Catalina #2141

Closed

Conversation

szekelyisz
Copy link

@szekelyisz szekelyisz commented May 26, 2020

Since Catalina XCode Command Line Tools don't show up among installed packages,
which breaks version detection in gyp/pylib/gyp/xcode_emulation.py.

The workaround is to remove the CLT installation directory, and run
xcode-select --install which reinstalls an older version of CLT. This older
version will eventually be upgraded by Software Update, which breaks gyp again.

Checklist
Description of change

This patch adds a fallback mechanism to detect newer CLT versions based on
software update history.

XCode Command line Tools no longer show up as packages on Catalina,
which breaks CLT version detection in gyp/pylib/gyp/xcode_emulation.py.

A workaround is to remove the CLT installation directory and reinstall
it using `xcode-select --install` which will download and install an
older version. But this will eventually be upgraded by Software Update
which breaks detection again.

This patch adds a fallback mechanism to detect CLT version based on
software update history.

Refs: nodejs#1927
Refs: nodejs#1861
@jkroepke
Copy link

After every CLT upgrade on 10.15, I have to reinstall Command Line Tools.

Please merge and release this, soon.

@richardlau
Copy link
Member

Since we vendor in gyp from https://github.com/nodejs/gyp-next this should really land there.

@cclauss
Copy link
Contributor

cclauss commented May 28, 2020

Can we please delete the code from this repository that we vendor in from some other repository?

@rvagg
Copy link
Member

rvagg commented May 29, 2020

we could use git submodules but they're such a developer-hostile solution that it's usually better to just copy the code

I think we just need to improve our documentation and get more pro-active with pointing people over there when they open a PR here. The code's the same so moving the PR shouldn't be too difficult since you can just copy your edited files.

@jkroepke
Copy link

In times of Github Actions, a bot would help here. If changes are in specific paths, just post a comment about the situation.

@richardlau
Copy link
Member

Unfortunately GitHub Actions running on pull requests from forks do not have permissions to post comments.

@jkroepke
Copy link

Unless you are using a own personal access token.

cclauss added a commit to nodejs/gyp-next that referenced this pull request Jun 2, 2020
@rvagg rvagg closed this Jun 3, 2020
ryzokuken pushed a commit to nodejs/gyp-next that referenced this pull request Jun 5, 2020
* gyp: fix XCode CLT version detection on Catalina

Copies @szekelyisz nodejs/node-gyp#2141 to this repo.

* Regex loves raw strings

* Update pylib/gyp/xcode_emulation.py

Co-authored-by: Michaël Zasso <targos@protonmail.com>

Co-authored-by: Michaël Zasso <targos@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants