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

cmd/dist: depends on clang license being accepted on OSX #13099

Closed
cookieo9 opened this issue Oct 29, 2015 · 8 comments
Closed

cmd/dist: depends on clang license being accepted on OSX #13099

cookieo9 opened this issue Oct 29, 2015 · 8 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

@cookieo9 cookieo9 commented Oct 29, 2015

In a recent update to either the OS or the dev-tools clang on OSX will refuse to run (with error code 69) until it is run as root, and the license is accepted.

The output from ./all.bash when compiling from source is:

go tool dist: cannot invoke C compiler "clang": exit status 69

Go needs a system C compiler for use with cgo.
To set a C compiler, export CC=the-compiler.
To disable cgo, export CGO_ENABLED=0.

Which is a little of a head scratcher. I think the error message could elaborate on a possible cause, so that the users don't think the only solution is to disable cgo.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Oct 30, 2015
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 30, 2015

It seems kind of special purpose to have cmd/dist print out a specific message about this oddity. What does clang print if you run it as non-root before root? Would it be sufficient for cmd/dist to display that output?

@cookieo9
Copy link
Contributor Author

@cookieo9 cookieo9 commented Oct 30, 2015

It prints out a message to the effect that clang needs to be run as root to accept the license (I've lost the output, so I can't give exact details.) I was just thinking that it would make sense for the build process to make it clear what the problem was. Either by outputting clang's output, or by printing a message when darwin's clang fails with a certain error code.

@rakyll
Copy link
Contributor

@rakyll rakyll commented Oct 30, 2015

It prints out

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

As an experienced user, I knew what I had to do. But it is confusing for anyone who doesn't know they need to run clang, accept the license and so on.

@rakyll
Copy link
Contributor

@rakyll rakyll commented Oct 30, 2015

/cc @crawshaw @hyangah

This error message is also visible from gomobile build's output without any useful context.

gomobile  build  -target=android .
gomobile: xcrun --find: exit status 69


Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
@rsc
Copy link
Contributor

@rsc rsc commented Nov 5, 2015

It's wacky but I think we probably do need to special case it. OS X is a very common platform for our users, and this is a very common situation. Printing the compiler output is not enough unless we make it very clear that it's compiler output and that the user is not being asked to sudo ./all.bash (which would work but isn't what we want).

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Dec 2, 2015

On a fresh Capitan (10.11.1 (15B42)) install, I see:

ward5k:~ bradfitz$ git
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
ward5k:~ bradfitz$ echo $?
1
ward5k:~ bradfitz$ clang
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
ward5k:~ bradfitz$ echo $?
1
@rsc
Copy link
Contributor

@rsc rsc commented Dec 17, 2015

@bradfitz That must be before you installed Xcode. After you install Xcode then you get the message about re-running as root.

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 17, 2015

CL https://golang.org/cl/17940 mentions this issue.

@rsc rsc closed this in 4378746 Dec 17, 2015
@golang golang locked and limited conversation to collaborators Dec 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.