Skip to content

Commit 7adc6dc

Browse files
icepaqUbuntu
andauthored
Fix Linux Builds (#4) (#447)
* Fix Linux ARM Builds (#4) * linux fix * platform specific sqlite dependency * linux symlink --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-25-90.us-east-2.compute.internal> * symlinks for all linux archs --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-25-90.us-east-2.compute.internal>
1 parent e4fb69e commit 7adc6dc

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ RUN apt-get update && apt-get install -y \
1313
python3 python3-dev python3-pip \
1414
# Camoufox build system tools
1515
git p7zip-full golang-go aria2 curl rsync \
16+
# Platform-specific libraries for Linux builds
17+
libsqlite3-dev \
1618
# CA certificates
1719
ca-certificates \
1820
&& update-ca-certificates

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export
44
cf_source_dir := camoufox-$(version)-$(release)
55
ff_source_tarball := firefox-$(version).source.tar.xz
66

7-
debs := python3 python3-dev python3-pip p7zip-full golang-go msitools wget aria2
8-
rpms := python3 python3-devel p7zip golang msitools wget aria2
9-
pacman := python python-pip p7zip go msitools wget aria2
7+
debs := python3 python3-dev python3-pip p7zip-full golang-go msitools wget aria2 libsqlite3-dev
8+
rpms := python3 python3-devel p7zip golang msitools wget aria2 sqlite-devel
9+
pacman := python python-pip p7zip go msitools wget aria2 sqlite
1010

1111
.PHONY: help fetch setup setup-minimal clean set-target distclean build package \
1212
build-launcher check-arch revert edits run bootstrap mozbootstrap dir \

multibuild.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import argparse
2020
import glob
2121
import os
22+
from pathlib import Path
2223
import sys
2324
from dataclasses import dataclass
2425
from typing import List
@@ -29,6 +30,28 @@
2930
AVAILABLE_ARCHS = ["x86_64", "arm64", "i686"]
3031

3132

33+
def setup_linux_sysroots():
34+
"""
35+
Set up symlinks required for Linux cross-compilation.
36+
The sysroots may be missing the libsqlite3.so symlink needed for linking.
37+
"""
38+
mozbuild = Path.home() / '.mozbuild'
39+
sysroots = [
40+
('sysroot-aarch64-linux-gnu', 'aarch64-linux-gnu'),
41+
('sysroot-x86_64-linux-gnu', 'x86_64-linux-gnu'),
42+
('sysroot-i686-linux-gnu', 'i686-linux-gnu'),
43+
]
44+
45+
for sysroot_name, lib_arch in sysroots:
46+
sysroot_lib = mozbuild / sysroot_name / 'usr' / 'lib' / lib_arch
47+
sqlite_so = sysroot_lib / 'libsqlite3.so'
48+
sqlite_so_0 = sysroot_lib / 'libsqlite3.so.0'
49+
50+
if sysroot_lib.exists() and sqlite_so_0.exists() and not sqlite_so.exists():
51+
print(f"Creating libsqlite3.so symlink in {sysroot_lib}")
52+
sqlite_so.symlink_to('libsqlite3.so.0')
53+
54+
3255
def run(cmd, exit_on_fail=True):
3356
print(f'\n------------\n{cmd}\n------------\n')
3457
retval = os.system(cmd)
@@ -131,6 +154,10 @@ def main():
131154
# Ensure dist directory exists
132155
os.makedirs('dist', exist_ok=True)
133156

157+
# Set up Linux sysroot symlinks if needed
158+
if 'linux' in args.target:
159+
setup_linux_sysroots()
160+
134161
# Run build
135162
for target in args.target:
136163
for arch in args.arch:

patches/playwright/0-playwright.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,15 +3395,16 @@ diff --git a/widget/headless/HeadlessCompositorWidget.cpp b/widget/headless/Head
33953395
index bb4ee9175e..6814ae8503 100644
33963396
--- a/widget/headless/HeadlessCompositorWidget.cpp
33973397
+++ b/widget/headless/HeadlessCompositorWidget.cpp
3398-
@@ -3,6 +3,7 @@
3398+
@@ -3,6 +3,8 @@
33993399
* License, v. 2.0. If a copy of the MPL was not distributed with this
34003400
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
34013401

3402+
+#include "mozilla/gfx/2D.h"
34023403
+#include "mozilla/layers/CompositorThread.h"
34033404
#include "mozilla/widget/PlatformWidgetTypes.h"
34043405
#include "HeadlessCompositorWidget.h"
34053406
#include "VsyncDispatcher.h"
3406-
@@ -15,9 +16,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget(
3407+
@@ -15,9 +17,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget(
34073408
const layers::CompositorOptions& aOptions, HeadlessWidget* aWindow)
34083409
: CompositorWidget(aOptions),
34093410
mWidget(aWindow),
@@ -3434,7 +3435,7 @@ index bb4ee9175e..6814ae8503 100644
34343435
void HeadlessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) {
34353436
if (RefPtr<CompositorVsyncDispatcher> cvd =
34363437
mWidget->GetCompositorVsyncDispatcher()) {
3437-
@@ -31,6 +53,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged(
3438+
@@ -31,6 +54,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged(
34383439
const LayoutDeviceIntSize& aClientSize) {
34393440
auto size = mClientSize.Lock();
34403441
*size = aClientSize;

0 commit comments

Comments
 (0)