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/go: race detector and cgo builds needs to diagnose lack of C compiler more gracefully #44271

Open
dr2chase opened this issue Feb 15, 2021 · 0 comments

Comments

@dr2chase
Copy link
Contributor

@dr2chase dr2chase commented Feb 15, 2021

NB this is forwarded from a Stack Overflow question.
A new user had this experience:

I'm following a tutorial on Go, and I have the actual file tree:
.
├── arrays
├── concurrency
├── di
├── hello-world
├── integers
├── iteration
├── maps
├── mocking
├── pointers
├── racer
└── structs
If I run the tests in all of the folders files, they work, except for the folder called racer, where running the tests gives me the following error:

# runtime/cgo
cgo: exec /missing-cc: fork/exec /missing-cc: no such file or directory
FAIL    github.com/-redacted-/go-with-tests/racer [build failed]

Is it related to something I'm doing in the files?

I can't reproduce this without trashing my Xcode install which I'd rather not, but it is almost certainly the case that said/sad user lacks a C compiler, and building with the race detector requires a C compiler. If we could detect this situation and give a more helpful error message, that would probably improve the on-ramp experience.

@ianlancetaylor ianlancetaylor changed the title Race detector build needs to diagnose lack of C compiler more gracefully cmd/go: race detector and cgo builds needs to diagnose lack of C compiler more gracefully Feb 15, 2021
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants