Skip to content

building from the source

Feodor2 edited this page Oct 3, 2020 · 2 revisions

I use windows, sure you can use linux, but further all that about will be for windows only. Original build manual you may want to read too. https://forum.palemoon.org/viewtopic.php?f=5&t=19685

Hardware

Certainly more powerful computer you have more faster building your will get then, consider two cores CPU and 4G RAM will be sufficient. Also i suggest to have two hdds, the first for source, compiler, build tools and the second for output.

Virtual drive

If you have more RAM it is good to make virtual drives, no need second hdd then. Consider 2gb required for the source, and 5 - for the output.

Software

Github

Download at https://git-scm.com and install, i did not try portable, but you can i think.

Compiler

I do not like regular Visual Studio, with its junk and onlineness requirement, so i do not use it. Good Microsoft cares for me too, and made available good build tools without junk. They are in the iso file, and ready for usage anywhere, no need to do install. Download, unpack or mount iso. EWDK with Visual Studio Build Tools 15.6 You may want to know that is more recent version of EWDK was released, but it has 12G size, i shall try it eventually, if possible to cut redundant shit from there. EWDK for Windows 10, version 1809

I tried it, build failed, and i did not want bother with that

I concerned with mingw compiler more. I started use that i686-win32-dwarf version, can use it on winxp.

DirectX SDK

Download june 2010 and install

Mozilla build tools

i use version 3.2. But for building on winxp the latest version is 2.2 You are to craft own bat file for use with alternate compiler. Write your actual paths there and put inside MozillaBuild floder (C:\mozilla-build)

Bat file

@ECHO OFF
SET MOZ_MSVCBITS=32
SET MOZ_MSVCVERSION=14
SET MOZ_MSVCYEAR=2015
SET VCDIR=C:\DEV\MSVC14\
SET TOOLCHAIN=32-bit
SET MOZILLABUILD=%~dp0
SET MOZ_TOOLS=%MOZILLABUILD%moztools
SET VSINSTALLDIR=C:\DEV\MSVC14
SET VCINSTALLDIR=C:\DEV\MSVC14
SET FrameworkDir32=C:\Windows\Microsoft.NET\Framework\
SET FrameworkVersion32=v4.0.30319
SET Framework40Version=v4.0.30319
SET UCRTVersion=10.0.17763.0
SET WindowsSDKLibVersion=10.0.17763.0\
SET INCLUDE=C:\Dev\MSVC14\include;C:\Dev\MSVC14\atlmfc\include;C:\Dev\Windows Kits\10\include\shared;C:\Dev\Windows Kits\10\include\10.0.17763.0\um;C:\Dev\Windows Kits\10\include\10.0.17763.0\winrt;C:\Dev\Windows Kits\10\include\10.0.17763.0\ucrt;
SET LIB=C:\Dev\MSVC14\lib\x86;C:\Dev\MSVC14\atlmfc\lib\x86;C:\Dev\Windows Kits\10\lib\10.0.17763.0\um\x86;C:\Dev\Windows Kits\10\lib\10.0.17763.0\ucrt\x86;
SET LIBPATH=C:\Dev\MSVC14\lib\x86;C:\Dev\MSVC14\atlmfc\lib\x86;C:\Dev\Windows Kits\10\lib\10.0.17763.0\ucrt\x86;
SET PATH=C:\Dev\MSVC14\bin\Hostx64\x86;C:\Dev\MSVC14\bin\Hostx64\x64;C:\Dev\Windows Kits\10\bin\10.0.17763.0\x86;%PATH%

SET SDKDIR=C:\Dev\Windows Kits\10\
SET WINDOWSSDKDIR=C:\Dev\Windows Kits\10\
set  "UCRTContentRoot=%WDKContentRoot%"
set  "UniversalCRTSdkDir=%WDKContentRoot%"
%MOZILLABUILD%msys\bin\bash --login -i

There is andother file for mingw, look the issue #126

Other software

For virtual drive SoftPerfect RAM drive free

Source

This command points to download source code with all commits, useful when you want cancel commits.
C:\dev\git\bin\git clone https://github.com/Feodor2/Mypal.git
This command points to download only actual release code without history, the point is less traffic usage.
C:\dev\git\bin\git clone -b Pale_Moon-release --depth 1 https://github.com/Feodor2/Mypal.git

Building

.mozconfig

Create your own file, see below, pay attention MOZ_OBJDIR and application. When you set MOZ_OBJDIR on another drive, i want do so to lower the hdd oppression. You will get stupid error about this, but it can be fixed, see below.

mozconfig example

mk_add_options MOZ_OBJDIR=d:/dev/uxp.32
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --with-distribution-id=MCP
ac_add_options --enable-release
ac_add_options --enable-application=application/basilisk
ac_add_options --enable-optimize="-O2 -GF"
ac_add_options --enable-jemalloc
ac_add_options --disable-debug
ac_add_options --enable-strip
ac_add_options --enable-devtools
ac_add_options --disable-accessibility
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-skia
ac_add_options --disable-tests
ac_add_options --disable-webrtc
ac_add_options --disable-webspeech

#WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86

ac_add_options --disable-crashreporter

# Disable the updater unless you have set up the infra and preferences for it correctly!
ac_add_options --disable-updater`

# Disable add-ons signing
# Disable checking that add-ons are signed by the trusted root
MOZ_ADDON_SIGNING=
# Disable enforcing that add-ons are signed by the trusted root
MOZ_REQUIRE_SIGNING=

# Disable telemetry reporting
export MOZ_TELEMETRY_REPORTING=

#WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86
WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86/Microsoft.VC141.CRT
WIN_UCRT_REDIST_DIR="C:/dev/WinKits/8.1/Redist/ucrt/DLLs/x86" 

There is andother file for mingw, look the issue #126



Do this if you want stable release
C:\dev\git\bin\git checkout Mypal_Release -f or
C:\dev\git\bin\git checkout Centaury_Release -f
otherwise you will build unstable version.
And pay attention on ac_add_options --enable-application= which is application/basilisk or application/palemoon
If you are to apply pathces use a command
C:\dev\git\bin\git apply --ignore-whitespace <patch file>

Next launch your bat file inside mozillabuild

You will see terminal window where execute following commands
cd /b/uxp
/b/uxp is path to source code, in this case it is on my virtual drive b and uxp folder.
then
.\mach build

So it begins, if you set another destination drive building will stop with message: (The error will be fixed soon)

skip if you did not set another drive

1:23.14 ValueError: path is on drive b:, start on drive d:
1:23.18 *** Fix above errors and then restart with\

Well, let them fix: edit the following file on the output path
d:\dev\uxp.32\_virtualenv\Lib\ntpath.py
go to the lin 527 and put # signs, this will cancel the stupid code

#        else:
#            raise ValueError("path is on drive %s, start on drive %s"
#                                                % (path_prefix, start_prefix))

Keep then _virtualenv to not bother with this again



As you may know building occupy all computer power you have, therefore you hardly can do other things. But if you really want you can sacrifice building speed by the option inside mizconfig: mk_add_options MOZ_MAKE_FLAGS="-j1" Yes it will build long time but for example you can play heavy 3d game in the same time.

If you get error you can look for details in D:\dev\uxp.32.mozbuild\last_log.json
That's all for now, happy building...