New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 729990 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: 1
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Show a helpful error message if the Xcode license agreement hasn’t been accepted

Project Member Reported by mathias@chromium.org, Jun 6 2017

Issue description

A 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.

 
log.txt
2.2 KB View Download
Some 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.
Cc: smut@chromium.org
Components: -Infra Infra>Client>iOS
Sana can you help triage further?
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.

Comment 4 by s...@google.com, 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?
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
Components: -Infra>Client>iOS Infra>Client>V8 Infra>Client>Chrome
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.
Cc: thakis@chromium.org
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.
Owner: mathias@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 10 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)

Sign in to add a comment