Open Bug 918421 Opened 11 years ago Updated 2 years ago

mach bootstrap fails to detect non-Apple Clang in /usr/bin

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

x86
macOS
defect

Tracking

(Not tracked)

People

(Reporter: dzbarsky, Unassigned)

Details

➜ inbound ./mach bootstrap Error running mach: ['bootstrap'] The error occurred in code that was called by the mach command. This is either a bug in the called code itself or in the way that mach is calling it. You should consider filing a bug for this issue. If filing a bug, please include the full output of mach, including this error message. The details of the failure are as follows: Exception: Could not determine Clang version. File "/Users/dzbarsky/mozilla/inbound/python/mozboot/mozboot/mach_commands.py", line 24, in bootstrap bootstrapper.bootstrap() File "/Users/dzbarsky/mozilla/inbound/python/mozboot/mozboot/bootstrap.py", line 85, in bootstrap instance.install_system_packages() File "/Users/dzbarsky/mozilla/inbound/python/mozboot/mozboot/osx.py", line 135, in install_system_packages self.ensure_xcode() File "/Users/dzbarsky/mozilla/inbound/python/mozboot/mozboot/osx.py", line 180, in ensure_xcode raise Exception('Could not determine Clang version.') ➜ inbound clang --version clang version 3.4 (trunk 184630) Target: x86_64-apple-darwin12.5.0 Thread model: posix
Can we use the fact that --version contains the string "trunk" to know that we are using svn clang instead of apple clang and avoid the XCode command line tools dance?
The code in osx.py is invoking /usr/bin/clang --version as a means to check the OS X clang's version. It doesn't currently look at which clang is on PATH. This is probably wrong. The easy workaround is adjust the regexp to parse the Clang version from OS X 10.9 (which is what I assume you are running). The proper solution is to use the clang binary first on PATH and parse its version string, without regard for Apple-ness. Do we need any other binaries from the Xcode command line tools or is it just Clang? If just Clang, a lot of the code in osx.py can be refactored...
Im actually using 10.8.5 I think binutils comes by default so we may only need Clang.
So is your /usr/bin/clang not the Apple-supplied one? i.e. did you install your own Clang into /usr/bin? If so, you shouldn't mess with /usr/bin :)
Yeah, I pointed /usr/bin/clang at my own clang. Feel free to WONTFIX this if you think people shouldn't be doing that
I strongly believe people shouldn't be mucking with /usr/bin directly on OS X (or any UNIX style system for that matter). However, people do it. The bootstrapper should face gracefully. Here, we should probably be like "your /usr/bin/clang isn't supplied by Apple. Modifying /usr/bin is dangerous. You have been warned."
Summary: mach bootstrap fails to detect svn clang? → mach bootstrap fails to detect non-Apple Clang in /usr/bin
Product: Core → Firefox Build System
Component: General → Bootstrap Configuration
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.