Skip to content

Commit 606036e

Browse files
authored
ansible: add CLT for Xcode macOS manual steps (#2855)
Older versions of `gyp` in Node.js 12 and npm 6 (included in Node.js 12 and 14) cannot detect `Command Line Tools for Xcode` unless they have been installed manually.
1 parent 8d5f901 commit 606036e

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

ansible/MANUAL_STEPS.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* [RHEL7-S390X](#rhel7-s390x)
1010
* [devtoolset-6 install](#devtoolset-6-install)
1111
* [macOS](#macos)
12+
* [Install Command Line Tools for Xcode](#install-command-line-tools-for-xcode)
1213
* [AIX 7.1](#aix-71)
1314
* [Remove en1 network interface](#remove-en1-network-interface)
1415
* [AIX 7.2 Install](#aix-72-install)
@@ -166,6 +167,62 @@ to
166167
sudo systemsetup -setremotelogin on
167168
```
168169

170+
### Install Command Line Tools for Xcode
171+
172+
Older versions of `gyp` in Node.js 12 and npm 6 (included in Node.js 12
173+
and 14) cannot detect Command Line Tools for Xcode unless they have
174+
been installed manually. Later versions of `gyp` in Node.js 16 and
175+
above, and npm 7/8 use an additional way to detect the Command Line
176+
Tools for Xcode and do not need this step done to build.
177+
178+
`gyp` only checks for Command Line Tools for Xcode if a full Xcode
179+
install was not detected (e.g. on the release machines). We do not
180+
install the full Xcode on the test machines to save disk space (the
181+
Command Line Tools are much smaller).
182+
183+
To check if this needs to be done on a macOS instance that will build
184+
Node.js 12 or 14, run
185+
```console
186+
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
187+
```
188+
189+
This should return something like
190+
```console
191+
package-id: com.apple.pkg.CLTools_Executables
192+
version: 11.5.0.0.1.1588476445
193+
volume: /
194+
location: /
195+
install-time: 1642786943
196+
groups: com.apple.FindSystemFiles.pkg-group
197+
```
198+
199+
If instead this errors with:
200+
```console
201+
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
202+
```
203+
204+
then manually download and install:
205+
1. Go to https://developer.apple.com/download/all/?q=command with an
206+
Apple Developer account (it does not need to be the Build WG's account)
207+
and find `Command Line Tools for Xcode 11.5`. Click the `View Details`
208+
twisty to reveal the download link and download the
209+
`Command_Line_Tools_for_Xcode_11.5.dmg` file.
210+
2. Mount the `.dmg` disk image. This creates
211+
`/Volumes/Command Line Developer Tools`
212+
```console
213+
sudo hdiutil attach Command_Line_Tools_for_Xcode_11.5.dmg
214+
```
215+
3. Install the `.pkg` inside the mounted disk image.
216+
```console
217+
sudo installer -package /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg -target /
218+
```
219+
4. Verify with the earlier `pkgutil` command that the installation is
220+
detectable.
221+
5. Unmount the disk image.
222+
```console
223+
sudo hdiutil detach /Volumes/Command\ Line\ Developer\ Tools
224+
```
225+
169226
## AIX 7.1
170227

171228
### Remove en1 network interface

0 commit comments

Comments
 (0)