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.
HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2015-12-29, 20:46

hg clone --rev FIREFOX_AURORA_XX_BASE https://hg.mozilla.org/mozilla-central (where XX = the version)

I hear ya, and the older tools/SDKs are something I was concerned about. I have the 10.5 and 10.6 SDKs on my system already, but according to the page I've been using, the build process needs the 10.7 SDK or newer, and since I'm on 10.9, I figured I'd be ok. (Thanks for the links though! They may still come in handy in all this.)

BUT....BUT...BUT...

I just built rev 29 FF successfully, so I think that will be good enough! *fingers crossed*

Now two of us can build FF, so we're getting somewhere!
Sasparilla wrote: 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 and update). 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).

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-29, 21:45

HarmonicResonance wrote:hg clone --rev FIREFOX_AURORA_XX_BASE https://hg.mozilla.org/mozilla-central (where XX = the version)

I hear ya, and the older tools/SDKs are something I was concerned about. I have the 10.5 and 10.6 SDKs on my system already, but according to the page I've been using, the build process needs the 10.7 SDK or newer, and since I'm on 10.9, I figured I'd be ok. (Thanks for the links though! They may still come in handy in all this.)

BUT....BUT...BUT...

I just built rev 29 FF successfully, so I think that will be good enough! *fingers crossed*

Now two of us can build FF, so we're getting somewhere!
I know, right!?! Thanks for the Mercurial syntax...I have no clue with that at this point. Good pointing out the 10.7 (Lion) SDK...requirement.

I wonder if all we need is to install the 10.7 SDK (on 10.9) and we'd be good? I'd much rather work in Mavericks since its getting updates than old Lion.

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-30, 10:57

You'll definitely need to extract an older SDK from the old Xcodes, there's some links out there on how to do this. Official Firefox builds are done against 10.7 or 10.8 IIRC.**

I haven't had a lot of luck on my end. I tried using Homebrew's older GCC's, but they don't set themselves up correctly to build with the old SDKs. I might try seeing if I can somehow get the older Command Line Tools instead, as I've tried building using Clang and I run into different problems every time, and of course that'll probably ultimately be fruitless because Pale Moon doesn't build against Clang on Linux because it doesn't work (I'm assuming at runtime, though).

I'm starting to think that getting 10.7 or 10.8 running in a VM and building against that would be the easiest way to go.

**: While writing this post, I realized that Mozilla's build instructions page for the Mac is based on modern version of Firefox. Back in 2013, Mozilla did their builds against the 10.5 SDK. Maybe I ought to try that, and perhaps finding the Mozilla build tools from that era...

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2015-12-31, 01:11

asimperson wrote:You'll definitely need to extract an older SDK from the old Xcodes, there's some links out there on how to do this. Official Firefox builds are done against 10.7 or 10.8 IIRC.**....


So much good knowledge in your post asimperson...thank you. Let us know what you find for Mozilla build tools from then if you find anything. Sounds like we definitely have 3 people actively working on this (and at least 2 with some good Mac/Firefox dev knowledge - leaving myself out of that count...), makes me very happy.
asimperson wrote:...and of course that'll probably ultimately be fruitless because Pale Moon doesn't build against Clang on Linux because it doesn't work (I'm assuming at runtime, though). I'm starting to think that getting 10.7 or 10.8 running in a VM and building against that would be the easiest way to go.
**: While writing this post, I realized that Mozilla's build instructions page for the Mac is based on modern version of Firefox. Back in 2013, Mozilla did their builds against the 10.5 SDK. Maybe I ought to try that, and perhaps finding the Mozilla build tools from that era...
That 2013 Firefox build page is awesome as a reference from that timeline. The issue of Pale Moon on Linux not building/working successfully with the Clang compiler is the thing that sits at the back of my mind with regards to us getting a working build process of OS X Firefox that will translate easily to Pale Moon’s OS X build/run requirements.

I found the following, here: https://en.wikipedia.org/wiki/Xcode#Composition

“Up to Xcode 4.1, the Xcode suite included a modified version of the GNU Compiler Collection. In Xcode 3.1 up to Xcode 4.6.3, it included the llvm-gcc compiler, with front ends from the GNU Compiler Collection and a code generator based on LLVM.[9] In Xcode 3.2 and later, it included the Clang C/C++/Objective-C compiler, with newly-written front ends and a code generator based on LLVM, and the Clang Static Analyzer.[10] Starting with Xcode 4.2, the Clang compiler became the default compiler,[11] Starting with Xcode 5.0, Clang was the only compiler provided.”

The takeaways I got from this:

A pure GCC compile option (not default compiler) was included through Xcode 4.1.x (Xcode 4.1 came out the day of OS X 10.7 Lion’s release).

A GCC/LLVM hybrid (that supposedly was very pure GCC compatible & should hopefully work for us) was the default through Xcode 4.1.x and as an option through Xcode 4.6.x. And right, LLVM is from the folks that made the Clang compiler. :crazy:

From Xcode 4.2 onward Clang became the default compiler and from Xcode 5 onward Clang was the only compiler provided.

I have no idea if the LLVM code generator would get us into trouble here (i.e. however it was noted that it produced GCC compatible code) or not…to be able to avoid that we’d have to fall back to Xcode 4.1.x and specify the pure GCC compile option.

Nice article on compiler options (not command line though) in Xcode 3 and 4: http://useyourloaf.com/blog/compiler-op ... -llvm.html

*Update - I've updated my initial post with basic instructions for creating an OS X VM. I've also updated it with my experience installing Xcode 4.1 (giving us a pure GCC compile option) & Command Line Tools (which went more smoothly than 4.3.3 did) into a Parallels Lion VM. Now comes the hard part....figuring out all the old dev tool settings Mozilla was using at that point.

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2016-01-11, 03:26

Firefox rev 24 can be built using Clang, if you're willing to go back to Snow Leopard. I have SL on DVD, so I was able to set it up in a VM and build Firefox. So that works.

Building Pale Moon 24 (first forked version from FF) in SL gets to BUILDSTATUS TIERDIR_START js/src before it dumps. Somehow the Makefile in that directory isn't getting built. It sounds like the JS library isn't getting configured correctly (else there would be a Makefile in there). Not sure why this is happening.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2016-01-13, 15:43

HarmonicResonance wrote:Firefox rev 24 can be built using Clang, if you're willing to go back to Snow Leopard. I have SL on DVD, so I was able to set it up in a VM and build Firefox. So that works.

Building Pale Moon 24 (first forked version from FF) in SL gets to BUILDSTATUS TIERDIR_START js/src before it dumps. Somehow the Makefile in that directory isn't getting built. It sounds like the JS library isn't getting configured correctly (else there would be a Makefile in there). Not sure why this is happening.
Firefox v24 build and a good ways into Pale Moon 24, that is great! :thumbup: You're really almost there, it seems. I've been busy since the holidays, but definitely will make time in the coming days to do this and nose around in the PM 24 build issue.

Couple of questions. Did you try it on Lion or just Snow Leopard? ( I didn't want to throw away my work in the Lion VM unless you already had to give up on it)

Any tips or tricks you've got for getting Firefox v24 building in Snow Leopard? Just manual install everything, pull the v24 source and go?

Did you have to use a Snow Leopard Server DVD or just regular Snow Leopard DVD? At one point Snow Leopard non server wouldn't install to VM's due to a licensing issue. One benefit of Snow Leopard, if we can get Pale Moon building, is that we might be able to build fat binaries for both X86 & PowerPC users....

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2016-01-13, 22:43

I've just tried it on Snow Leopard. I'll create another VM and see if I can get to Lion.

After installing all the needed tools (including XCode 3.2 and XQuartz), I did have some environmental issues in pointing to the right versions of compilers, but aside from that, the build was straight ahead. Manual everything.

Here's my .mozconfig file:

Code: Select all

CC=gcc
CXX=g++
CPP=cpp

. $topsrcdir/build/macosx/mozconfig.common

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
ac_add_options --disable-optimize


I used the SL DVD. Virtualbox had no problems with it. :D Yes, fat binaries would be a cool option!

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2016-01-15, 20:09

Ok, now I've built FF rev 24 on Lion (XCode 4.1). Only problem is that the build crashes right after launch - reliably. I've built against the 10.5 SDK with no change in behavior.

Code: Select all

2016-01-15 15:43:23.698 firefox[59856:9503] invalid pixel format
2016-01-15 15:43:23.699 firefox[59856:9503] invalid context
2016-01-15 15:43:23.699 firefox[59856:9503] invalid pixel format
2016-01-15 15:43:23.699 firefox[59856:9503] invalid context

###!!! [Parent][SyncChannel] Error: Value error: message was deserialized, but contained an illegal value

###!!! ABORT: constructor for actor failed: file /Users/phoenix/Firefox/mozilla-central/obj-x86_64-apple-darwin11.4.2/ipc/ipdl/PCompositorChild.cpp, line 403
###!!! ABORT: constructor for actor failed: file /Users/phoenix/Firefox/mozilla-central/obj-x86_64-apple-darwin11.4.2/ipc/ipdl/PCompositorChild.cpp, line 403
Segmentation fault: 11
One thing I noticed is that in macports -upgrade outdated did not finish, crashing when it tried to install harfbuzz-icu (an opentype library).

Curiously, the Lion build dumps out complaining about pixel format. Related? I dunno, but the cure for getting harfbuzz-icu working is to upgrade XCode, which puts the compilation type (GCC at the moment) in doubt. See https://trac.macports.org/ticket/50254.

I've looked at the code in Firefox where the error occurs and it's nothing obvious.

Any ideas? Should our minimum build specs be XCode 4.3 or higher?

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2016-01-18, 01:22

Edited - updated build steps - complete now
!!! S U C C E S S !!!! :D :D :D

Pale Moon Mac OS on Snow Leopard is ALIVE!

It was a matter of doing a few adjustments to the build process, some environmental tweaking, and adjusting the mozconfig file, but PM 24.0 for Mac builds out of the box, provided you can also build Firefox on the same box.

Pre-reqs: MacPorts for SL (with libidl, yasm, autoconf213, gcc 4.5.4, clang 3.4.2), XCode 3.2 w/ command-line tools, SL fully updated to 10.6.8,

.mozconfig file:

Code: Select all

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options NIGHTLY_BUILD=1
ac_add_options --enable-application=browser
ac_add_options --disable-crashreporter
ac_add_options --disable-accessibility
ac_add_options --disable-parental-controls
ac_add_options --disable-webtrc
ac_add_options --disable-tests
ac_add_options --disable-mochitests
ac_add_options --disable-logging
ac_add_options --disable-optimize
ac_add_options --enable-jemalloc
ac_add_options --x-libraries=/usr/lib

export CC=clang
export CXX=clang++
export CPP=cpp
I had to copy several files from a successful Firefox build. When I did this, they copied from the same directory path in FF to PM.

Build process (jerry-rigged):

1. Get PM 24 from source and unpack it in /Users/YOUR USER NAME/PaleMoon/pmsrc
2. cd to PaleMoon/pmsrc
3. create the .mozconfig as above and save it
4. Copy the FF dbm dir to /pmsrc/security/nss/lib
5. Copy the 3 dylib libs:
libmozglue.dylib to /pmsrc/obj*/mozglue/build
libmozalloc.dylib to /pmsrc/obj*/memory/mozalloc
libnss3.dylib to /pmsrc/obj*/security/build
6. Copy CSS2Properties.webidl to /pmsrc/obj*/dom/binding
7. ./mach build -- this build fails, but it creates the dir in the next step
8. cd /pmsrc/obj-x86-64-apple-darwin10.8.0/browser/branding/nightly
9. In the file "Makefile", comment out the four lines that define the DIRS variable
10. cd ~/PaleMoon/pmsrc/js/src/config
11. cp emptyvars.mk ~/PaleMoon/pmsrc/config
12. cd to pmsrc
13. ./mach build

The application is in /pmsrc/obj-x86-64-apple-darwin10.8.0/dist/Nightly.app/Contents/MacOS/palemoon/browser/branding/nightly/palemoon

Note 1: the makefile hackery you only have to do once. Subsequent builds work just with ./mach build

Note 2: it does display some non-fatal errors on stdout over and over --

invalid pixel format
invalid context

I suspect this is due to the VM settings I'm using...
You do not have the required permissions to view the files attached to this post.
Last edited by HarmonicResonance on 2016-01-31, 09:00, edited 3 times in total.

User avatar
LimboSlam
Board Warrior
Board Warrior
Posts: 1029
Joined: 2014-06-09, 04:43
Location: USA

Re: Quest to create a reliable OS X build

Unread post by LimboSlam » 2016-01-18, 03:23

Nice! When will we able to download it and where? I'm getting a Mac soon and I don't know much around the OS.
With Pale Moon by my side, surfing the web is quite enjoyable and takes my headaches away! :)
God is not punishing you, He is preparing you. Trust His plan, not your pain.#‎TrentShelton #‎RehabTime

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2016-01-18, 14:08

HarmonicResonance wrote:!!! S U C C E S S !!!! :D :D :D

Pale Moon Mac OS on Snow Leopard is ALIVE!

It was a matter of doing a few adjustments to the build process, some environmental tweaking, and adjusting the mozconfig file, but PM 24.0 for Mac builds out of the box.

Pre-reqs: MacPorts for SL (with libidl, yasm, autoconf213, gcc 4.5.4, clang 3.4.2), XCode 3.2 w/ command-line tools, SL fully updated to 10.6.8,

.mozconfig file:
.....
The application is in /pmsrc/obj-x86-64-apple-darwin10.8.0/dist/Nightly.app/Contents/MacOS/palemoon/browser/branding/nightly/palemoon
....
What can I say, totally awesome!!!! :thumbup: :clap:

You are the man! What an accomplishment! Thank you for the details you did to get it there.

That screenshot is beautiful.

I'll create a Snow Leopard VM, duplicate and document it (I'll try to do that this week). After that I'll try Lion...but that's a nice to have at this point.

Awesome job HarmonicResonance.
LimboSlam wrote:Nice! When will we able to download it and where? I'm getting a Mac soon and I don't know much around the OS.
Hi LimboSlam, there isn't a downloadable copy and won't be for a while. This is actually for an out of date version of PaleMoon (v24...current Pale Moon version is v25.8 I believe) so you wouldn't want to use it because of the security holes in it... That said, this is a huge leap towards a OS X version considering this was a dead platform a month or so ago.

The next step, is getting rid of the non fatal errors and then working on updating this OS X build from v24 to the current version (may have to do that in stages)....once we can reliably build the current OS X version of Pale Moon then we'll get to talk with MoonChild and try to figure out how to make this work for regular users (guessing this will be a couple of months...but we'll see...what a step forward by HarmonicResonance).

sugis

Re: Quest to create a reliable OS X build

Unread post by sugis » 2016-01-21, 23:16

Man, I wish I'd seen this thread sooner! Sounds like we might have duplicated some work. But I managed to get a fully up-to-date Pale Moon building on Mac 10.8!
Please check it out here: viewtopic.php?f=41&t=10789

There are some minor build issues that cause the master branch to not build, but I have a branch that sorts it out... please feel free to follow up with me if you'd like to collaborate further. (I don't check the forums much but I'll watch this thread, DM, or email should all work fine)

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

Re: Quest to create a reliable OS X build

Unread post by Moonchild » 2016-01-23, 00:52

Please offer pull requests of your workbranch so we can merge it back into the main repository :)
"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

sugis

Re: Quest to create a reliable OS X build

Unread post by sugis » 2016-01-24, 02:16

I certainly will! They are not really in shippable state right now, lots of ugly things i.e. the ancient clang does not understand AVX2 instructions / types so I just commented them out...
But the list of needed changes is small, and I'll file issues and PRs as I can.

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2016-01-26, 14:42

sugis wrote:Man, I wish I'd seen this thread sooner! Sounds like we might have duplicated some work. But I managed to get a fully up-to-date Pale Moon building on Mac 10.8!
Please check it out here: viewtopic.php?f=41&t=10789

There are some minor build issues that cause the master branch to not build, but I have a branch that sorts it out... please feel free to follow up with me if you'd like to collaborate further. (I don't check the forums much but I'll watch this thread, DM, or email should all work fine)
Hello sugis, congratulations and welcome. So you did the build in Mountain Lion (OS X v10.8)?

We're trying to document (and replicate) the OS X build process (the prior 2 OS X maintainers didn't do that, so when they left the project the OS X build effort died).

When you have a moment could you detail what you installed and any settings (things commented out in the build files etc.) or issues you ran into to get a working build for us?

I'll try to replicate it on my machine and then document it at the beginning of this thread.

sugis

Re: Quest to create a reliable OS X build

Unread post by sugis » 2016-01-26, 22:19

Sure thing. My goal is that instead of having custom fixes locally, we should get them all onto master. I think I've got about half of that work done.
As far as setting up the build environment, yeah, that should really be documented.

From memory, the important steps were:
* Get 10.8 installed
* Get XCode installed (I used 5.1.1)
* Get HomeBrew
- autoconf213
- ccache
- pkg-config
- yasm

Then you should be able to run:

export MOZCONFIG=$(pwd)/build/macosx/universal/mozconfig
./mach build
./mach package

and get a distributable DMG!
(Note that right now only my 'macosx' branch will work, but I am actively working on getting all those changes to master)

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2016-01-27, 03:09

sugis wrote:Sure thing. My goal is that instead of having custom fixes locally, we should get them all onto master. I think I've got about half of that work done.
....
....
(Note that right now only my 'macosx' branch will work, but I am actively working on getting all those changes to master)
Thank you sugis, I'll let you get back to working on getting the changes pushed. I look forward to being able to do the build locally when you get there.

sugis

Re: Quest to create a reliable OS X build

Unread post by sugis » 2016-01-27, 07:36

I'm keeping my branch here:
https://github.com/stevenschlansker/Pale-Moon

Jenkins builds it regularly, will switch to the master once it's all merged in:
http://universe.sugis.org:8180/jenkins/job/palemoon/

Would love to hear if you are able to clone it and build.
Also, could use any feedback on my PRs, I'm not exactly a Mozilla codebase expert...
https://github.com/MoonchildProductions ... schlansker

Sasparilla

Re: Quest to create a reliable OS X build

Unread post by Sasparilla » 2016-01-28, 01:17

sugis wrote:I'm keeping my branch here:
https://github.com/stevenschlansker/Pale-Moon

Jenkins builds it regularly, will switch to the master once it's all merged in:
http://universe.sugis.org:8180/jenkins/job/palemoon/

Would love to hear if you are able to clone it and build.
Also, could use any feedback on my PRs, I'm not exactly a Mozilla codebase expert...
https://github.com/MoonchildProductions ... schlansker
Thank you sugis, I will try to clone and build it. I'm busy this week but will work on it any chance I get.

I haven't created a Mountain Lion VM but to keep the variables down, I'll create one (I'll have created almost all releases since SL available then ;) ) and then clone and build.

If that goes successfully I'll try it on other OS X versions (since some of the other guys are working in other versions of the OS - Snow Leopard, Lion and Mavericks). But first things first.

Harmonic you out there? We've got a building v26 source to pull from now!

HarmonicResonance

Re: Quest to create a reliable OS X build

Unread post by HarmonicResonance » 2016-01-31, 09:11

Wow, this is great news!!! :D :D :D

Sugis - Congrats man! :thumbup: :thumbup: :thumbup: I'll clone the branch and get building. I see you built for universal. Wish I had gone down that road. I think that must get around some of the issues I ran into...

Sasparilla - had a massive project at work (11+ hour days) so I just came up for air. Also I wanted to confirm my build process, so I went and built from scratch and added a few things. It's jerry-rigged, but it works.

Anyhow, I'll throw up one more post that hits the issues I ran into just for completeness, and then get to building the PMv26. :D