Unpack llvm with clang tools


(Slymz) #1

This might be a question of more general nature about getting the sources properly for a formula.

brew install llvm works fine and installs clang tools. However, when I attempt

cd ~/src
brew unpack llvm

This extracts llvm-6.0.0, but there is no llvm-6.0.0/tools/clang dir.

I expected to get the raw sources as it was used in preparing the bottle. Where should I expect to find clang sources?

Thx


(Jacob Ledbetter) #2

Try reinstalling it from source brew reinstall llvm --build-from-source


(Eduard Rozenberg) #3

Same here - brew unpack llvm does not download the clang sources, only llvm.

You can see how the build downloads clang by viewing the formula via brew edit llvm. It’s a complex formula - wishing you good luck if you’re diving into this one.


(Slymz) #4

And? Where would the source tree end up?


(Slymz) #5

Thanks for the tip! Yeah, I can see what you mean. Although a cursory scroll thru the script shows some entry for clang-extra-tools that whet my appetite. I thought unpack is supposed to repeat all this except the build part - am I misunderstanding what unpack is supposed to do? I wish I could understand what this formula does exactly; building clang from git sources on osx following official installation instructions is like pulling tooth.

Basically, my objective is to be able to follow clang’s libTooling tutorials, which are assuming one is able to build off of the source tree in clang/tools/extra, and is what I’ve been used to on vanilla linux.