Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github action to Test Browser Build #253

Merged
merged 85 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
804d3d5
Create Github action to test browser build
tmbrbr Jan 27, 2025
1edb9a5
Add more browser dependencies
tmbrbr Jan 27, 2025
910d141
Switch to jammy
tmbrbr Jan 27, 2025
4f84c05
Switch to ubuntu-22.04
tmbrbr Jan 27, 2025
324146e
Add alsa-lib to dependencies
tmbrbr Jan 27, 2025
9bf48cc
Trying alsa-base
tmbrbr Jan 27, 2025
a7ed5a5
Try with libasound2-dev
tmbrbr Jan 27, 2025
6fca6c7
use 64 bit libraries for libasound
tmbrbr Jan 27, 2025
3ac38c1
More alsa library fun
tmbrbr Jan 27, 2025
c5e4086
Remove alsa-lib again
tmbrbr Jan 27, 2025
d07cdb4
Add bootstrap step
tmbrbr Jan 27, 2025
aeafc39
Removing excess bash
tmbrbr Jan 27, 2025
31abbf6
Add disk space check
tmbrbr Jan 27, 2025
9a3a52b
Add more space checks
tmbrbr Jan 27, 2025
8a24143
Change indentation
tmbrbr Jan 27, 2025
8cf1cd9
Free disk space before build
tmbrbr Jan 27, 2025
1cb2a71
Try adding a windows build step
tmbrbr Jan 28, 2025
0a0ab08
Install Mozbuild
tmbrbr Jan 28, 2025
4a04d78
Use invoke-webrequest
tmbrbr Jan 28, 2025
a31d69f
Fix typo
tmbrbr Jan 28, 2025
a0a9776
Download MozBuild to file
tmbrbr Jan 28, 2025
66a72f7
Extract mozilla build by hand
tmbrbr Jan 28, 2025
4a9c812
Adding quotes around command
tmbrbr Jan 28, 2025
f4e081f
Add magic call operator
tmbrbr Jan 28, 2025
de17b77
Add 7zip switches
tmbrbr Jan 28, 2025
006474d
Add build stage
tmbrbr Jan 28, 2025
033c4c7
Merge branch 'SAP:main' into browser-action
tmbrbr Jan 29, 2025
89d54f1
Try piping commands to mozilla build shell
tmbrbr Jan 29, 2025
715e27c
Add test commands for mozilla build
tmbrbr Jan 29, 2025
08b9b3e
Changing msys command line options
tmbrbr Jan 29, 2025
cba573b
Update browser.yml
tmbrbr Jan 29, 2025
8259b30
Try with quotes
tmbrbr Jan 29, 2025
2939fb2
Test mozilla build help
tmbrbr Jan 29, 2025
b76f573
More fun with quotes
tmbrbr Jan 29, 2025
0a0fd17
Main debug info
tmbrbr Jan 29, 2025
1f8241a
Change z-zip extraction parameters
tmbrbr Jan 29, 2025
5f9da1f
Switch back to ps1 commands now that mozilla-build is extracted properly
tmbrbr Jan 29, 2025
22144e8
Looks like we still need the mozilla build shell
tmbrbr Jan 29, 2025
f5d4d4b
Pass shell commands to start-shell directly
tmbrbr Jan 29, 2025
7849148
Trying using a custom shell
tmbrbr Jan 29, 2025
e17dfcc
Use mozilla build shell everywhere
tmbrbr Jan 29, 2025
e3f19c6
Try modifying shell command
tmbrbr Jan 29, 2025
ffd3056
Try with a cmd in the shell
tmbrbr Jan 29, 2025
8ca1aef
Try our luck with bash for windows
tmbrbr Jan 29, 2025
ad15185
Try with msys2 shell directly
tmbrbr Jan 29, 2025
d85b20d
Fixing typo
tmbrbr Jan 29, 2025
2d8e1aa
Add python3 to path
tmbrbr Jan 29, 2025
4a48968
Create tmp directory
tmbrbr Jan 29, 2025
144c5ae
Create with -p flag
tmbrbr Jan 29, 2025
5f05231
Update taintfox_mozconfig_win
tmbrbr Jan 29, 2025
fa40dff
Use windows config
tmbrbr Jan 29, 2025
907b721
Correcting typo
tmbrbr Jan 29, 2025
77097f4
Move back to powershell mach
tmbrbr Jan 29, 2025
269cc98
Move up mozconfig copy
tmbrbr Jan 29, 2025
72e29b4
Try without a config file
tmbrbr Jan 29, 2025
369203a
Doing some checks on bash shell
tmbrbr Jan 30, 2025
cc96358
Test bash shell
tmbrbr Jan 30, 2025
f30b26e
Powershell bash
tmbrbr Jan 30, 2025
cffaa9e
Another bash at finding bash
tmbrbr Jan 30, 2025
4f50314
Update browser.yml
tmbrbr Feb 5, 2025
e52a60e
Adding some debug statements
tmbrbr Feb 5, 2025
33084a1
Adding more debug messages
tmbrbr Feb 5, 2025
135a046
Fixing whitespace issue
tmbrbr Feb 5, 2025
78f706b
More config debug information
tmbrbr Feb 5, 2025
a4026ea
Changing msys configuration
tmbrbr Feb 5, 2025
0a8b7b9
Adding more tmp directory checks
tmbrbr Feb 5, 2025
d4c02cb
Double checking that tmp directory
tmbrbr Feb 5, 2025
89a7958
Try linking to system version of msys2
tmbrbr Feb 5, 2025
d0268b3
Use powershell arguments
tmbrbr Feb 5, 2025
883143f
Install the moztools directly
tmbrbr Feb 5, 2025
8c34cc6
Remove comments
tmbrbr Feb 5, 2025
63d7c8b
Remove tabs
tmbrbr Feb 5, 2025
a77b877
Don't delete mozbuildsetup
tmbrbr Feb 5, 2025
18afe92
Attempt to use execwait
tmbrbr Feb 5, 2025
362ed00
Use start process to wait for installation
tmbrbr Feb 5, 2025
e76fb0a
See if the build will work
tmbrbr Feb 5, 2025
8b53cbc
Add python back to the path
tmbrbr Feb 5, 2025
6359916
See if the powershell mach will work for us now
tmbrbr Feb 5, 2025
01c3395
Try downgrading the rust version
tmbrbr Feb 5, 2025
1fd9efd
Get rust version from the PLAYWRIGHT_VERSION file
tmbrbr Feb 6, 2025
5d31038
Remove quotes from Rust version
tmbrbr Feb 6, 2025
743654e
Removing debug prints
tmbrbr Feb 6, 2025
393e482
Adding a MacOS build
tmbrbr Feb 6, 2025
20d1ac3
Use python3.11 for mac build
tmbrbr Feb 6, 2025
ffbcc22
Build on both Intel and M1 MacOS
tmbrbr Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Attempt to build the whole browser
name: Browser

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:

# Test complete build on Ubuntu
ubuntu-build:
runs-on: ubuntu-22.04

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Install Dependencies
run: |
df -h
sudo apt-get update
sudo apt-get install -y \
curl \
python3 \
python3-pip \
python3-venv \
tar \
zip \
unzip \
git
sudo apt-get install -y --no-install-recommends ffmpeg libasound2 libatk1.0-0 libcairo-gobject2 libcairo2 libdbus-1-3 libdbus-glib-1-2 libfontconfig1 libfreetype6 libgdk-pixbuf-2.0-0 libglib2.0-0 libgtk-3-0 libpango-1.0-0 libpangocairo-1.0-0 libx11-6 libx11-xcb1 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 xvfb fonts-noto-color-emoji fonts-unifont xfonts-cyrillic xfonts-scalable fonts-liberation fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf fonts-freefont-ttf
python3 -m pip install setuptools
df -h

- name: Checkout release branch
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Dry Run
run: |
df -h
cp taintfox_mozconfig_ubuntu .mozconfig
bash build.sh -p -n

- name: Bootstrap
run: |
df -h
bash build.sh -u -v

- name: Build
run: |
df -h
bash build.sh -s -v

- name: Package
run: |
df -h
bash build.sh -s -u

# Test complete build on Windows
windows-build:
runs-on: windows-latest

steps:

- name: Download mozbuild
run: |
Set-PSDebug -Trace 1
Invoke-WebRequest https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe -OutFile .\MozillaBuildSetup-Latest.exe
Start-Process .\MozillaBuildSetup-Latest.exe -ArgumentList '/S /D=C:\mozilla-build' -Wait
cmd.exe /c 'C:\mozilla-build\start-shell.bat' --help
rm .\MozillaBuildSetup-Latest.exe

- name: Checkout release branch
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Bootstrap
run: |
cp "taintfox_mozconfig_win" ".mozconfig"
.\mach.ps1 --no-interactive bootstrap --application-choice=browser
$env:RUST_VERSION=$((((Get-Content .\.PLAYWRIGHT_VERSION | select-string RUST_VERSION) -Split "=")[1] -Split '"')[1])
echo "Installing $env:RUST_VERSION from .PLAYWRIGHT_VERSION"
rustup install $env:RUST_VERSION
rustup default $env:RUST_VERSION

- name: Build
run: |
.\mach.ps1 build

- name: Package
run: |
.\mach.ps1 package

# Test complete build on MacOS
macos-build:
strategy:
matrix:
# Build using both latest (M1 ARM) and macos-13 (Intel x86)
os: [macos-latest, macos-13]
runs-on: ${{ matrix.os }}

steps:

- name: Checkout release branch
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Bootstrap
run: |
cp "taintfox_mozconfig_ubuntu" ".mozconfig"
python3.11 ./mach --no-interactive bootstrap --application-choice=browser
source .PLAYWRIGHT_VERSION
echo "Installing ${RUST_VERSION} from .PLAYWRIGHT_VERSION"
rustup install ${RUST_VERSION}
rustup default ${RUST_VERSION}

- name: Build
run: |
python3.11 ./mach build

- name: Package
run: |
python3.11 ./mach package
61 changes: 37 additions & 24 deletions taintfox_mozconfig_win
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
mk_add_options MOZ_MAKE_FLAGS="-s"
# limit number of parallel jobs - do not do this by default, but might be needed for build systems with limited resources
# mk_add_options MOZ_PARALLEL_BUILD=4

# Export path to Windows C runtime libraries.
# This will cause those DLLs to be packaged with the application, which is required to run taintfox on non-developer machines
# Use ccache, make sure the path is correct
#ac_add_options --with-ccache=/usr/bin/ccache

# Add-on signing is not required for DevEdition
MOZ_REQUIRE_SIGNING=

# Force Visual Studio compiler (default is clang)
#export CC=cl
#export LINKER=link

# Set 32-bit build
#ac_add_options --target=i686-pc-mingw32
#ac_add_options --host=x86_64-pc-mingw32
#WIN32_REDIST_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.20.27508\x86\Microsoft.VC141.CRT"


# Set 64-bit build
ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32
WIN32_REDIST_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.20.27508\x64\Microsoft.VC141.CRT"
# On OS X we only support newer releases so that clang uses libc++ (llvm) instead of stdlibc++
# We could work around this (typedef basic_string<char16_t> u16string), but this should be fine.
#ac_add_options --enable-macos-target=10.10

# disable updater
ac_add_options --disable-updater

# Add-on signing is not required for DevEdition
MOZ_REQUIRE_SIGNING=

ac_add_options --with-branding=browser/branding/foxhound

#
# DEBUG BUILD
#
#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-tf-dbg
#ac_add_options --enable-debug-symbols
#ac_add_options --enable-debug
#ac_add_options --disable-optimize
#ac_add_options --disable-tests
#ac_add_options --enable-project=js
#ac_add_options --enable-jitspew

# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

#
# RELEASE BUILD
#
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-tf-release-64
ac_add_options --disable-tests
ac_add_options --enable-cdp
ac_add_options --with-app-name=foxhound
mk_add_options MOZ_APP_NAME=foxhound
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-tf-release
#ac_add_options --disable-tests
ac_add_options --disable-sandbox
ac_add_options --without-wasm-sandboxed-libraries
ac_add_options --disable-crashreporter
ac_add_options --disable-backgroundtasks
ac_add_options --enable-release

#
# OPTIMIZED BUILD WITH DEBUG SYMBOLS
#
#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-tf-release-with-symbols
#ac_add_options --enable-debug-symbols
#ac_add_options --enable-gczeal
#ac_add_options --enable-optimize
#ac_add_options --disable-tests
Loading