Commit b595c149 authored by brizental's avatar brizental
Browse files

fixup! BB 43564: Modify ./mach bootstrap for Base Browser

Use our MacOS SDK mirror when bootstrapping for Mac.
parent dd0afa6b
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ def bootstrap_path(path, **kwargs):
        when=when,
    )
    @imports("os")
    @imports("re")
    @imports("subprocess")
    @imports("sys")
    @imports("mozbuild.tbbutils")
@@ -354,6 +355,23 @@ def bootstrap_path(path, **kwargs):
                    + command["arguments"]
                    + [path_parts[0]]
                )

                # BIG HACK: Replace the Apple CDN link with our mirror,
                # otherwise bootstrapping will fail whenever a new MacOS SDK
                # is released, since Apple seems to retire the previous link everytime.
                # Our mirror serves an _unmodified_ version of the file.
                macosx_sdk_match = re.match(r"^MacOSX(.*)\.sdk$", path_parts[0])
                if macosx_sdk_match:
                    version = macosx_sdk_match.group(1)
                    command = [
                        re.sub(
                            r"https://swcdn\.apple\.com/.*/CLTools_macOSNMOS_SDK\.pkg",
                            f"https://build-sources.tbb.torproject.org/CLTools_macOSNMOS_SDK-{version}.pkg",
                            c,
                        )
                        for c in command
                    ]

                # Clean up anything that was bootstrapped previously before going
                # forward. In other cases, that's taken care of by mach artifact toolchain.
                rmtree(