From a6db3cb7029bb6915f6ffed430e0b1a49f88585f Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:24:57 +0100 Subject: [PATCH] Disable layout-2013 feature by default (#34290) Most of the time layout-2013 is not needed and just wastes build time. Disable the optional feature by default and require users to specify the feature at compile time if they wish to use the legacy layout. In CI we enable the feature by default for Linux, since that we need it for wpt tests with the legacy layout and CI should ensure that the legacy code continues to compile. Signed-off-by: Jonathan Schwender --- .github/workflows/linux.yml | 2 +- components/servo/lib.rs | 4 ++-- ports/servoshell/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9a71b79fdc05d..02ed12e95988b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -152,7 +152,7 @@ jobs: - name: Build (${{ inputs.profile }}) run: | - python3 ./mach build --use-crown --locked --${{ inputs.profile }} + python3 ./mach build --use-crown --locked --${{ inputs.profile }} --features "layout_2013" cp -r target/cargo-timings target/cargo-timings-linux - name: Smoketest run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }} diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 74441979658d5..465c66feabc00 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -1033,8 +1033,8 @@ fn get_layout_factory(legacy_layout: bool) -> Arc { } } else { if legacy_layout { - warn!("Runtime option `legacy_layout` was enabled, but the `layout_2013` \ - feature was not enabled at compile time. Falling back to layout 2020! "); + panic!("Runtime option `legacy_layout` was enabled, but the `layout_2013` \ + feature was not enabled at compile time! "); } } } diff --git a/ports/servoshell/Cargo.toml b/ports/servoshell/Cargo.toml index 59dfaf3001634..57380bdf1c7a0 100644 --- a/ports/servoshell/Cargo.toml +++ b/ports/servoshell/Cargo.toml @@ -39,7 +39,7 @@ ProductName = "Servo" [features] debugmozjs = ["libservo/debugmozjs"] -default = ["layout_2013", "max_log_level", "webdriver", "webxr"] +default = ["max_log_level", "webdriver", "webxr"] jitspew = ["libservo/jitspew"] js_backtrace = ["libservo/js_backtrace"] layout_2013 = ["libservo/layout_2013"]