nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1Sandboxed builds need a fallback value for the version of the Command Line Tools
2being used. Not calling `CLTVersion()` avoids relying on absolute paths,
3improving the reproducibility of non-sandboxed builds.
4
5diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
6index 508f6ccac3e..44bcd988c4c 100644
7--- a/tools/gyp/pylib/gyp/xcode_emulation.py
8+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
9@@ -1495,24 +1495,8 @@ def XcodeVersion():
10 global XCODE_VERSION_CACHE
11 if XCODE_VERSION_CACHE:
12 return XCODE_VERSION_CACHE
13- version = ""
14+ version = "11.0.0.0.1.1567737322"
15 build = ""
16- try:
17- version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
18- # In some circumstances xcodebuild exits 0 but doesn't return
19- # the right results; for example, a user on 10.7 or 10.8 with
20- # a bogus path set via xcode-select
21- # In that case this may be a CLT-only install so fall back to
22- # checking that version.
23- if len(version_list) < 2:
24- raise GypError("xcodebuild returned unexpected results")
25- version = version_list[0].split()[-1] # Last word on first line
26- build = version_list[-1].split()[-1] # Last word on last line
27- except (GypError, OSError):
28- # Xcode not installed so look for XCode Command Line Tools
29- version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
30- if not version:
31- raise GypError("No Xcode or CLT version detected!")
32 # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100":
33 version = version.split(".")[:3] # Just major, minor, micro
34 version[0] = version[0].zfill(2) # Add a leading zero if major is one digit
35
36
37--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
38+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
39@@ -1495,24 +1495,8 @@ def XcodeVersion():
40 global XCODE_VERSION_CACHE
41 if XCODE_VERSION_CACHE:
42 return XCODE_VERSION_CACHE
43- version = ""
44+ version = "11.0.0.0.1.1567737322"
45 build = ""
46- try:
47- version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
48- # In some circumstances xcodebuild exits 0 but doesn't return
49- # the right results; for example, a user on 10.7 or 10.8 with
50- # a bogus path set via xcode-select
51- # In that case this may be a CLT-only install so fall back to
52- # checking that version.
53- if len(version_list) < 2:
54- raise GypError("xcodebuild returned unexpected results")
55- version = version_list[0].split()[-1] # Last word on first line
56- build = version_list[-1].split()[-1] # Last word on last line
57- except (GypError, OSError):
58- # Xcode not installed so look for XCode Command Line Tools
59- version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
60- if not version:
61- raise GypError("No Xcode or CLT version detected!")
62 # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100":
63 version = version.split(".")[:3] # Just major, minor, micro
64 version[0] = version[0].zfill(2) # Add a leading zero if major is one digit