Skip to content

Commit 6111319

Browse files
committed
Improve messaging
1 parent 3ce7899 commit 6111319

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

utils/build-script

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ from swift_build_support.swift_build_support.toolchain import host_toolchain
5353
# TODO: Remove this constant, it's really not helpful.
5454
HOME = os.environ.get("HOME", "/")
5555

56-
_SUPPORTED_XCODE_BUILDS = (
57-
"12A8169g", # 12.0b3
58-
"12A8179i", # 12.0b4
59-
"12A8189h", # 12.0b5
60-
"12A8189n", # 12.0b6
61-
"12A7208", # 12.0GM1
62-
"12A7209", # 12.0GM2
63-
"12A7300", # 12.0.1
64-
)
56+
_SUPPORTED_XCODE_BUILDS = [
57+
("12.0 beta 3", "12A8169g"),
58+
("12.0 beta 4", "12A8179i"),
59+
("12.0 beta 5", "12A8189h"),
60+
("12.0 beta 6", "12A8189n"),
61+
("12.0 GM 1", "12A7208"),
62+
("12.0 GM 2", "12A7209"),
63+
("12.0.1", "12A7300"),
64+
]
6565

6666
# -----------------------------------------------------------------------------
6767
# Helpers
@@ -166,10 +166,14 @@ def validate_xcode_compatibility():
166166

167167
version = shell.capture(
168168
['xcodebuild', '-version'], dry_run=False, echo=False).strip()
169-
if not version.endswith(_SUPPORTED_XCODE_BUILDS):
169+
170+
valid_build_numbers = tuple(x[1] for x in _SUPPORTED_XCODE_BUILDS)
171+
if not version.endswith(valid_build_numbers):
172+
valid_versions_string = "\n".join(
173+
"{} ({})".format(*x) for x in _SUPPORTED_XCODE_BUILDS)
170174
raise SystemExit(
171-
"error: using unsupported Xcode version:\n\n{}\n\nInstall one of: {}".format(
172-
version, ", ".join(_SUPPORTED_XCODE_BUILDS)
175+
"error: using unsupported Xcode version:\n\n{}\n\nInstall one of:\n{}\n\nOr set 'SKIP_XCODE_VERSION_CHECK=1' in the environment".format(
176+
version, valid_versions_string
173177
)
174178
)
175179

0 commit comments

Comments
 (0)