diff --git a/.github/workflows/dispatch-workflow.yml b/.github/workflows/dispatch-workflow.yml index 086ab94aaae..8688b96d76c 100644 --- a/.github/workflows/dispatch-workflow.yml +++ b/.github/workflows/dispatch-workflow.yml @@ -17,6 +17,9 @@ on: unit-tests: required: true type: boolean + build-libservo: + required: true + type: boolean bencher: required: true type: boolean @@ -30,6 +33,7 @@ jobs: with: profile: ${{ inputs.profile }} unit-tests: ${{ inputs.unit-tests }} + build-libservo: ${{ inputs.build-libservo }} bencher: ${{ inputs.bencher }} macos: @@ -41,6 +45,7 @@ jobs: profile: ${{ inputs.profile }} wpt-layout: ${{ inputs.wpt-layout }} unit-tests: ${{ inputs.unit-tests }} + build-libservo: ${{ inputs.build-libservo }} wpt-args: ${{ inputs.wpt-args }} bencher: ${{ inputs.bencher }} @@ -53,6 +58,7 @@ jobs: profile: ${{ inputs.profile }} wpt-layout: ${{ inputs.wpt-layout }} unit-tests: ${{ inputs.unit-tests }} + build-libservo: ${{ inputs.build-libservo }} wpt-args: ${{ inputs.wpt-args }} bencher: ${{ inputs.bencher }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 34eee5185f4..119789b1843 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -21,6 +21,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -59,6 +63,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -165,6 +173,9 @@ jobs: timeout_minutes: 20 max_attempts: 2 # https://github.com/servo/servo/issues/30683 command: ./mach test-unit --${{ inputs.profile }} + - name: Build libservo + if: ${{ inputs.build-libservo }} + run: cargo build -p libservo - name: Archive build timing uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 80267588b0c..0b1296c77cf 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -18,6 +18,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -52,6 +56,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -152,6 +160,9 @@ jobs: timeout_minutes: 40 # https://github.com/servo/servo/issues/30275 max_attempts: 3 # https://github.com/servo/servo/issues/30683 command: ./mach test-unit --${{ inputs.profile }} + - name: Build libservo + if: ${{ inputs.build-libservo }} + run: cargo build -p libservo - name: Build mach package run: ./mach package --${{ inputs.profile }} - name: Run DMG smoketest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdaa68d292f..02cfdd5b7df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: run: | { echo 'result<> $GITHUB_OUTPUT @@ -54,6 +54,7 @@ jobs: wpt-layout: ${{ matrix.wpt_layout }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} + build-libservo: ${{ matrix.build_libservo }} wpt-args: ${{ matrix.wpt_args }} bencher: ${{ matrix.bencher }} diff --git a/.github/workflows/try-label.yml b/.github/workflows/try-label.yml index 1a95432cd7d..be9b2a97455 100644 --- a/.github/workflows/try-label.yml +++ b/.github/workflows/try-label.yml @@ -137,6 +137,7 @@ jobs: wpt-layout: ${{ matrix.wpt_layout }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} + build-libservo: ${{ matrix.build_libservo }} wpt-args: ${{ matrix.wpt_args }} bencher: ${{ matrix.bencher }} diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml index d81715fe92d..1518fa1d22d 100644 --- a/.github/workflows/try.yml +++ b/.github/workflows/try.yml @@ -107,6 +107,7 @@ jobs: wpt-layout: ${{ matrix.wpt_layout }} profile: ${{ matrix.profile }} unit-tests: ${{ matrix.unit_tests }} + build-libservo: ${{ matrix.build_libservo }} wpt-args: ${{ matrix.wpt_args }} bencher: ${{ matrix.bencher }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bb0af4c47b8..03813ea321c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -11,6 +11,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -37,6 +41,10 @@ on: required: false default: false type: boolean + build-libservo: + required: false + default: false + type: boolean upload: required: false default: false @@ -168,6 +176,9 @@ jobs: timeout_minutes: 30 max_attempts: 3 # https://github.com/servo/servo/issues/30683 command: .\mach test-unit --${{ inputs.profile }} -- -- --test-threads=1 + - name: Build libservo + if: ${{ inputs.build-libservo }} + run: cargo build -p libservo - name: Archive build timing uses: actions/upload-artifact@v4 with: diff --git a/Cargo.toml b/Cargo.toml index f86f638c2ae..3c5dfc4adbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,6 +64,7 @@ gstreamer-gl = "0.23" gstreamer-gl-sys = "0.23" gstreamer-sys = "0.23" gstreamer-video = "0.23" +harfbuzz-sys = "0.6.1" headers = "0.4" hitrace = "0.1.4" html5ever = "0.29" diff --git a/components/fonts/Cargo.toml b/components/fonts/Cargo.toml index a1013380826..0079bb898ad 100644 --- a/components/fonts/Cargo.toml +++ b/components/fonts/Cargo.toml @@ -26,7 +26,8 @@ euclid = { workspace = true } fnv = { workspace = true } fontsan = { git = "https://github.com/servo/fontsan" } fonts_traits = { workspace = true } -harfbuzz-sys = "0.6.1" +# FIXME (#34517): macOS only needs this when building libservo without `--features media-gstreamer` +harfbuzz-sys = { workspace = true, features = ["bundled"] } ipc-channel = { workspace = true } itertools = { workspace = true } libc = { workspace = true } @@ -62,7 +63,6 @@ core-graphics = "0.23" core-text = "20.1" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -harfbuzz-sys = { version = "0.6", features = ["bundled"] } freetype-sys = { workspace = true } servo_allocator = { path = "../allocator" } @@ -72,11 +72,6 @@ fontconfig_sys = { package = "yeslogic-fontconfig-sys", version = "6" } [target.'cfg(target_os = "android")'.dependencies] xml-rs = "0.8" -[target.'cfg(target_env = "ohos")'.dependencies] -harfbuzz-sys = { version = "0.6.1", features = ["bundled"] } - - [target.'cfg(target_os = "windows")'.dependencies] -harfbuzz-sys = { version = "0.6", features = ["bundled"] } dwrote = "0.11.2" truetype = { version = "0.47.3", features = ["ignore-invalid-language-ids"] } diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 0b0706b22fa..b7d300afe60 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -88,7 +88,6 @@ servo_geometry = { path = "../geometry" } servo_url = { path = "../url" } style = { workspace = true } style_traits = { workspace = true } -surfman = { workspace = true } tracing = { workspace = true, optional = true } webdriver_server = { path = "../webdriver_server", optional = true } webgpu = { path = "../webgpu" } @@ -98,5 +97,11 @@ webrender_traits = { workspace = true } webxr = { workspace = true, optional = true } webxr-api = { workspace = true, optional = true } +[target.'cfg(any(target_os = "android", target_env = "ohos"))'.dependencies] +surfman = { workspace = true, features = ["sm-angle-default"] } + +[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies] +surfman = { workspace = true, features = ["sm-x11", "sm-raw-window-handle-06"] } + [target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android"), not(target_env = "ohos"), not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies] gaol = "0.2.1" diff --git a/python/servo/try_parser.py b/python/servo/try_parser.py index a2efbec6548..f9297bc5ea9 100644 --- a/python/servo/try_parser.py +++ b/python/servo/try_parser.py @@ -57,6 +57,7 @@ class JobConfig(object): wpt_layout: Layout = Layout.none profile: str = "release" unit_tests: bool = False + build_libservo: bool = False bencher: bool = False wpt_args: str = "" # These are the fields that must match in between two JobConfigs for them to be able to be @@ -72,6 +73,7 @@ class JobConfig(object): self.wpt_layout |= other.wpt_layout self.unit_tests |= other.unit_tests + self.build_libservo |= other.build_libservo self.bencher |= other.bencher self.update_name() return True @@ -92,6 +94,8 @@ class JobConfig(object): modifier.append(self.profile.title()) if self.unit_tests: modifier.append("Unit Tests") + if self.build_libservo: + modifier.append("Build libservo") if self.wpt_layout != Layout.none: modifier.append("WPT") if self.bencher: @@ -131,6 +135,8 @@ def handle_modifier(config: JobConfig, s: str) -> Optional[JobConfig]: s = s.lower() if "unit-tests" in s: config.unit_tests = True + if "build-libservo" in s: + config.build_libservo = True if "production" in s: config.profile = "production" if "bencher" in s: @@ -175,8 +181,11 @@ class Config(object): self.fail_fast = True continue # skip over keyword if word == "full": - words.extend(["linux-unit-tests", "linux-wpt-2020", "linux-bencher"]) - words.extend(["macos-unit-tests", "windows-unit-tests", "android", "ohos", "lint"]) + words.extend(["linux-unit-tests", "linux-build-libservo", "linux-wpt-2020", "linux-bencher"]) + words.extend([ + "macos-unit-tests", "macos-build-libservo", "windows-unit-tests", "windows-build-libservo", + "android", "ohos", "lint", + ]) continue # skip over keyword if word == "bencher": words.extend(["linux-bencher", "macos-bencher", "windows-bencher", "android-bencher", "ohos-bencher"]) @@ -220,6 +229,7 @@ class TestParser(unittest.TestCase): 'name': 'Linux (Unit Tests)', 'profile': 'release', 'unit_tests': True, + 'build_libservo': False, 'workflow': 'linux', 'wpt_layout': 'none', 'wpt_args': '' @@ -230,29 +240,32 @@ class TestParser(unittest.TestCase): self.assertDictEqual(json.loads(Config("").to_json()), {"fail_fast": False, "matrix": [ { - "name": "Linux (Unit Tests, WPT, Bencher)", + "name": "Linux (Unit Tests, Build libservo, WPT, Bencher)", "workflow": "linux", "wpt_layout": "2020", "profile": "release", "unit_tests": True, + 'build_libservo': True, 'bencher': True, "wpt_args": "" }, { - "name": "MacOS (Unit Tests)", + "name": "MacOS (Unit Tests, Build libservo)", "workflow": "macos", "wpt_layout": "none", "profile": "release", "unit_tests": True, + 'build_libservo': True, 'bencher': False, "wpt_args": "" }, { - "name": "Windows (Unit Tests)", + "name": "Windows (Unit Tests, Build libservo)", "workflow": "windows", "wpt_layout": "none", "profile": "release", "unit_tests": True, + 'build_libservo': True, 'bencher': False, "wpt_args": "" }, @@ -262,6 +275,7 @@ class TestParser(unittest.TestCase): "wpt_layout": "none", "profile": "release", "unit_tests": False, + 'build_libservo': False, 'bencher': False, "wpt_args": "" }, @@ -271,6 +285,7 @@ class TestParser(unittest.TestCase): "wpt_layout": "none", "profile": "release", "unit_tests": False, + 'build_libservo': False, 'bencher': False, "wpt_args": "" }, @@ -280,6 +295,7 @@ class TestParser(unittest.TestCase): "wpt_layout": "none", "profile": "release", "unit_tests": False, + 'build_libservo': False, 'bencher': False, "wpt_args": ""} ]}) @@ -292,6 +308,7 @@ class TestParser(unittest.TestCase): 'name': 'Linux (WPT)', 'profile': 'release', 'unit_tests': False, + 'build_libservo': False, 'workflow': 'linux', 'wpt_layout': 'all', 'wpt_args': ''