Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: build/mac_toolchain.py

Issue 1844613004: Support bot sudoers for xcode-select and xcodebuild. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/mac_toolchain.py
diff --git a/build/mac_toolchain.py b/build/mac_toolchain.py
index b57c8159a32aa0d4933d6da35298a934d5beeb3e..2dfc8faf7a935651438a7ade6c18727fb8acfb4b 100755
--- a/build/mac_toolchain.py
+++ b/build/mac_toolchain.py
@@ -10,8 +10,9 @@ xcode-select is already set and points to an external folder
|TOOLCHAIN_REVISION|-|TOOLCHAIN_SUB_REVISION| below, GYP_DEFINE
mac_toolchain_revision can be used instead.
-This script will only run on machines if /usr/bin/xcodebuild has been added to
-the sudoers list so the license can be accepted.
+This script will only run on machines if /usr/bin/xcodebuild and
+/usr/bin/xcode-select has been added to the sudoers list so the license can be
+accepted.
Otherwise, user input would be required to complete the script. Perhaps future
versions can be modified to allow for user input on developer machines.
@@ -93,10 +94,13 @@ def CanAccessToolchainBucket():
def AcceptLicense(directory):
"""Use xcodebuild to accept new toolchain license. This only
- works if xcodebuild is in sudoers."""
- xcodebuild = os.path.join(TOOLCHAIN_BUILD_DIR,
- 'Contents/Developer/usr/bin/xcodebuild')
- subprocess.check_call(['sudo', xcodebuild, '-license', 'accept'])
+ works if xcodebuild and xcode-select are in sudoers."""
+ xcodebuild_dir = os.path.join(TOOLCHAIN_BUILD_DIR, 'Contents/Developer')
+ old_path = subprocess.Popen(['/usr/bin/xcode-select', '-p'],
+ stdout=subprocess.PIPE).communicate()[0].strip()
+ subprocess.check_call(['sudo', '/usr/bin/xcode-select', '-s', xcodebuild_dir])
+ subprocess.check_call(['sudo', '/usr/bin/xcodebuild', '-license', 'accept'])
+ subprocess.check_call(['sudo', '/usr/bin/xcode-select', '-s', old_path])
def UseLocalMacSDK():
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698