Commit graph

49 commits

Author SHA1 Message Date
sideshowbarker
c96dec10e3 Meta: Update ICU to 78.3 by bumping the vcpkg baseline
Bump the pinned ICU version from 78.2 to 78.3 — the current release — so
the build works on systems that already ship 78.3. And bump our vcpkg
baseline — because 78.3 is newer than our existing baseline. And pin
freetype to 2.13.3 — because the baseline update otherwise pulls in
2.14.3, which has font-rendering changes that break our layout tests.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/10145
2026-06-19 08:59:16 +02:00
Tim Ledbetter
0fc92a5929 Meta: Add vcpkg overlay port for wuffs 0.3.4
This will be used for GIF decoding.
2026-06-10 20:29:11 +02:00
Shannon Booth
5ef34ecb7a LibURL: Use libpsl for public suffix matching
Replace the generated public suffix table and custom matcher with a
direct LibURL PublicSuffixData implementation backed by libpsl. This
drops our PSL download/generator path and uses the same library already
used by libcurl.

Performance is comparable before and after, while LibURL binary size
is smaller.
2026-06-10 11:43:44 +02:00
Andreas Kling
dfb2656d9c Utilities: Replace LibLine with libedit
Use libedit's readline-compatible interface for the JavaScript REPL so
line editing, history, and tab completion no longer depend on LibLine.
The REPL keeps its existing multiline input and completion behavior,
but no longer provides LibLine's live syntax highlighting.

Remove the unused LibLine dependency from the wasm utility and delete
the LibLine library from the build now that it has no remaining
consumers.
2026-06-05 00:09:37 +02:00
Luke Wilde
d4d9fc12f7 Meta: Generate HSTS preload data from Chromium's static list
Download transport_security_state_static.json on configure and
emit a sorted flat array of (name, include_subdomains) pairs.
The generator keeps only force-https entries, drops IP literals,
and validates names against [a-z0-9.-] so the emitted C++ string
literals need no escaping.

Matches Firefox's HSTS preload source:
https://searchfox.org/firefox-main/rev/ca47ec6bb1f3e46a384cd1ebb11c5996cceef90f/taskcluster/docker/periodic-updates/scripts/getHSTSPreloadList.js
2026-05-29 22:23:33 +02:00
Andreas Kling
bcdbdbb5b3 LibWeb: Add adblock-rust FFI hooks
Add adblock-rust to a dedicated LibWeb content blocker Rust crate
and expose FFI entry points for creating an engine, matching network
requests, and producing cosmetic CSS. Export a string result type for
returning generated CSS to C++ callers.

Regenerate the Flatpak cargo source list for the new Rust
dependencies.
2026-05-24 08:16:46 +02:00
Martin Chrástek
cd3c72dfda LibWeb: Implement chardetng-based encoding detection for HTML parsing 2026-05-23 11:57:33 +02:00
Zaggy1024
27e555c20e Meta: Give generate-cargo-sources.py's sources explicit typing 2026-05-13 08:13:51 -05:00
Ali Mohammad Pur
a33e148339 LibWasm+Meta: Add Cranelift AOT compilation backend
Add an optional Cranelift-based AOT compiler for WebAssembly functions,
enabled via -DENABLE_CRANELIFT_JIT=ON.
2026-05-10 16:41:42 +02:00
Martin Chrástek
2eb8306cb0 LibUnicode: Update icu4x's calendar module to 2.2.1 2026-05-06 09:02:21 -04:00
Jelle Raaijmakers
69f5876abb Meta: Do not require branch/commit consistency in Flatpak
Our Flatpak builds currently start failing once a commit ID no longer
matches with the commit pointed to by the configured `branch`. This is
becoming pretty annoying for Skia, since the `chrome/mXYZ` branches are
effectively moving targets.

Change the `branch` key in the Flatpak config to `x-branch`, which
removes the constraint and allows Flatpak to work with just the pinned
commit IDs. Change the linter to still use `x-branch` as the reference
to compare with our vcpkg configuration, so we make sure to still keep
things consistent between vcpkg and Flatpak.
2026-05-05 12:03:42 +02:00
Jelle Raaijmakers
3564dc1c81 Meta: Update flatpak commit for Skia
The M144 tag was updated:

https://skia.googlesource.com/skia/+/cd0c5f445516ea4e90e02b5f634cbc5ca23b5a44
2026-05-05 12:03:42 +02:00
Johan Dahlin
1454e90c93 Meta: Add vcpkg overlay port for pdf.js 5.6.205 2026-04-30 07:46:12 +02:00
Andrew Kaster
309ca11236 Meta: Pin highway version 1.4.0 2026-04-23 20:33:08 -06:00
Timothy Flynn
ab6f8d67e9 Meta: Update flatpak commit for Skia
The M144 tag was updated:
https://skia.googlesource.com/skia/+/3dde9e726a05abcd66e0ccafc4397b7b045213bd
2026-04-22 07:05:19 -04:00
Zaggy1024
3cfe1f7542 LibGfx: Implement YUV->RGBA color conversion for CPU painting
Using the Rust yuv crate, eagerly convert from YUV to RGBA on the CPU
when a GPU context is unavailable.

Time spent converting an 8-bit YUV frame with this crate is better than
libyuv on ARM by about 20%, and on x86 with AVX2, it achieves similar
numbers to libyuv.
2026-04-18 01:25:00 -05:00
Timothy Flynn
4b1ecbc9df LibJS+LibUnicode: Update icu4x's calendar module to 2.2.0
First: We now pin the icu4x version to an exact number. Minor version
upgrades can result in noisy deprecation warnings and API changes which
cause tests to fail. So let's pin the known-good version exactly.

This patch updates our Rust calendar module to use the new APIs. This
initially caused some test failures due to the new Date::try_new API
(which is the recommended replacement for Date::try_new_from_codes)
having quite a limited year range of +/-9999. So we must use other
APIs (Date::try_from_fields and calendrical_calculations::gregorian)
to avoid these limits.

http://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md#icu4x-22
2026-04-14 18:12:31 -04:00
Timothy Flynn
7bb13cf74b Meta: Update flatpak commit for Skia
The M144 tag was updated:
https://skia.googlesource.com/skia/+/e06a109cc972333266da5e531ebf08255231283b
2026-04-11 08:31:34 -04:00
Andreas Kling
b23aa38546 AK: Adopt mimalloc v2 as main allocator
Use mimalloc for Ladybird-owned allocations without overriding malloc().
Route kmalloc(), kcalloc(), krealloc(), and kfree() through mimalloc,
and put the embedded Rust crates on the same allocator via a shared
shim in AK/kmalloc.cpp.

This also lets us drop kfree_sized(), since it no longer used its size
argument. StringData, Utf16StringData, JS object storage, Rust error
strings, and the CoreAudio playback helpers can all free their AK-backed
storage with plain kfree().

Sanitizer builds still use the system allocator. LeakSanitizer does not
reliably trace references stored in mimalloc-managed AK containers, so
static caches and other long-lived roots can look leaked. Pass the old
size into the Rust realloc shim so aligned fallback reallocations can
move posix_memalign-backed blocks safely.

Static builds still need a little linker help. macOS app binaries need
the Rust allocator entry points forced in from liblagom-ak.a, while
static ELF links can pull in identical allocator shim definitions from
multiple Rust staticlibs. Keep the Apple -u flags and allow those
duplicate shim symbols for LibJS and LibRegex links on Linux and BSD.
2026-04-08 09:57:53 +02:00
Timothy Flynn
d4e0841176 Meta: Update flatpak commit for Skia
The M144 tag was updated today:
https://skia.googlesource.com/skia/+/842fbf02329dfa555c0a022617a400fec8ff115c
2026-04-07 22:49:51 -04:00
Andrew Kaster
92e4c20ad5 LibJS: Generate FFI header using cbindgen instead of hand-rolling
Replace the BytecodeFactory header with cbindgen.

This will help ensure that types and enums and constants are kept in
sync between the C++ and Rust code. It's also a step in exporting more
Rust enums directly rather than relying on magic constants for
switch statements.

The FFI functions are now all placed in the JS::FFI namespace, which
is the cause for all the churn in the scripting parts of LibJS and
LibWeb.
2026-03-17 20:49:50 -05:00
Jelle Raaijmakers
44bdd6c5e5 Meta: Update pinned Skia commit in Flatpak manifest
The chrome/m144 branch was force-pushed upstream, so the old commit no
longer exists on that branch, breaking the Flatpak CI build.
2026-03-12 14:26:31 +01:00
Timothy Flynn
86c8a57794 LibJS+LibUnicode: Use icu4x for Temporal calendar operations
Replace the icu4c-based calendar implementation with one built on the
icu4x Rust crate (icu_calendar).

The icu4c API does not expose the píngqì month-assignment algorithm
used by the Chinese and Dangi lunisolar calendars. Our old code had to
approximate this by walking months via epoch millisecond arithmetic and
manually tracking leap month positions, which produced incorrect month
codes and ordinal month numbers for certain years. The icu4x calendar
crate handles píngqì natively.

With this patch, which is almost a 1-to-1 mapping of ICU invocations, we
pass 100% of all Temporal test262 tests.

The end goal might be to use icu4x for all of our ICU needs. But it does
not yet provide the APIs needed for all ECMA-402 prototypes.
2026-03-11 07:09:57 -04:00
Timothy Flynn
e549d168ac LibUnicode: Update ICU to 78.2
Contains fixes needed for non-ISO-8601 calendars in Temporal.
2026-03-09 11:40:59 +01:00
Andreas Kling
87b923d0b1 Meta: Update pinned Skia commit in Flatpak manifest
The chrome/m144 branch was force-pushed upstream, so the old commit
no longer exists on that branch, breaking the Flatpak CI build.
2026-02-28 12:34:07 +01:00
Andreas Kling
81cb230526 Flatpak: Add Rust toolchain and vendored cargo dependencies
Add the rust-stable SDK extension, pre-download Corrosion and all crate
dependencies, and set up cargo vendoring so the Flatpak build can
compile Rust code without network access during the build phase.
2026-02-24 09:39:42 +01:00
Timothy Flynn
3355fb39ae AK+LibJS: Replace home-grown Ryu implementation with fmt's dragonbox
In the benchmark added here, fmt's dragonbox is ~3x faster than our own
Ryu implementation (1197ms for dragonbox vs. 3435ms for Ryu).

Daniel Lemire recently published an article about these algorithms:
https://lemire.me/blog/2026/02/01/converting-floats-to-strings-quickly/

In this article, fmt's dragonbox implementation is actually one of the
slower ones (with the caveat that some comments note that the article is
a bit out-of-date). I've gone with fmt here because:

1. It has a readily available recent version on vcpkg.
2. It provides the methods we need to actually convert a floating point
   to decimal exponential form.
3. There is an ongoing effort to replace dragonbox with a new algorithm,
   zmij, which promises to be faster.
4. It is one of the only users of AK/UFixedBigInt, so we can potentially
   remove that as well soon.
5. Bringing in fmt opens the door to replacing a bunch of AK::format
   facilities with fmt as well.
2026-02-23 18:30:40 +01:00
Timothy Flynn
721c05802c Meta: Add missing vcpkg pinned versions 2026-02-23 18:30:40 +01:00
Undefine
08c27f5e7d Meta: Update SDL3 to 3.2.28 2026-01-16 10:59:50 -07:00
Ali Mohammad Pur
ea65181444 Meta+LibJS: Upgrade simdjson to the latest version
5e0ee26e8b pulls in an old version of
simdjson, this commit upgrades to the latest release.
This commit also pins `dav1d` to the version it was before this change.
2026-01-16 13:11:05 +01:00
Andreas Kling
5e0ee26e8b LibJS: Use simdjson for JSON.parse
Replace the custom AK JSON parser with simdjson for parsing JSON in
LibJS. This eliminates the intermediate AK::JsonValue object graph,
going directly from JSON text to JS::Value.

simdjson's on-demand API parses at ~4GB/s and only materializes values
as they are accessed, making this both faster and more memory efficient
than the previous approach.

The AK JSON parser is still used elsewhere (WebDriver protocol, config
files, etc.) but LibJS now uses simdjson exclusively for JSON.parse()
and JSON.rawJSON().
2026-01-12 13:53:28 -05:00
Jan Koudijs
80133665f7 Meta: Bring Flatpak dependency versions in line with vcpkg versions 2025-12-19 13:16:47 +01:00
ayeteadoe
ee3aa865af Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.

SkFontMgr_New_FontConfig now requires a font scanner to be passed in.

There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.

The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.

The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
2025-12-17 12:00:33 +01:00
Andreas Kling
2577c5ce67 Revert "Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port"
This reverts commit ac9688ea1e.

Broke the build on arm64 Linux.
2025-12-15 14:12:34 -06:00
ayeteadoe
ac9688ea1e Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.

SkFontMgr_New_FontConfig now requires a font scanner to be passed in.

There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.

The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.

The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
2025-12-15 10:56:27 +01:00
R-Goc
5deeb55461 Meta: Add cpptrace to flatpak manifest
This commit adds cpptrace to the flatpak manifest, fixing the build.

Co-authored-by: Jan Koudijs <theappgineer@gmail.com>
2025-10-10 12:46:20 +02:00
Jan Koudijs
597f04e462 Meta: Update fast_float to v8.1.0 in Flatpak manifest
Version 8.1.0 of fast_float contains a change that fixes #6205.
2025-10-05 14:41:01 +02:00
Jan Koudijs
ea178a85e1 Meta: Set option to enable baseline CPU target for CI in Flatpak
PR #6010 adds the ENABLE_CI_BASELINE_CPU option,
but for the Flatpak manifest it was missed to set the value.
This commit fixes that.
2025-10-05 14:41:01 +02:00
Jan Koudijs
937f598de5 Meta: Update simdutf to v7.4.0 in Flatpak manifest 2025-09-26 17:23:53 +02:00
Jelle Raaijmakers
49817a1c6a CI+Meta: Add option to enable baseline CPU target for CI
We currently have the issue that our macOS builds are being hosted by
both Apple M1 and M4 runners. By default, these target `-mcpu=apple-m1`
and `-mcpu=apple-m3` respectively, causing their ccache artifacts to be
incompatible and effectively thrashing each other's ccache cache on each
run.

Add a new CMake option `ENABLE_CI_BASELINE_CPU` that toggles a baseline
`-mcpu/-march` compile option for each of the supported build platforms.
When disabled (the default), we now default to `-march=native` which on
Linux could theoretically lead to better performance.

The new CPU baseline is used by the `lagom-template.yml` and
`js-and-wasm-artifacts.yml` workflows, since they both produce artifacts
or caches that might be picked up by other runners. We also enable it
for Flatpak builds, so they target a fixed architecture instead of
whatever architecture the action runner that picked up the job has.
2025-09-16 10:53:15 -04:00
Luke Wilde
50dcd8fc85 Meta+WebContent+LibWeb: Add, link and initialize SDL3 2025-09-01 21:10:47 +02:00
Andrew Kaster
85baf71d48 Meta: Use clang to build ladybird module in flatpak 2025-07-23 15:12:00 -06:00
Jan Koudijs
0c89b2e690 Meta: Add offline build for ANGLE flatpak module
At the same time, build with gcc instead of bundled clang.

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2025-07-23 15:12:00 -06:00
Andrew Kaster
7d458103a8 Meta: Move skia and angle flatpak build scripts to their own directories 2025-07-23 15:12:00 -06:00
Andrew Kaster
35f65b8dab Meta: Bump version of gn flatpak source module to rev 2255 2025-07-23 15:12:00 -06:00
Andrew Kaster
738c81877c Meta: Move build of gn module in flatpak build before angle 2025-07-23 15:12:00 -06:00
Andrew Kaster
08221c2534 Meta: Skip build directories when building Ladybird module in flatpak
flatpak-builder doesn't respect .gitignore when creating its local build
directory, so we need to explicitly skip potentially large ignored
directories to avoid bloating the flatpak build directory during builds.
2025-07-23 15:12:00 -06:00
Andrew Kaster
c1ece2b4ed Meta: Clean up flatpak manifest and remove most linter warnings
We now clean up installed helper tools, includes from dependencies, and
pkgconfig/CMake files. This decreases the size of the flatpak from
~206MiB to ~150 MiB on my machine.

The manifest is also mostly clean of linter warnings from the
flatpack-builder manifest linter, with the exception of the overly broad
session bus policy.

The docs at https://docs.flathub.org/docs/for-app-authors/linter list a
method for selecting the correct session bus policies, but it is unclear
how to actually get the full set.
2025-07-15 14:16:42 -06:00
Andrew Kaster
44d2e22b93 CMake: Add a flatpak build for org.ladybird.Ladybird
This build depends on the KDE Flatpak SDK, and builds any missing
dependencies manually as source modules.

The flatpak can be built with the following command:

```sh
flatpak-builder --user --force-clean --install-deps-from=flathub \
    --ccache --repo=Build/repo --install Build/flatpak \
    Meta/CMake/flatpak/org.ladybird.Ladybird.json
```

After building, the flatpak can be run with:

```sh
flatpak run --user --devel org.ladybird.Ladybird
```

If there are issues launching RequestServer, the .pid and .sock files
under $XDG_RUNTIME_DIR may need removed.

```sh
flatpak run --user --command=sh --devel org.ladybird.Ladybird
rm -f $XDG_RUNTIME_DIR/Ladybird.*
```
2025-07-08 11:45:32 -06:00