Skip to content

Commit fbeed0b

Browse files
Simone Arpechromeos-ci-prod
authored andcommitted
Add support for compiling Android from MacOS ARM64 host
A set of changes that modifies the build files (gni, gn, py, and DEPS) in order to extend support to MacOS. The need for patching these was mostly because the entire build logic assumes that the host OS is "Linux" ending up with the wrong dependencies. Most of the changes include comments to clarify their purpose. V8 CL: https://crrev.com/c/5957090 Bug: 41173821 Change-Id: I48d9ed7202ab87c24c6f943c5ac00720c53bcf00 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5947626 Reviewed-by: Nico Weber <[email protected]> Reviewed-by: Andrew Grieve <[email protected]> Commit-Queue: Andrew Grieve <[email protected]> Cr-Commit-Position: refs/heads/main@{#1373956} CrOS-Libchrome-Original-Commit: 805cfbc3d7abb96776282ba83c4d5ae6483d9f40
1 parent 1453eab commit fbeed0b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

build/android/gyp/util/parallel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
_fork_params = None
2727
_fork_kwargs = None
2828

29+
# Ensure fork is used on MacOS for multiprocessing compatibility.
30+
# Starting from Python 3.8, the "spawn" method is the default on MacOS.
31+
# On Linux hosts this line will be a no-op.
32+
multiprocessing.set_start_method('fork')
2933

3034
class _ImmediateResult:
3135
def __init__(self, value):

build/android/gyp/util/server_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import pathlib
99
import socket
10+
import platform
1011

1112
# Use a unix abstract domain socket:
1213
# https://man7.org/linux/man-pages/man7/unix.7.html#:~:text=abstract:
@@ -17,6 +18,10 @@
1718
def MaybeRunCommand(name, argv, stamp_file, force):
1819
"""Returns True if the command was successfully sent to the build server."""
1920

21+
if platform.system() == "Darwin":
22+
# Build server does not support Mac.
23+
return False
24+
2025
# When the build server runs a command, it sets this environment variable.
2126
# This prevents infinite recursion where the script sends a request to the
2227
# build server, then the build server runs the script, and then the script

0 commit comments

Comments
 (0)