My favorites | Sign in
Logo
             
Search
for
Updated Nov 30, 2009 by dmacl...@chromium.org
MacBuildInstructions  
Build instructions for Chromium on Mac OS X

Expectations

These instructions will produce two applications: a test harness for running layout tests (TestShell) and a multi-process web browser (Chromium). Depending on the level or area of your involvement, one or the other may be more important (ie, TestShell will be of primary concern if you're hacking on WebKit). Most people, however, will be interested in Chromium.

This project is a work in progress, please respect that. For more detailed information on our progress, please check out the Mac OS X Detailed Status page.

Prerequisites

  • An Intel Mac running Mac OS X 10.5 (“Leopard”) or 10.6 (“Snow Leopard”). V8 does not currently support PowerPC.
  • XCode 3.1.2 or 3.1.3 (Leopard) or 3.2 (Snow Leopard). Thankfully, Apple’s build tools are free. All you need is a free Apple Developer Connection account. You can choose to install the iPhone version or not, it doesn't matter.
  • Install gclient, part of the depot_tools package (download). gclient is a wrapper around svn that we use to manage our working copies. Note: If you use python25 from MacPorts, you also need to install py25-socket-ssl, otherwise "gcl upload" will fail with the error message "AttributeError: 'module' object has no attribute 'HTTPSHandler'". Use the command "sudo port install py25-socket-ssl" to install it.

Getting the code

Check out the source code using the direct svn checkout method if you plan on staying current with the project. As the tarball may not be svn 1.4 compatible, updating it per the instructions probably won't work and you're left with a half-updated tree that doesn't build.

Before you check out, make sure that the waterfall indicates the source tree is open, or you risk pulling a broken tree.

The path to the build directory should not contain spaces (e.g. "~/Mac OS X/chromium"), as this will cause the build to fail.

Building

The Xcode project files are generated from GYP files. Running gclient sync will bring the source code up-to-date and will automatically generate the project files. You can also (re-)generate the project files by calling gclient runhooks at any time.

To build all of the targets, open ~/chromium/src/build/all.xcodeproj and build the All target. Assuming the waterfall is green, building the All target should not produce any errors and will generate both TestShell and Chromium applications.

To work on TestShell directly, open src/webkit/tools/test_shell/test_shell.xcodeproj in XCode and build the test_shell target. The Chromium project is in src/chrome/chrome.xcodeproj. Both of these projects include accompanying unit tests as separate targets. As you make changes, it is very important these tests continue to pass. The build will break if you break the tests.

If you have problems building, join us in #chromium on irc.freenode.net and ask there. As mentioned above, be sure that the waterfall is green and the tree is open before checking out. This will increase your chances of success.

Building from the command line

Chromium can also be built from the command-line using the xcodebuild command. This is useful when you are looking to script or automate builds.

For example, assuming ~/chromium/ is the check out directory, to build the 'All' target using the Debug configuration (Release is the other option):

$ cd ~/chromium/src/build
$ xcodebuild -project all.xcodeproj -configuration Debug -target All

Running

All build output is located in the xcodebuild directory (in the example above, ~/chromium/src/xcodebuild). You can find the applications at {Debug|Release}/TestShell.app and {Debug|Release}/Chromium.app, depending on the selected configuration.

Unit Tests

We have several unit test targets that build, and tests that run and pass:

When these tests are built, you will find them in the xcodebuild/{Debug|Release} directory. You can run them from the command line.

Coding

According to the Chromium style guide code is not allowed to have whitespace on the ends of lines. Xcode loves adding whitespace to the ends of lines which can make editing in Xcode more painful than it should be. The GTM Xcode Plugin adds a preference panel to Xcode that allows you to strip whitespace off of the ends of lines on save. Documentation on how to install it is here.

Debugging

Good debugging tips can be found here.

Contributing

Once you’re comfortable with building Chromium, check out Contributing Code for information about writing code for Chromium and contributing it.


Comment by kaja.bilek, Nov 11, 2008

"V8 does not currently support PowerPC."

now, that makes sence, considering v8 is more compiler than interpreter, but I'm still disappointed a little ...

Comment by misterlister, Nov 13, 2008

Will there be PPC support?

Comment by running.cz, Nov 13, 2008

misterlister: no, it's written there. V8, javascript interpret/compiler won't run on PPC.

Comment by Takano.Naoki, Nov 17, 2008

I check out the whole source code, but I could not build it... There are lots of errors.

Comment by TEARSxFROMxCALLIE, Nov 20, 2008

running.cz: It says "currently". Is there any plan for ppc support eventually?

Comment by mavink, Nov 26, 2008

@Takano Naoki: make sure the tree is open when you do a checkout. If you just want to have a look at the state of things, you can find TestShell? builds here.

Comment by Takano.Naoki, Dec 03, 2008

Thank you, mavink. Now I can build on my environment ;-)

Comment by jalexanderdatkins, Dec 16, 2008

@TEARSxFROMxCALLIE: Since it requires 10.5, I'm guessing not.

Comment by vinicius.mignot, Dec 29, 2008

@jalexanderdatkins: 10.5 supports PPC.

Comment by alexanderbooker, Jan 09, 2009

Does anyone know if this may ever support 10.4? Because, I'm not planning on upgrading anytime soon.

Comment by jay.perkins, Jan 09, 2009

If Google doesn't support PPC, I can understand why. Over our 20 or so web sites the statistics (Google Analytics) show that 9.61% of our visitors over the last 90 days used a MAC, and only 4.65% of the MACs were PPC. So Google would be writing for, testing, and supporting a platform of a total population of under .5% (one half of one percent) of the market. Not only that, but by definition, it is guaranteed to decline every year. Sure it would be great if my old G4 ran it, but it really makes no sense for Google.

Comment by drlinguist, Jan 09, 2009

Another vote for PPC and 10.4.

Comment by macewan, Jan 09, 2009

First half of 2009? Seriously, you can do better than that Google.

Comment by hans.wolters.nlo, Jan 10, 2009

Seems like I am not the only one using a PPC. Bought a Mini just before Apple started to sell Intel machines. I am not willing to buy a new one since the machine runs fine for me.

Then again, Google is not the only one supporting intel only. Maybe they do not respect the .x percent users or even have a deal with apple.

Comment by EJWilliamsJr, Jan 10, 2009

Please include a version for PPC.........Some of us really don't want an Intel Mac.........!

Comment by TEARSxFROMxCALLIE, Jan 11, 2009

Begging for a PPC version here is not going to do you any good. It doesn't make sense.

It makes sense that V8 would remain Intel-only. There are some really intense optimizations going on (I talked with an ex-professor of mine that now works on V8). Re-coding this for another architecture would be painful.

Oh and @macewan: Give them a break. Do you have any idea what goes into a project like this?

Comment by marius.vanwyk, Jan 11, 2009

It's a pity that I'll still have to use FF on my PPC (which I have little problems with) but to be honest I don't expect companies (even the big ones...) to write new software that can run on old version of any OS... If only I had money to buy one of the new Macbooks...

Comment by nicolas.ramz, Jan 11, 2009

>It makes sense that V8 would remain Intel-only. IIRC you may disabled JIT (ie: v8) and use a static javascript interpreter so V8 is not preventing from having a PPC version of chrome. But this would be slower than intel version...

Comment by welshman0, Jan 12, 2009

Comment by EJWilliamsJr, Jan 10 (44 hours ago) Please include a version for PPC.........Some of us really don't want an Intel Mac.........!

Why don't you want to join the rest of us in the 21st century? I'm pretty sure 10.6 won't be compatible with PPC so why would Google create a program for old technology - seems kinda pointless.

Comment by SignOfZeta, Jan 13, 2009

10.6 will support PowerPC G4 and G5 chips.

Still, porting from one platform to another is about as much as a challenge of porting from one architecture to another. Perhaps an enterprising developer can have Javascript execute in V8 on Intel, and through Safari's JS engine on PowerPC?

Comment by micklure, Jan 14, 2009

So does this mean that there will be no Chrome for PPC at all?

Comment by amyandmaron, Jan 15, 2009

I doubt that even the Google programmers know for sure. And things can always change. Keep lobbying ppcers!

Comment by dan.ericson, Jan 15, 2009

Hi, I use a Mac IIe... can you guys make Chrome work on it?

lol... It's time to move forward with the times. Personally I use chrome on my work XP machine and my Vista boot camp partition. It is my browser of choice. Stable, fast, and of course, google's. Nice job guys. I'm willing to wait as you always do a great job on your mac products.

Comment by bwoodruff, Jan 18, 2009

Seriously, upgrade to Intel people.

Comment by Michael.Krog, Jan 19, 2009

Chrome rocks.. But I still dont see why the GUI could be implemented with QT, like Opera does.

It seems like you are re-inventing the wheel instead of maturing existing frameworks.

Comment by madley.maddles, Jan 19, 2009

Why should people have to upgrade? Macs typically last four years before the user upgrades. The last PPC Mac sold was in mid 2006 - that's only 2.5 years ago. Granted the last revision was in late 2005 but that still means PPC Macs have at least a year left in them.

Posted from my Intel Core Duo MacBook? Pro.

Comment by gstein, Jan 25, 2009

@madley.maddles: nobody said they have to upgrade. they just can't run Chrome.

Like the poster above said, asking for PPC would be like asking for Chrome to run on my old Apple Lisa. The cost to Google to get Chrome to run well on PPC is just way too much. Begging and voting and pleading is not going to change the simple economic shere. Give it up already.

Comment by dr.load, Jan 28, 2009

Like Chromium, Snow Leopard will support Intel iron exclusively. Get with the program, hippies!

Comment by TEARSxFROMxCALLIE, Jan 29, 2009

@SignOfZeta?: no. 10.6 is Intel-only.

Although that is certainly an idea (using a different JS engine on PPC). Not sure they're willing to go through the testing that would require for such a small marketshare, though. And I'm not sure Chromium would be worth it without V8. I think it's my favorite part. I'd be on FF if it ran Javascript like Chromium.

Comment by suyashs, Feb 05, 2009

There is a significant share of PPC Macs out there. For example, my parent's Power Mac G4's XBench score is higher than some Mac Mini's out there. They have no reason to upgrade to another computer, especially since it runs all the apps they use at a decent speed, runs Leopard well, and runs Safari well. It also has gigabit ethernet.

Comment by bradlambeth, Feb 10, 2009

Is there a way to get around building webkit every time? Could I just install the upstream nightly build and set up xcode to use some of the prebuilt webkit rather than all of the webkit source from chromium? This question applies for the other third party libraries too, like libxslt. I have many of these installed through macports and yet xcode seems to build the chromium-sourced version every time.

Comment by rootadmen, Feb 13, 2009

@SignOfZeta? You are simply wrong. 10.6 is intel only. It would be a huuuge waste of money to just now start developing for a fading architecture.

Comment by patriziosaliani, Feb 14, 2009

Intel is crap, are you making a crappy browser as well? If not can you please make it PPC compatible?

Many thanks, Pat

Comment by fabtheman, Feb 16, 2009

To all that are asking for Chrome Mac to work on PPC: THIS IS AN OPEN SOURCE PROJECT! If making it run on PPC is so easy and the demand is so high, just write it.

Comment by TEARSxFROMxCALLIE, Feb 17, 2009

@fabtheman hahaha Very true. @patriziosaliani You're an idiot.

Comment by rockinbluekat, Feb 21, 2009

If a PPC version came out I'd certainly try it out. There are some things about FireFox? that really irritate me, but I have next to nothing to make me really desire to go out and buy a new computer enough to pony up the cash. I've got the same G4 I bought new in 2000, upgraded with a processor upgrade card running OS X 10.5.6 The last time I got a new computer it was only because my then 6 year old PowerMac6100? started overheating and killed it self.

That said, I'm not holding my breath or anything. I'll be fine running whatever ends up being the last version of FireFox? that works for PPC untill it starts crapping out on nearly every single page the same way Netscape Navigator 3.0 does now.

Comment by patriziosaliani, Feb 21, 2009

To Tearsxfromxcallie: are you assuming I should know how to build an app? And by the way do you think I care learning howto? Idiot to me is just an unsollicited comment but if you want to meet me we can talk about it. I can make you happy.

Comment by repeater75, Mar 03, 2009

You recent converts from PC's have to understand that longtime Mac users are accustomed to getting more years of useful life out of their computers than you are. It's a painful thought to have a Mac mini you bought new in 2005 unable to run a browser released in 2009, a mere 4 years later. That said, if you're still chugging along on a G4 as your main machine, you really should go get a new machine. The Intel-powered Macs obliterate the PPC ones - very very fast machines by comparison. And what is with the Leopard upgrade holdouts? They'll have Snow Leopard out soon enough, I guess you might as well wait for that - oh wait - you need an Intel Mac for that too.

Comment by nacho797, Mar 13, 2009

Please ppc and 10.4, please!!!

Comment by hcoale, Mar 17, 2009

Why would any sane company make a browser for Mac PPC in 2009? Give me a break. I have been on Macs since they came out in 1984, and what makes them great is that they morph to the demands of every mini-era. And there are always the people who get left in the dust cause they can't change as nimbly. My Intel MacBook? Pro is now 3 years old and still is the best computer I've ever had. Chrome for has taken long enough... don't start whining with absurd requests and slow it down even more.

Comment by jstotler, Mar 20, 2009

"To build all of the targets, open ~/chromium/src/build/all.xcodeproj and build the All target"

There is no all.xcodeproj after a fresh sync.

Comment by jstotler, Mar 20, 2009

"To work on TestShell? directly, open src/webkit/tools/test_shell/mac/TestShell?.xcodeproj in XCode and build the TestShell? target."

Nor is there a TestShell?.xcodeproj file....

Comment by filcab, Mar 21, 2009

I have a problem building Chrome. A time.h in chrome is getting included instead of the system one when, in pthread.h (system), I have #include <time.h>

Example: CompileC ../xcodebuild/base.build/Debug/base.build/Objects-normal/i386/prtime.o /Users/filcab/dev/stuff/google/src/base/third_party/nspr/prtime.cc normal i386 c++ com.apple.compilers.gcc.4_2

cd /Users/filcab/dev/stuff/google/src/base /Developer/usr/bin/gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -O0 -mdynamic-no-pic -Werror -Wnewline-eof -DCHROMIUM_BUILD -isysroot /Developer/SDKs/MacOSX10.5.sdk -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.5 -gdwarf-2 -Wall -Wendif-labels -F/Users/filcab/dev/stuff/google/src/base/../xcodebuild/Debug -I/Users/filcab/dev/stuff/google/src/base/../xcodebuild/Debug/include -I../third_party/icu38/public/common -I../third_party/icu38/public/i18n -I.. -I/Users/filcab/dev/stuff/google/src/base/../xcodebuild/base.build/Debug/base.build/DerivedSources? -c /Users/filcab/dev/stuff/google/src/base/third_party/nspr/prtime.cc -o /Users/filcab/dev/stuff/google/src/base/../xcodebuild/base.build/Debug/base.build/Objects-normal/i386/prtime.o
In file included from /Developer/SDKs/MacOSX10.5.sdk/usr/include/pthread.h:60,
from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/i686-apple-darwin9/bits/gthr-default.h:43, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/i686-apple-darwin9/bits/gthr.h:114, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/i686-apple-darwin9/bits/c++io.h:37, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd:46, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/stl_algobase.h:69, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/char_traits.h:46, from /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/string:46, from ../base/logging.h:8, from ../base/third_party/nspr/prtime.h:55, from /Users/filcab/dev/stuff/google/src/base/third_party/nspr/prtime.cc:66:
./time.h:213: error: 'time_t' has not been declared ./time.h:214: error: 'time_t' does not name a type

The time.h that gets included is in src/base/base/time.h

Comment by rsesek, Mar 26, 2009

I've posted a pre-built version on my website as well as the build instructions I used. It seems that you have to use "gclient sync" to generate the Xcode project files (all.xcodeproj).

http://www.bluestatic.org/chromium/

Comment by filcab, Mar 28, 2009

Thanks for the link... But even if I follow those instructions, I get the same error... somehow the src/base directory is getting included in the include search path... and time.h is getting ingluded when the system's pthread.h includes <time.h>...

Any clues?

Comment by sandrine.ribeau, Mar 29, 2009

It would be great to have some binary downloadable at some point like Webkit nightly provide.

Comment by emeioul, Mar 30, 2009

In Tiger, it won't run ?

Comment by rsesek, Apr 02, 2009

Try reading the second section called "Prerequisites." Leopard only.

Comment by crobe43, Apr 04, 2009

Upgrade from the PPC and you will never look back

Comment by bilodeau1, Apr 15, 2009

"Hi, I use a Mac IIe... can you guys make Chrome work on it?..."

Possibly, if the IIe is running a flavor of Linux that will support Chrome.

Comment by bilodeau1, Apr 15, 2009

"...Possibly, if the IIe is running a flavor of Linux that will support Chrome."

Sorry, my bad. I was thinking of the Macintosh II. I don't know of any flavor of Linux that will run on an Apple IIe.

Comment by nacho797, Apr 23, 2009

PPC and 10.4 pleaaaase!

Comment by spq982, Apr 27, 2009

Please include PowerPC Compatibility. I really want to run this on my G4

Comment by Nikita.Solovykh, May 06, 2009

Hi! I'm having a problem with syncing gclient. The process as I can see in the terminal goes well, but when the files stop downloading there is neither /src/build/all.xcodeproj file, nor src/webkit/tools/test_shell/TestShell?.xcodeproj one. Can anyone help me with this? The waterfall at the moment of syncing was green. Thanks!

Comment by MNNelkin, May 13, 2009

PPC is dying out, it is time to upgrade!!!

Comment by muhammadk, May 15, 2009

Would it be possible to add Sparkle (http://sparkle.andymatuschak.org/) to Chrome so that it is easy for testers to update automatically rather than manually?

Comment by rsesek, May 16, 2009

Nikita: Do you have a src/chrome/chrome.xcodeproj?

muhammadk: They'll probably use Google Update eventually. That's a lower priority, though.

Comment by d...@madebysofa.com, May 17, 2009

rsesek: I'm running into the same problems as Nikita, no All.xcodeproj, no chrome.xcodeproj either.

I have tried both downloading and unarchiving the tarball and using gclient to checkout the source code directly. (using SVN 1.5.6, so no issues there either). In both cases, the .xcodeproj files are MIA.

It seems like both .xcodeproj files have been removed from the trunk at some point in the past.

Comment by youwantjosh, May 19, 2009

Yep same problem here of course. No All.xcodeproj and no chrome.xcodeproj please advise.

Comment by youwantjosh, May 19, 2009

in 2.0.x the all.xcodeproj seems to be replaced by all.gyp. The latest release with the all.xcodeproj is 1.0.145.65. I haven't found a copy of chrome.xcodeproj in any of the sources.

Comment by stuart.morgan, May 19, 2009

The Xcode projects are generated from the gyp files on checkout. If for some reason that step didn't run for you, you can generate them with 'gclient runhooks --force'

Comment by youwantjosh, May 20, 2009

Thanks, I pulled it again normally using gclient. It converted the files. I'm compiling now.

Comment by dririan, May 30, 2009

I pulled the source (with a green waterfall), and found no .xcodeproj files. I ran 'gclient runhooks --force', and it gave no output, yet no Xcode projects were made. Am I doing something wrong?

Comment by spleeman, Jun 03, 2009

I'm having a similar issue. No .xcodeproj files. The output of gclient runhooks --force is below:

gclient runhooks --force

________ running '/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python src/tools/gyp/gyp_dogfood src/build/all.gyp' in '/Users/splee/projects/chromium'
/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python: can't open file 'src/tools/gyp/gyp_dogfood': [Errno 2] No such file or directory
failed to run command: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python src/tools/gyp/gyp_dogfood src/build/all.gyp