1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-07 21:17:07 +09:00
Commit graph

4179 commits

Author SHA1 Message Date
Aliaksandr Kalenik
7efdd1c1ec LibWeb: Stub CacheStorage interface
With this change we can again open login form https://discord.com/login
instead of failing in js because `caches.open()` is not defined.
2025-06-05 23:02:21 +02:00
stasoid
b64a4a83a1 Meta: Make pthread and mman available for all tests on Windows
by default (same code as in lagom_lib).
2025-06-05 10:16:03 -06:00
Nicolas Danelon
f6f7c69023 Meta: Add missing 'args' argument to install command parser
The install command was failing with 'Namespace object has no
attribute args' error because the argument parser for the
install command was missing the 'args' parameter that allows
passing additional arguments to the build system.

This fix adds the missing argument to match the behavior of
other commands like build, run, and debug.
2025-06-04 17:34:21 -04:00
Callum Law
50cce72ab9 LibWeb: Implement text-wrap CSS property
This resolves an issue introduced in 94f5a51 with the
tab-size-text-wrap test
2025-06-04 12:48:36 +01:00
Callum Law
9ba74316d2 LibWeb: Implement text-wrap-style CSS property 2025-06-04 12:48:36 +01:00
Timothy Flynn
2380fb0ca1 Meta: Default chosen compilers to the CC and CXX environment variables
This regressed when porting find_compiler.sh to python.
2025-06-02 08:04:07 -04:00
Timothy Flynn
667a568526 Meta: Add compiler arguments to the debug build mode 2025-05-30 20:06:15 -04:00
Andrew Kaster
8f0dad0898 CMake: Use static libraries for try_compile() in libfuzzer builds 2025-05-30 15:21:07 -06:00
Timothy Flynn
3786d56814 Meta: Remove msbuild presets
Let's just support ninja for simplicity. The msbuild presets are
significantly slower anyhow.
2025-05-30 13:52:51 -04:00
Andrew Kaster
68bba89dc3 CMake: Set macOS deployment target for vcpkg ports to match our build
Without this, ports get built with whatever default is there from the
toolchain, and we get all sorts of linker warnings about a mismatch.
2025-05-30 12:54:12 -04:00
Timothy Flynn
0958c5f508 Meta: Provide compiler jobs as a command line argument
On my Linux machine with 32 cores, ninja actually defaults to 34 jobs.
By defaulting ourselves to multiprocessing.cpu_count(), we actually
decrease the number of jobs used.
2025-05-30 12:03:38 -04:00
Timothy Flynn
e6938e11b0 Meta: Inspect the host compiler only when needed
We don't need to pick a host compiler every time ladybird.py is invoked.
We only need to do so when configuring the Build directory.

This shaves about 10ms off an invocation of `ladybird.py build` on my
machine, going from ~170ms to ~160ms.
2025-05-30 12:03:38 -04:00
Timothy Flynn
16743ee9d9 Meta: Invoke ninja directly instead of cmake --build
This shaves about 10ms off an invocation of `ladybird.py build` on my
machine, going from ~180ms to ~170ms.
2025-05-30 12:03:38 -04:00
Timothy Flynn
877687d1f6 Meta: Make the ladybird.py test pattern argument positional
Restores API compatibility with the old ladybird.sh.
2025-05-30 06:40:56 -04:00
Timothy Flynn
6345ebb78c Meta: Don't assume all build commands have a target
For example, the "test" and "vcpkg" build commands do not.
2025-05-30 06:40:56 -04:00
Timothy Flynn
f46f9b0f02 Meta: Restore default "build everything" behavior in ladybird.py
By default, we want `ladybird.py build` to build everything. We were
previously defaulting to only building the Ladybird target.

We now only fall back to the Ladybird target for commands that run a
program. So `ladybird.py run` will build and run Ladybird.
2025-05-29 16:24:17 -04:00
Timothy Flynn
aa0fcc67b3 Meta: Tentatively support BSD distributions in ladybird.py
Support was unknowingly dropped when porting ladybird.sh to ladybird.py.
This tentatively restores this support, but is untested on a BSD system.
2025-05-29 16:24:17 -04:00
Timothy Flynn
7ce88eb4cd Everywhere: Document use of ladybird.py over ladybird.sh 2025-05-29 16:24:17 -04:00
Timothy Flynn
6ac729e03d Meta: Replace ladybird.sh contents with invocation to ladybird.py
All features supported by ladybird.sh should now work in ladybird.py.
Let's forward invocations and warn that ladybird.sh will be removed.
2025-05-29 16:24:17 -04:00
Timothy Flynn
f2eaf1e57b Meta: Use new run_command utility to invoke subprocesses
As opposed to just running subprocess.check_call, our `run_command`
utility handles e.g. ctrl+c to avoid spamming the terminal with
KeyboardInterrupt stack traces.
2025-05-29 16:24:17 -04:00
Timothy Flynn
a5bfb686f4 Meta: Integrate find_compiler.py into ladybird.py 2025-05-29 16:24:17 -04:00
Timothy Flynn
3d0fdaacff Meta: Migrate find_compiler.sh logic to a python script
This will allow us to re-use this logic from within other python
scripts. The find_compiler.sh script still exists, as it is used by
some other bash scripts. The pick_host_compiler() function will now
execute find_compiler.py and store its result in $CC and $CXX.

Note that the python script supports Windows.
2025-05-29 16:24:17 -04:00
Timothy Flynn
8e792cd094 Meta: Support python 3.9 in ladybird.py
This is the default python version on macOS, so let's support it since
it is trivial for now. Using "str | None" as a type annotation is only
supported in python 3.10 or later.
2025-05-29 16:24:17 -04:00
Timothy Flynn
a76e880dfe Meta: Extract platform detection utilities to their own file
This will be needed by other scripts.

To do so, this patch gives up on the importlib method of importing
packages. I tried extracting this helper to e.g. __init__.py, but the
python runtime was unable to find the imported symbols.
2025-05-29 16:24:17 -04:00
Timothy Flynn
872a112cad Meta: Add SPDX license identifier to ladybird.py and BuildVcpkg.py 2025-05-29 16:24:17 -04:00
Callum Law
ed65d5b342 LibWeb: Serialize CSS declarations as shorthands where applicable
When serializing CSS declarations we now support combining multiple
properties into a single shorthand property in some cases.

This comes with a healthy dose of FIXMEs, including work to be done
around supporting:
 - Nested shorthands (e.g. background, border, etc)
 - Shorthands which aren't represented by the ShorthandStyleValue type
 - Subproperties pending substitution

This gains us a bunch of new test passes, both for WPT and in-tree
2025-05-29 12:04:28 +02:00
Callum Law
9480b1fc5c LibWeb: Parse and propagate white-space-trim CSS property 2025-05-29 12:04:28 +02:00
Callum Law
50bdd2cb85 LibWeb: Parse and propagate text-wrap-mode CSS property 2025-05-29 12:04:28 +02:00
Callum Law
ea30356fba LibWeb: Parse and propagate white-space-collapse CSS property 2025-05-29 12:04:28 +02:00
R-Goc
550aace91c Meta: Add flags for compilation and testing of js
This commit adds flags necessary for compilation and testing of js.exe.
The stack size is increased to match linux.
2025-05-29 03:26:23 -06:00
Dan Berglund
bd3135f8d3 CMake: Set default CMAKE_OSX_DEPLOYMENT_TARGET to 14.0
This makes the build system aware of which macOS version we're
targeting, and will make it an error to newer APIs without explicitly
checking the availability.

Note that the js REPL CI job still sets the deployment target to 11.0
explicitly.
2025-05-27 13:39:24 -06:00
Timothy Flynn
24da7b006e Meta: Change the ladybird.py target to be a positional argument
This affords us some API symmetry with ladybird.sh.
2025-05-27 20:02:37 +02:00
Timothy Flynn
25666390f6 Meta: Alias the "ladybird" target to "Ladybird" in ladybird.py
We do the same thing in ladybird.sh for convenience.
2025-05-27 20:02:37 +02:00
Timothy Flynn
e7fe2d3dab Meta: Do not pass non-existing extra arguments to addr2line build step
The variadic nature of the addr2line command is currently taken by the
`addresses` option.
2025-05-27 20:02:37 +02:00
Callum Law
9dfce6d14c Meta: Avoid doublequote strings nested in fstrings in ladybird.py
Double quote strings nested within double quoted-fstrings are invalid
syntax prior to Python 3.12 and was causing an error when running
ladybird.py
2025-05-23 10:27:34 -04:00
devgianlu
4b3715ccba LibCrypto: Replace {Unsigned,Signed}BigInteger impl with LibTomMath
Replace the implementation of maths in `UnsignedBigInteger`
and `SignedBigInteger` with LibTomMath. This gives benefits in terms of
less code to maintain, correctness and speed.

These changes also remove now-unsued methods and improve the error
propagation for functions allocating lots of memory. Additionally, the
new implementation is always trimmed and won't have dangling zeros when
exporting it.
2025-05-23 11:57:21 +02:00
devgianlu
915c6fdcf8 LibCrypto: Add libtommath vcpkg dependency and link it
An overlay port is required to add the `stdc-iec-559` and `install-pc`
patches.

The `stdc-iec-559` patch is required because Clang doesn't define
`__STDC_IEC_559__`. However, glibc and musl define it if `__GCC_IEC_559`
is not defined. The macro is taken from glibc source code.

The `install-pc` patch is required because libtommath doesn't install
the pkg-config files when building statically compromising our ability
to find it during build.

Clang: https://clang.llvm.org/c_status.html#:~:text=Yes-,
IEC%2060559%20support,-Unknown
glibc: https://sourceware.org/git/?p=glibc.git;a=blob;
f=include/stdc-predef.h
2025-05-23 11:57:21 +02:00
devgianlu
a952d000be LibCrypto: Move GCD to method of UnsignedBigInteger
Having it as a method instead of a free function is necessary for the
next commits and generally allows for optimizations that require deeper
access into the `UnsignedBigInteger`.
2025-05-23 11:57:21 +02:00
Sam Atkins
fb975cc156 LibWeb/CSS: Correct how we evaluate boolean media-features
The spec has a general rule for this, which is roughly that "If it's not
a falsey value, it's true". However, a couple of media-features are
always false, apparently breaking this rule. To handle that, we have an
array of false keywords in the JSON, instead of a single keyword. For
those always-false media-features, we can enter all their values into
this array.

Gets us 2 more WPT subtest passes.
2025-05-23 10:17:58 +01:00
ayeteadoe
fdd3f35b61 Meta: Localize resource module import to fix ladybird.py on Windows 2025-05-22 17:48:03 -04:00
Timothy Flynn
d00d49ba2f Meta+Toolchain: Extract BuildVcpkg to an importable function
This lets ladybird.py import it properly, instead of invoking BuildVcpkg
main().
2025-05-22 12:21:24 -04:00
Timothy Flynn
8d4ac42205 Meta: Always invoke BuildVcpkg from ladybird.py's build command
We were previously only invoking it if the Build directory didn't exist.
We need to always invoke it to handle vcpkg baseline updates.
2025-05-22 12:21:24 -04:00
Timothy Flynn
2f9957c618 Everywhere: Format all python files with black 2025-05-22 16:21:42 +02:00
Timothy Flynn
9e8336c04f Meta: Lint python files with black
It's the industry standard nowadays. This also lets us add a flag to the
lint-python.sh script to overwrite our python files in place.
2025-05-22 16:21:42 +02:00
Timothy Flynn
9ae85e5c68 Meta: Avoid manual formation of user-variables.cmake path
We're using python specifically to be platform-independent.
2025-05-21 16:55:27 -06:00
Timothy Flynn
5b830b4c05 Meta: Be a bit less aggressive with newlines in list extensions 2025-05-21 16:55:27 -06:00
Timothy Flynn
bac61926b2 Meta: Use fewer abbreviated variable names in ladybird.py 2025-05-21 16:55:27 -06:00
Timothy Flynn
b54f273770 Meta: Ignore pyright warning for dynamic BuildVcpkg import
There are now zero pyright warnings.
2025-05-21 16:55:27 -06:00
Timothy Flynn
6a1b3f740c Meta: Avoid double-access of LADYBIRD_SOURCE_DIR environment variable
The `ensure_ladybird_source_dir` function returns the source directory.
Let's just use it. This silences a pyright warning.
2025-05-21 16:55:27 -06:00
Timothy Flynn
23a95cfb9a Meta: Add missing type hints to ladybird.py
This enables significantly better LSP integration.
2025-05-21 16:55:27 -06:00