Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for XCode locator problems #4615

Closed
davidstanke opened this issue Feb 9, 2018 · 6 comments
Closed

Better error message for XCode locator problems #4615

davidstanke opened this issue Feb 9, 2018 · 6 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) type: documentation (cleanup) z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple

Comments

@davidstanke
Copy link
Contributor

Description of the problem / feature request:

Various situations on macOS can cause problems when Bazel attempts to interoperate with XCode. See: #4603, and similar behavior if the XCode license has not been accepted. The user gets an error that's not often helpful: Xcode version must be specified to use an Apple CROSSTOOL. Please replace this with a message that will help users take action. (Strawperson: Unable to run xcode-locator-bin -- another process may be interfering with execution)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

This is actually really hard to reproduce, but some users have reported that it happens on macOS High Sierra, if both Santa and VSCode are running when Bazel is called.

Versions

Experienced on Bazel 0.10 on macOS High Sierra. (Other versions possibly affected)

@c-parsons
Copy link
Contributor

The problem is that xcode-locator-bin has no meaning outside of bazel. I posit that your "strawperson" proposal does not help understand the issue, nor provide any actionable information to the user at all.

I'm open to other proposals -- this is easy enough to change, I just don't have any good ideas what information we can provide the user, given that we don't even really have any idea how to reliably reproduce this issue, nor what process may be establishing an arbitrary lock on xcode-locator-bin right after its creation.

@buchgr
Copy link
Contributor

buchgr commented May 31, 2018

I find that this problem happens every single time after installing a macOS update and when there's a xcode related update outstanding. The issue goes away after installing the update, reboot,

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
bazel clean --expunge

The issue happens to me every two weeks or so :.

@jmmv
Copy link
Contributor

jmmv commented Nov 7, 2018

One extra case to handle: when we get /Library/Developer/CommandLineTools as a path, we should probably tell the user that things won't work and that they must use xcode-select to point to an Xcode directory.

@jmmv
Copy link
Contributor

jmmv commented Nov 7, 2018

We also must ensure that all xcode-locator output ends up in the Bazel log unconditionally so that we have something to base our debugging on.

@aiuto aiuto added the z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple label Nov 28, 2018
@c-parsons
Copy link
Contributor

Ping for visibility, with priority (I will likely take this on myself)

Received some recent feedback that this error message ("run xcode-select -p") is horribly unhelpful in terms of path forward, as that doesn't actually resolve any issues.
Some ideas for extra steps, of "less precise" things to try:

"Manually run xcode and accept any terms and conditions"
"Run xcode-select -s <Xcode_installation_path> if the path does not match"

@c-parsons c-parsons added the P2 We'll consider working on this in future. (Assignee optional) label Sep 23, 2019
@jmmv
Copy link
Contributor

jmmv commented May 13, 2020

There are so many things that can go wrong in Xcode selection, and given the little visibility we have when running xcode-locator-bin, I'm afraid an error message isn't gonna cut it.

I think we should have an FAQ entry or something with detailed information on this, with multiple troubleshooting steps, and then make the error message point at that page. (I even think we do have some documentation on that topic already, written recently by @susinmotion.)

bazel-io pushed a commit that referenced this issue Sep 30, 2020
#4615

RELNOTES: None.
PiperOrigin-RevId: 334512179
Yannic pushed a commit to Yannic/bazel that referenced this issue Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: documentation (cleanup) z-team-Apple Deprecated. Send to rules_apple, or label team-Rules-CPP + platform:apple
Projects
None yet
Development

No branches or pull requests

8 participants