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

clang not found #3521

Closed
karl-cardenas-coding opened this issue Sep 24, 2022 · 6 comments
Closed

clang not found #3521

karl-cardenas-coding opened this issue Sep 24, 2022 · 6 comments

Comments

@karl-cardenas-coding
Copy link

karl-cardenas-coding commented Sep 24, 2022

When attempting to go through the hello work example on my Mac (M1 Monterey 12.6) I keep getting the same error of clang not found. Regardless of the number of times I try to install clang through the automated prompt, the software is not found.

Below is a snipped out of the error output:

          sh: line 1:  1592 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null
          cc: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)
          xcode-select: Failed to locate 'clang', requesting installation of command line developer tools.


error: linking with `cc` failed: exit status: 72

This error occurs when the cargo build command is invoked.

Solution

I am sharing the solution here in case others stumble into this error when getting started. It seems like every time the OS version is upgraded, Xtools preference location is not linked to the latest. You can read more about this issue in this thread.

Issue the following command in your Terminal session to resolve the issue:

sudo xcode-select -switch /Library/Developer/CommandLineTools
@mrinalwadhwa
Copy link
Member

@karl-cardenas-coding thank you for creating the issue, if someone else faces the same problem, this'll be helpful.

@karl-cardenas-coding
Copy link
Author

@mrinalwadhwa happy to help. I have some ideas on how we can get around this issue all together with containers.

A really quick and easy way is to have people use the latest Rust container and do all exercises inside the container. That's what I did and it worked great.

Long-term, using a platform like Instruqt would probably be the best user experience. That way the user don't have to install anything and can simply go through all exercises in a provided environment. Anyway just some ideas, happy to help explore them.

@mrinalwadhwa
Copy link
Member

Good ideas, there is container image currently that has all our build tools.

Give it a try:

docker run --rm -it -e HOST_USER_ID=$(id -u) --volume $(pwd):/work ghcr.io/build-trust/ockam-builder:latest bash

@karl-cardenas-coding
Copy link
Author

karl-cardenas-coding commented Sep 24, 2022

Oooo that's even better. Adding some introductory text to each lesson wouldn't be to bad of a task. @mrinalwadhwa would you be okay if I opened a PR that provided instructions on how to use the docker image for each lesson?

@mrinalwadhwa
Copy link
Member

@karl-cardenas-coding not at all, we would love to get a PR.

@etorreborre
Copy link
Member

fixed with #3523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants