Quest to create a reliable OS X build

Discussions for the Apple Mac OS builds of Pale Moon

Moderator: dbsoft

Forum rules
Important note:
The old Mac OS versions of Pale Moon were provided by various people and not official or in any way organized. Please make sure you check the date of topic threads to know if the topic is current or relevant! We are using this board for both old discussions and new development of Pale Moon on Mac.

Any specific bugs you find that don't have their own topic yet: please make a new topic; one bug per topic please to keep things organized.
Sasparilla

Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-06, 04:13

Creating a OS X forum thread dedicated to producing a documented and reliable OS X Build (compile and link without errors & warnings) - doesn’t mean a working application, that’s the step after (and another forum thread by then). Slow and steady is going to be my race on this one (full time job & full time family), anyone else that wants to join in (or has done this before) please join in. Don’t have a background in Mac programming, but command line compile and link is an old friend (which this is mostly it appears) - and I have this Mac I can use.

I’m doing some research here initially. Following HarmonicResonance's lead (1st successful Firefox build - page 1), I successfully completed a current Firefox build on a VM (Parallels virtual machine - 8GB RAM & 2 CPU Cores allocated to it) on a Mac (prior generation Mac Pro single CPU - 6 cores - with 16GB RAM running OS X 10.11 El Capitan) - while slower than just using a non Virtual Machine environment (see HarmonicResonance's build time below) it still worked quite well (48 minutes to build successfully). This was good for getting familiar with a documented and working OS X build setup and process that will be somewhat similar to Pale Moon’s and validated doing this on a VM - this worked well and makes it easier for folks that want to help to jump in without making their normal home machine customized for Firefox / Pale Moon development (particularly since we may need to use a Lion 10.7 environment (not getting security updates anymore) to build a Firefox v24 or earlier process - after which Firefox's build / code changed significantly).

Next step will be to successfully build from Firefox v24 (time frame early to mid 2013) after which Firefox's build diverged from Pale Moon's.

What you'll need to build current Firefox without using a Virtual Machine - Quad Core Mac (you might be able to get away with a Dual Core, but I'd want to hear from someone first before recommending that), 8GB RAM (More RAM the better), 20 GB of disk space (Xcode etc. then add in Firefox source etc.) and you always want additional free disk space left over (20GB+) so the OS can increase its swap file size if needed.

To build with a Virtual Machine you'll want - Quad Core Mac (you'll be assigning 2 of these cores to the VM, so you have to have a Quad if you try to do the VM route), 16GB RAM (8GB goes to the VM) and lots of free disk space - each VM instance will need 30GB or so after all is said and done (you have to add a full OS installation in there)...and of course its good to back up (copy off to another folder) your VM environment as you go along setting it up...so you can go back and go a different route if needed. You also need the OS installation file for the OS you want to use.

Instructions on VM OS X installation at the bottom of this post.

Nice page on Xcode in Wikipedia showing versions & historic details: https://en.wikipedia.org/wiki/Xcode

Based on asimperson's post (page 2) and noted elsewhere the Linux Pale Moon build will not successfully work with the newer Clang compiler...they still need to use the GCC compiler. asimperson also detailed what was being used for the Firefox build at v24 (probably similiar to Pale Moon prior to Firefox divergence) against the OS X 10.5 SDK and linked to the setup page of that time: https://developer.mozilla.org/en-US/doc ... ion/410177

As noted on page 2 a pure GCC compile option (wasn't the default) dissapeared after Xcode 4.1. A hybrid GCC/LLVM hybrid compile option, which was supposedly very compatible with GCC and might work(?), dissapeared after Xcode 4.6. I've installed a working Xcode 4.3.3 & Command Line Tools in a Lion VM (there were Xcode setup issues but you could work through them), however based on the forum conversations with asimperson & HarmonicResonance (page 2) we may need a pure GCC compile option so I will install Xcode 4.1 and its associated Command Line Tools in a Lion VM and detail the setup issues I run into (so others can benefit).

To obtain the out of date Xcode and Command Line tools please go to this Apple Website and use the search facility towards the top of the page (i.e. search "Xcode 4" or "Command Line Tools"):

https://developer.apple.com/downloads/

Xcode 4.1 (installxcode_41_lion.dmg) and Command Line Tool Installer (cltools_lion_march12.dmg) actually install very well in Lion - much better than Xcode 4.3.3 did. You'll get expired certificate warnings for both (cause they are so old) but you can ignore them and proceed with the installation which appears successful (Xcode runs fine). One note about the Xcode 4.1 installer (which is differen than later installers), this installs a Xcode 4.1 installer into your Applications directory - which you then have to launch from the Application directory and finally you'll get Xcode 4.1 installed and an icon placed on your dock. Of note, is that I could not visually see the Xcode 4.1 application in the Applications directory even though the icon in the Dock said it was there. Xcode appears to run fine & command line tools install appears to find it, so I'll ignore this issue.

How to use a Mac VM to run another copy of OS X
One note, the user experience is almost perfect for me...the only niggle in it is that occasionally I'll click on a drop down in the VM and it'll close itself, not enough to bother me.
Mac Virtual Machine Vendors (basic application is $79 from either, that's all you need, and both support running a Mac environment from within it, although I've only used Parallels & install notes will be for Parallels).

http://www.parallels.com/products/desktop/
http://www.vmware.com/products/fusion/

You'll need the OS X install file if you are going the VM route (Snow Leopard requires a Server DVD, which Apple still sells I believe, but Lion and beyond are all downloadable install files), if you've installed the version of OS X you want in your VM before or have a machine that came with it, your Apple ID should allow you to download it again (App Store look under "Purchased" - if it shows "downloaded" Google is your friend and you can get around it). Now if you want to run Lion, but you haven't installed it before (and don't have a Mac that used it) then you'll need to shell out the $19 and get the OS download (if you're doing a VM don't let it install after it downloads, it automatically starts, cancel the installation and the install file will remain on your system your Applications folder): http://www.apple.com/shop/product/D6106Z/A/os-x-lion#
  • Make sure you've got 16GB of RAM.
  • Install Parallels. Make sure it has the latest updates.
  • With the newer versions of Parallels all you need in the OS X install file (above) and you're good...no need to make a bootable drive for it etc..
  • Start Parallels and choose "File / New" (or the + on the Parallels Desktop Control Center) and an install screen will pop up ready to guide you to install Windows and other OS's.
  • Click on “Install Windows or another OS from a DVD or image file” then click “Continue”.
  • Parallels automatically looks in your Applications folder and lists the OS X installs it finds (this is where OS X puts the OS installers by default...but you have to have cancelled their initial, non Parallels, installation or they get deleted by OS X on completion of their initial installation).
  • You can also choose “Locate Manually” and find your install file if its not listed.
  • Click on your OS X Install file and then click “Continue” again and the OS X installation will start and proceed like it would on your normal computer (requiring your interaction for language etc.).
  • Now, after completion, if you resize the OS window you’ll notice it doesn’t scale...yuck, this looks awful. You’ll notice a yellow triangle with a “!” at the top of the VM’s window. We have to install the Parallels Tools (that integrates the VM into your desktop so it looks nice) for OS X (clicking on the yellow triangle often starts the process but if not use this as a reference): http://download.parallels.com/desktop/v ... /27001.htm
  • Once completed, restart the VM, then be sure and update the OS to get that latest updates it has available (I skip iTunes).
  • You’ll be able to resize the VM window and things look nice. There are also Parallels integration tools for Windows VM’s and Linux VM’s.
  • Now go into OS X system preferences / settings from within your running OS X VM, click Energy Saver and move the Computer sleep slider to Never and uncheck the “Put the hard disk(s) to sleep whenever possible" – this prevents your VM from putting your HD’s and itself to sleep while your doing a big long Firefox build (I noticed this problem 20 minutes into a build :shock: ).
  • Shut down the VM (you just shut down your OS X in the VM window like you normally would in OS X). Click on the settings symbol (a gear) for the VM, select “Hardware”, choose CPU and Memory at the top. Make sure 2 processors (only allocate ½ your active processors this is why you need a quad to do a VM) and ~8000 MB Memory (again only allocate at most ½ of your active RAM and you’ll need 6-8GB for your VM here if its Lion) is allocated to the VM...now you should be good to install Xcode and the Firefox build environment.
  • Last thing after all this work, shut down Parallels, go find the VM you just created and make a copy of it to another (backup) folder/drive that you can get to (make sure you have the hard drive space, it’ll probably be between 20-30GB at this point). This if way if something gets messed up later on, or you want to change something in your Dev setup, you can just delete the current one, copy this one back in and be good to go.
Last edited by Sasparilla on 2015-12-31, 21:42, edited 9 times in total.

asimperson
Moonbather
Moonbather
Posts: 52
Joined: 2015-11-30, 05:31
Location: San Francisco, CA

Re: Quest to create a reliable OS X build

Unread post by asimperson » 2015-12-06, 04:25

Do the supported builds compile without warnings? Otherwise, this might be a bit quixotic.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-06, 04:43

asimperson wrote:Do the supported builds compile without warnings? Otherwise, this might be a bit quixotic.
My initial post actually had "or at least acceptable ones" (referring to warnings and errors) in it but figured I'd leave it out to cut the post size down and not be so pedantic. That said, there's certainly an aspect of tilting at windmills here....but I've been looking for a reason to get into trouble on this Mac anyways and am hoping someone with a better Mac development background than I joins in at some point.

I wanted to mention my reasoning for creating this thread (hopefully to help pull others in as time goes on) that is separate from the technical initial post above:

As Moonchild said in the OS X forum Various Bugs and Annoyances thread: "It's great to see the willingness to contribute to make this happen, but there's a more valuable commodity missing than just money or hardware -- it is someone to actually build and maintain the Mac version. We need someone to actually step up and take over the torch from BitVapor; he's obviously not going to come back to the project, which will be the second person to start on Mac versions to just walk out on us. We simply don't have anyone in our current team that can take up this task; we're all already busy with our designated part of providing Pale Moon and all of the added services."

Finding a person to take over responsibility for creating, developing and supporting an OS X version of Pale Moon could take a very long time (or a short time depending). But while we wait nothing is happening. As I've seen through the forum threads here, there are those individuals with a development background but not the ability (time or capability) to take the place of BitVapor (myself included). So lets break apart the end goal of creating, developing and supporting an OS X version of Pale Moon into small pieces and those that can and want to - work on that first little piece (creating a documented / reliable OS X Build process). The next step after that would be getting the Application to actually work etc...but for now just working on a successful compile and link is a big enough goal.

I'm not a Mac developer (Windows is where I come from), but I do not want the time to tick by with no progress being made here - and I have a Mac I can use for this. Trying and possibly not succeeding seems much better than not trying and surely failing to make any progress towards a working OS X build as the clock ticks by.

I invite any other person that has a development background (especially if you have Mac or Linux development experience), has a Mac (they can add a development partition to or possibly a Virtual Machine - have the check the performance on that...) and wants to help get the OS X build process defined and documented to join in this quest. I've communicated with Moonchild about this and he said we're welcome to work on this.

I would like to ask (just asking) that we try to keep the posts directly related to our goal (as nice as encouragements we might get from interested OS X users would be) we want to keep the thread as short & on target as possible for any new folks that want to come up to speed quickly (reading through it) and join the effort. Thank you.

zippy72

Re: Quest to create a reliable OS X build

Unread post by zippy72 » 2015-12-11, 17:07

I'm also a Windows developer, but I can spare some time to contribute, although my time is pretty heavily allocated out as it is. However I do have some Linux / Unix development experience in the deep and distant past - whether it'll help is a moot point...

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-13, 03:57

Hey Zippy72, anyone that wants to join in is welcome. If you get some time, pick an angle you want to push on and dig in...you'll probably choose to start at a different point than I am, but maybe not.

At this point I'm going down the Firefox build avenue so I get familiar with the OS X build process (been busy this week so not much progress, I just got through an expired certificate installation issue with Xcode in Lion - I hate the idea of expiring software...grrr) and see if we can use VM's to develop on the Mac with. I'm expecting to make more progress with the time off over the holiday.

In the mean time, I noticed that we also have the old (not active - but not too out of date for reference) Camino (OS X only) Browser (based on Gecko) to look at another example of a Gecko based OS X build process: http://wiki.caminobrowser.org/Development:Home_Page

If you scroll down there you'll find their Build Process documented (appears they had great documentation). Downloaded the Camino Theme for Pale Moon for fun - beautiful.

Choose where you want, put whatever time you can spare and dig in. Welcome to the thread.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-14, 22:12

Awesome!! I'm in. I will check out the Camino link (one of my favorite browsers). :D

New Tobin Paradigm

Re: Quest to create a reliable OS X build

Unread post by New Tobin Paradigm » 2015-12-14, 22:22

That info is WAY out of date.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-15, 20:54

Thanks Matt. I know it is way out of date...I did use that browser long ago...only considering it as another (but) old reference on how the Camino people built their Gecko based OS X browser. Only flagging it as I'm guessing we'll be trying to run down OS X only issues and any reference beyond Firefox (and Linux Pale Moon) might be helpful to figure things out, maybe not, but I wanted to mention it since its there.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-16, 00:38

Using this page https://developer.mozilla.org/en-US/docs/Simple_Firefox_build I was able to build FF for Mac. I'm on Mavericks (10.9.5). I've installed hg, XCode, and updated all the needed libraries with macports.

The actual build took about 20 minutes, on Mavericks (10.9.5), 3.5 Ghz Intel i7, 8 Gb RAM, fusion drive.

This was from the shell, using hg.

I didn't add any switches and skipped the optional build configuration step.
Last edited by HarmonicResonance on 2015-12-19, 18:24, edited 1 time in total.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-17, 15:30

Awesome job Harmonic Resonance - 1st one across the line. :thumbup: Thank you for all the details (I'm still working through setup issues on Lion in the little bits of time I can spare).
HarmonicResonance wrote:Using this page https://developer.mozilla.org/en-US/docs/Simple_Firefox_build I was able to build FF for Mac. I'm on Mavericks (10.9.5). I've installed hg, XCode, and updated all the needed libraries with macports.

The actual build took about 20 minutes, on Mavericks (10.9.5), 3.5 Ghz Intel i7, 8 Gb RAM, fusion drive.
Wow that was fast...Meanwhile, back in the world of 20th century tech (regular hard drive, old Mac Pro single CPU) and core restricted VM's, I got tired of fiddling with the build process on Lion (current Firefox won't build on old Lion Xcode) and I created a OS X 10.9 Mavericks VM (8GB RAM, 2 CPU cores) and built Firefox OS X (nightly) successfully in 48 minutes...so the VM option, which is much easier to manage (if we have to go to an earlier version of Xcode) works and works well. My guess is we'll have to go to an earlier version of Xcode that matches the time of Firefox 24 or so when Pale Moon forked off and the build process in Firefox changed significantly thereafter.

Your next step is up to you, but the destination (I'm guessing) is getting from the Linux branch into a successful build for OS X. I was thinking of doing compares (when I get to that point) between the Firefox Linux and Firefox OS X at the build level to get ideas for what might have been added / changed as inspiration for what we might need to add / change...but whatever you feel like doing.
Last edited by Sasparilla on 2015-12-29, 19:23, edited 4 times in total.

asimperson
Moonbather
Moonbather
Posts: 52
Joined: 2015-11-30, 05:31
Location: San Francisco, CA

Re: Quest to create a reliable OS X build

Unread post by asimperson » 2015-12-19, 13:51

HarmonicResonance wrote:Using this page https://developer.mozilla.org/en-US/docs/Simple_Firefox_build I was able to build FF for Mac. I'm on Mavericks (10.9.5). I've installed hg, XCode, and updated all the needed libraries with macports.
Can you post your diffs somewhere? That is the key to getting multiple folks on this.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-19, 18:15

asimperson wrote:
HarmonicResonance wrote:Using this page https://developer.mozilla.org/en-US/docs/Simple_Firefox_build I was able to build FF for Mac. I'm on Mavericks (10.9.5). I've installed hg, XCode, and updated all the needed libraries with macports.
Can you post your diffs somewhere? That is the key to getting multiple folks on this.
That's the stage I'm at. I need to figure out how to get from an FF build to a PM build. I will post them when I get there, though!
Last edited by HarmonicResonance on 2015-12-19, 18:25, edited 1 time in total.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-19, 18:24

Sasparilla wrote:Awesome job Harmonic Resonance - 1st one across the line. :thumbup: If you would, please update your post with any tips, tricks, issues & solutions you ran into while doing that (I'm still working through setup issues on Lion in the little bits of time I can spare). How long did the build take? Did you do it in a Virtual Machine? Hardware you did it on etc..

Your next step is up to you, but the destination (I'm guessing) is getting from the Linux branch into a successful build for OS X. I was thinking of doing compares (when I get to that point) between the Firefox Linux and OS X at the build level to get ideas for what might have been added / changed as inspiration for what we might need to add / change...but whatever you feel like doing.
Ok, sounds good! I updated my post and I'll check out the Linux build. :D

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-22, 03:33

No luck on getting a Linux build of Pale Moon built over here. I think setting up the environment is beyond me -- process fails early on in ./mach configure. It's looking for a version of clang that OS X doesn't use.

Tried doing a diff (using Meld) of the PM source and FF Mac source and there's got to be millions of differences. Meld was ridiculously slow (and it's the best diff tool I've found so far). I have no idea what differences are important and which are not.

I'll keep poking around, but it's going to be slow going...

Thrawn

Re: Quest to create a reliable OS X build

Unread post by Thrawn » 2015-12-22, 04:29

HarmonicResonance wrote:Tried doing a diff (using Meld) of the PM source and FF Mac source
Yeah, Firefox has changed significantly since the version where PM forked.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35478
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Quest to create a reliable OS X build

Unread post by Moonchild » 2015-12-23, 01:27

Thrawn wrote:
HarmonicResonance wrote:Tried doing a diff (using Meld) of the PM source and FF Mac source
Yeah, Firefox has changed significantly since the version where PM forked.
Pale Moon has changed significantly too since the version where we forked off. 8-)
So it compounds.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-23, 16:57

Moonchild wrote:
Thrawn wrote:
HarmonicResonance wrote:Tried doing a diff (using Meld) of the PM source and FF Mac source
Yeah, Firefox has changed significantly since the version where PM forked.
Pale Moon has changed significantly too since the version where we forked off. 8-)
So it compounds.
Anyone have a rough guess as to how far back in Firefox versions you'd have to go to have a similar (not identical) build process to Pale Moon? 24? 5? Somewhere in between?

Supernova

Re: Quest to create a reliable OS X build

Unread post by Supernova » 2015-12-26, 21:05

Since Pale Moon was forked at v24, I think it's the closest. Some ports from later FF versions won't offset the big rewrites made on FF side version after version.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-28, 06:06

That is good info. I will try building v24 FF next. Hopefully the number of diffs will be manageable.

UPDATE: I can't get FF v24 to build on the Mac. It dies in QuartzSupport.mm, which is looking for a bunch of constants that are undefined and functions that aren't part of the global namespace. Here's an example:

.../Projects/mozilla-central/gfx/2d/QuartzSupport.mm:667:7: error: no member named 'glTexParameteri' in the global namespace
0:39.52 ::glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
0:39.52 ~~^
0:39.54 .../Projects/mozilla-central/gfx/2d/QuartzSupport.mm:667:49: error: use of undeclared identifier 'GL_TEXTURE_MAG_FILTER'
0:39.54 ::glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

In the GLDefs.h (supplied with FF) there are similarly-named constants, like LOCAL_GL_TEXTURE_MAG_FILTER, but I'm not sure adding these one by one is the way to go. It looks like some file is missing, but I can't figure out what.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-29, 20:20

HarmonicResonance wrote:That is good info. I will try building v24 FF next. Hopefully the number of diffs will be manageable.

UPDATE: I can't get FF v24 to build on the Mac. It dies in QuartzSupport.mm, which is looking for a bunch of constants that are undefined and functions that aren't part of the global namespace. Here's an example:

.../Projects/mozilla-central/gfx/2d/QuartzSupport.mm:667:7: error: no member named 'glTexParameteri' in the global namespace
0:39.52 ::glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
0:39.52 ~~^
0:39.54 .../Projects/mozilla-central/gfx/2d/QuartzSupport.mm:667:49: error: use of undeclared identifier 'GL_TEXTURE_MAG_FILTER'
0:39.54 ::glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

In the GLDefs.h (supplied with FF) there are similarly-named constants, like LOCAL_GL_TEXTURE_MAG_FILTER, but I'm not sure adding these one by one is the way to go. It looks like some file is missing, but I can't figure out what.
Quick question (if the answer is straightforward), how do you (example?) get the older Firefox Build from Mercurial?

Hmmmnnn, you know since Firefox 24 was released in September of 2013 the build process might depend on Xcode / Mac libraries from that time period - (Snow Leopard, Lion and Mountain Lion were the current supported OS's at that point) and there were a couple of versions of Xcode that were compatible across Lion and Mountain Lion.

I'm thinking that the old Xcodes probably won't install on the newer OS's, but that's just a guess (I'll verify that - Update - bit of a bummer Xcode 4.6.3 installed and appeared to run just fine on Mavericks, but the associated command line tools, which I'm guessing we'd need would not...Lion only it says). The last Xcode and associated Command Line tools that were compatible with Lion and Mountain Lion (from that time frame) was Xcode 4.6.3. The last Xcode that was compatible with Snow Leopard and Lion was 4.3.3 (which may work as well). Here is the site for downloading old versions of Xcode / Command Line tools (which would have to be downloaded separately):

https://developer.apple.com/downloads/

I successfully built the current nightly Firefox on a Parallels ($79) 8GB & 2 core OS X 10.9 Mavericks VM...much slower than your machine (its an old Mac Pro) and while it took a while (48 minutes) it was successful and being able to manage and backup the VM's is very nice when they are an out of date OS (like what we might need to do here). I'm sure VMware would work well too, although it was more expensive when I looked (several years ago).

Here is the site with links to older versions of OS X if you don't already have them (Parallels just makes use of the installation files):

http://www.apple.com/shop/help/downloadable_software

I've got some other stuff to do, but later I'll update my post at the beginning with more details for setting up a Parallels VM (its actually quite painless...the older dev stuff is the sticky wicket in all of it).
Last edited by Sasparilla on 2015-12-31, 14:25, edited 1 time in total.

Locked