Show a helpful error message if the Xcode license agreement hasn’t been accepted |
||||||
Issue descriptionA common cause of errors when building Chromium (or, in my case, V8) from source on a new Mac is when Xcode is installed but its license agreement hasn’t yet been accepted. In that scenario, you currently get cryptic errors (see the attached error log). We can improve that as follows. Check if the path in `hermetic_xcode_path` (https://cs.chromium.org/chromium/src/build/toolchain/toolchain.gni?l=56) actually exists, and show a helpful error message otherwise. Suggested error message: Install Xcode, launch it, and accept the license agreement to continue.
,
Jun 8 2017
Sana can you help triage further?
,
Jun 8 2017
Just to be clear, this is unrelated to iOS. Xcode just happens to be needed to build V8 or Chromium on macOS. Apologies for the confusion.
,
Jun 8 2017
Doesn't hermetic do this automatically? Are there cases where hermetic fails to accept the license agreement or are you talking about cases where hermetic isn't used at all?
,
Jun 9 2017
I don’t think Hermetic was used in this case. All I did was follow these instructions on a clean machine: https://github.com/v8/v8/wiki/Building-from-Source
,
Oct 10 2017
Mathias ist not talking about our build infrastructure (I assume that's where Hermetic is used), but rather about how developers outside of Google can start contributing to V8 or Chrome. We just need to find the script that generates confusing error message, add a check there and generate better error message to guide users having this issue.
,
Nov 8 2017
Looks like we need to add a check like this:
if not os.path.isdir(sdk_dir):
raise Exception('Install Xcode, launch it, and accept the license agreement to continue.')
just before https://cs.chromium.org/chromium/src/build/mac/find_sdk.py?l=57&rcl=0acd1627a3481649ceb76eaebbf82a410419b02c.
Mathias, can you please prepare a CL for this? Probably best to send a review to thakis, who edited nearby lines last.
,
Nov 8 2017
,
Nov 9 2017
,
Nov 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/21ffa4e82be6afcb590568a651543b90eae5c6d2 commit 21ffa4e82be6afcb590568a651543b90eae5c6d2 Author: Mathias Bynens <mathias@chromium.org> Date: Thu Nov 09 19:48:53 2017 [build] Detect Xcode license agreement acceptance This patch prints a helpful error message if the Xcode license agreement hasn’t been accepted or if the CommandLineTools are installed separately from Xcode. BUG= 729990 Change-Id: I8d7c6550c6b144473892a8f8c491eba32cbf9e6c Reviewed-on: https://chromium-review.googlesource.com/758651 Commit-Queue: Mathias Bynens <mathias@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org> Cr-Commit-Position: refs/heads/master@{#515248} [modify] https://crrev.com/21ffa4e82be6afcb590568a651543b90eae5c6d2/build/mac/find_sdk.py
,
Nov 9 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by mathias@chromium.org
, Jun 7 2017Some more background: Homebrew, for example, installs the command-line tools separately from Xcode: ==> Installing Command Line Tools (macOS Sierra version 10.12) for Xcode-8.3 ==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ Sierra\ version\ 10.12)\ for\ Xcode-8.3 In that case, the tools are installed to `/Library/Developer/CommandLineTools` instead of `/Applications/Xcode.app/Contents/Developer`, and they are missing some directories needed by the V8 scripts. If you’re getting this output, you have a problem: $ xcode-select --print-path /Library/Developer/CommandLineTools What you want is this: $ xcode-select --print-path /Applications/Xcode.app/Contents/Developer To get there, run `sudo rm -rf /Library/Developer/CommandLineTools`, and install Xcode afterwards. It would be helpful to detect if `xcode-select --print-path` returns `/Library/…` and show a helpful error message pointing to this comment in that case.