Commit 5da27796 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

build: Update mac build parsing to accept repackaged builds.

Most macOS builds are of the form major-minor-build, such as 19D76. In
some cases, packaging errors are fixed by repackaging an existing build.
In those cases, the build gets a packaging version, such as 19E258a
(packaging version 2), or 19E234g (packaging version 8).

This CL updates the parsing code to account for the package version.

Bug: 1049832
Test: gn gen with enable_nacl={on,off} on macOS 19D76.
Change-Id: I3aac7ee56acc46a77b7a7a8ea5b19ea386c5d84d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096912
Auto-Submit: Victor Costan <pwnall@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748984}
parent 88d49de1
...@@ -76,13 +76,17 @@ def FillMachineOSBuild(settings): ...@@ -76,13 +76,17 @@ def FillMachineOSBuild(settings):
settings['machine_os_build'] = machine_os_build settings['machine_os_build'] = machine_os_build
# The reported build number is made up from the kernel major version number, # The reported build number is made up from the kernel major version number,
# a minor version represented as a letter, and a build number. # a minor version represented as a letter, a build number, and an optional
# packaging version.
# #
# For example, the macOS 10.15.3 GM build is 19D76. # For example, the macOS 10.15.3 GM build is 19D76.
# - 19 is the Darwin kernel that ships with 10.15. # - 19 is the Darwin kernel that ships with 10.15.
# - D is minor version 4. 10.15.0 builds had minor version 1. # - D is minor version 4. 10.15.0 builds had minor version 1.
# - 76 is the build number. 75 other builds were stamped before GM came out. # - 76 is the build number. 75 other builds were stamped before GM came out.
build_match = re.match(r'^(\d+)([A-Z])(\d+)$', machine_os_build) #
# The macOS 10.15.4 beta 5 build is 19E258a. The trailing "a" means the same
# build output was packaged twice.
build_match = re.match(r'^(\d+)([A-Z])(\d+)([a-z]?)$', machine_os_build)
assert build_match, "Unexpected macOS build format: %r" % machine_os_build assert build_match, "Unexpected macOS build format: %r" % machine_os_build
settings['machine_os_build_major'] = int(build_match.group(1), 10) settings['machine_os_build_major'] = int(build_match.group(1), 10)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment