From 8b563ac0571a46c2ec3c081e50f7f867dcca1b76 Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Fri, 11 Oct 2024 10:57:27 -0700 Subject: [PATCH] Add Chrobalt build configs (#4248) This adds Chrobalt specific build configs into the build matrix b/354062221 --- .github/actions/build/action.yaml | 4 +- .github/actions/docker/action.yaml | 2 +- .github/config/android-chrobalt-arm.json | 27 ++++++ .github/config/android-chrobalt-arm64.json | 26 ++++++ .github/config/android-chrobalt-x86.json | 26 ++++++ .github/config/linux-chrobalt.json | 24 +++++ .github/workflows/android.yaml | 25 ++++++ .github/workflows/linux.yaml | 10 +++ .github/workflows/main.yaml | 6 +- .../configs/android-chrobalt-arm/args.gn | 4 + .../configs/android-chrobalt-arm64/args.gn | 4 + .../configs/android-chrobalt-x86/args.gn | 4 + .../args.gn} | 8 +- chrobalt/build/configs/linux-x64/args.gn | 89 +++++++++++++++++++ chrobalt/build/gn.py | 11 ++- 15 files changed, 259 insertions(+), 11 deletions(-) create mode 100644 .github/config/android-chrobalt-arm.json create mode 100644 .github/config/android-chrobalt-arm64.json create mode 100644 .github/config/android-chrobalt-x86.json create mode 100644 .github/config/linux-chrobalt.json create mode 100644 chrobalt/build/configs/android-chrobalt-arm/args.gn create mode 100644 chrobalt/build/configs/android-chrobalt-arm64/args.gn create mode 100644 chrobalt/build/configs/android-chrobalt-x86/args.gn rename chrobalt/build/configs/{linux-x64x11/last_working.gn => linux-chrobalt-x64x11/args.gn} (95%) create mode 100644 chrobalt/build/configs/linux-x64/args.gn diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml index 9d6c3366bd9ed..cff0d56d55af0 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/action.yaml @@ -1,5 +1,5 @@ -name: Build Cobalt -description: Builds Cobalt targets +name: Build Chrobalt +description: Builds Chrobalt targets inputs: targets: description: "List of ninja targets for Chrobalt build." diff --git a/.github/actions/docker/action.yaml b/.github/actions/docker/action.yaml index 3b8eecd079bdd..e99d3ccbd9d2e 100644 --- a/.github/actions/docker/action.yaml +++ b/.github/actions/docker/action.yaml @@ -1,5 +1,5 @@ name: Docker Image Build -description: Builds Cobalt build docker images. +description: Builds Chrobalt build docker images. inputs: docker_service: description: "Docker compose service." diff --git a/.github/config/android-chrobalt-arm.json b/.github/config/android-chrobalt-arm.json new file mode 100644 index 0000000000000..93cf80c5da6d9 --- /dev/null +++ b/.github/config/android-chrobalt-arm.json @@ -0,0 +1,27 @@ + +{ + "docker_service": "linux", + "platforms": [ + "android-chrobalt-arm" + ], + "targets": [ + "base_unittests", + "sql_unittests", + "net_unittests", + "url_unittests", + "ipc_tests", + "mojo_unittests", + "gpu_unittests", + "gin_unittests", + "blink_unittests", + "content_shell", + "system_webview_apk", + "system_webview_shell_apk" + ], + "includes": [ + { + "name":"arm", + "platform":"android-chrobalt-arm" + } + ] +} diff --git a/.github/config/android-chrobalt-arm64.json b/.github/config/android-chrobalt-arm64.json new file mode 100644 index 0000000000000..dee39e66a85be --- /dev/null +++ b/.github/config/android-chrobalt-arm64.json @@ -0,0 +1,26 @@ +{ + "docker_service": "linux", + "platforms": [ + "android-chrobalt-arm64" + ], + "targets": [ + "base_unittests", + "sql_unittests", + "net_unittests", + "url_unittests", + "ipc_tests", + "mojo_unittests", + "gpu_unittests", + "gin_unittests", + "blink_unittests", + "content_shell", + "system_webview_apk", + "system_webview_shell_apk" + ], + "includes": [ + { + "name":"arm64", + "platform":"android-chrobalt-arm64" + } + ] +} diff --git a/.github/config/android-chrobalt-x86.json b/.github/config/android-chrobalt-x86.json new file mode 100644 index 0000000000000..fef19d418539f --- /dev/null +++ b/.github/config/android-chrobalt-x86.json @@ -0,0 +1,26 @@ +{ + "docker_service": "linux", + "platforms": [ + "android-chrobalt-x86" + ], + "targets": [ + "base_unittests", + "sql_unittests", + "net_unittests", + "url_unittests", + "ipc_tests", + "mojo_unittests", + "gpu_unittests", + "gin_unittests", + "blink_unittests", + "content_shell", + "system_webview_apk", + "system_webview_shell_apk" + ], + "includes": [ + { + "name":"x86", + "platform":"android-chrobalt-x86" + } + ] +} diff --git a/.github/config/linux-chrobalt.json b/.github/config/linux-chrobalt.json new file mode 100644 index 0000000000000..2ed25f672a728 --- /dev/null +++ b/.github/config/linux-chrobalt.json @@ -0,0 +1,24 @@ +{ + "docker_service": "linux", + "platforms": [ + "linux-chrobalt-x64x11" + ], + "targets": [ + "base_unittests", + "sql_unittests", + "net_unittests", + "url_unittests", + "ipc_tests", + "mojo_unittests", + "gpu_unittests", + "gin_unittests", + "blink_unittests", + "content_shell" + ], + "includes": [ + { + "name":"x64", + "platform":"linux-chrobalt-x64x11" + } + ] + } diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 56e0e1f37914c..520a23f5bc25e 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -45,3 +45,28 @@ jobs: with: platform: android-x86 nightly: ${{ github.event.inputs.nightly }} + # Chrobalt specific build configs + android-chrobalt-arm64: + uses: ./.github/workflows/main.yaml + permissions: + packages: write + pull-requests: write + with: + platform: android-chrobalt-arm64 + nightly: ${{ github.event.inputs.nightly }} + android-chrobalt-arm: + uses: ./.github/workflows/main.yaml + permissions: + packages: write + pull-requests: write + with: + platform: android-chrobalt-arm + nightly: ${{ github.event.inputs.nightly }} + android-chrobalt-x86: + uses: ./.github/workflows/main.yaml + permissions: + packages: write + pull-requests: write + with: + platform: android-chrobalt-x86 + nightly: ${{ github.event.inputs.nightly }} diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 1a3accc5a7249..c4a8053ca026c 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -21,6 +21,7 @@ on: default: false jobs: + # This is default Chromium build config linux-x64: uses: ./.github/workflows/main.yaml permissions: @@ -29,3 +30,12 @@ jobs: with: platform: linux nightly: ${{ github.event.inputs.nightly }} + # This is default Chrobalt build config + linux-chrobalt: + uses: ./.github/workflows/main.yaml + permissions: + packages: write + pull-requests: write + with: + platform: linux-chrobalt + nightly: ${{ github.event.inputs.nightly }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index efbcd02dd5203..6acddd3e080fd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -# Reusable Cobalt CI workflow. +# Reusable Chrobalt CI workflow. name: main @@ -6,7 +6,7 @@ on: workflow_call: inputs: platform: - description: 'Cobalt platform.' + description: 'Chrobalt platform.' required: true type: string nightly: @@ -137,7 +137,7 @@ jobs: SCCACHE_IDLE_TIMEOUT: 0 # prevent sccache server from shutting down after long idle. # We want temp folder to be on tmpfs which makes workloads faster. # However, dind container ends up having / folder mounted on overlay - # filesystem, whereas /__w which contains Cobalt source code is on tmpfs. + # filesystem, whereas /__w which contains Chrobalt source code is on tmpfs. TMPDIR: /__w/_temp steps: - name: Checkout diff --git a/chrobalt/build/configs/android-chrobalt-arm/args.gn b/chrobalt/build/configs/android-chrobalt-arm/args.gn new file mode 100644 index 0000000000000..110d5b3ffb68b --- /dev/null +++ b/chrobalt/build/configs/android-chrobalt-arm/args.gn @@ -0,0 +1,4 @@ +target_os = "android" +target_cpu = "arm" + +is_chrobalt=true diff --git a/chrobalt/build/configs/android-chrobalt-arm64/args.gn b/chrobalt/build/configs/android-chrobalt-arm64/args.gn new file mode 100644 index 0000000000000..cba0acdbd47a7 --- /dev/null +++ b/chrobalt/build/configs/android-chrobalt-arm64/args.gn @@ -0,0 +1,4 @@ +target_os = "android" +target_cpu = "arm64" + +is_chrobalt=true diff --git a/chrobalt/build/configs/android-chrobalt-x86/args.gn b/chrobalt/build/configs/android-chrobalt-x86/args.gn new file mode 100644 index 0000000000000..462e99daee4b8 --- /dev/null +++ b/chrobalt/build/configs/android-chrobalt-x86/args.gn @@ -0,0 +1,4 @@ +target_os = "android" +target_cpu = "x86" + +is_chrobalt=true diff --git a/chrobalt/build/configs/linux-x64x11/last_working.gn b/chrobalt/build/configs/linux-chrobalt-x64x11/args.gn similarity index 95% rename from chrobalt/build/configs/linux-x64x11/last_working.gn rename to chrobalt/build/configs/linux-chrobalt-x64x11/args.gn index ba483e1059746..a93596177e144 100644 --- a/chrobalt/build/configs/linux-x64x11/last_working.gn +++ b/chrobalt/build/configs/linux-chrobalt-x64x11/args.gn @@ -1,11 +1,14 @@ -# Use sccache -cc_wrapper = "sccache" +target_os = "linux" +target_cpu = "x64" + +is_chrobalt=true enable_nacl=false use_dawn=false skia_use_dawn=false # enable_vulkan=false +use_ozone=true # Enterprise stuff enable_print_content_analysis=false @@ -83,3 +86,4 @@ enable_vr=false use_kerberos=false toolkit_views = true +chrome_pgo_phase = 0 \ No newline at end of file diff --git a/chrobalt/build/configs/linux-x64/args.gn b/chrobalt/build/configs/linux-x64/args.gn new file mode 100644 index 0000000000000..a93596177e144 --- /dev/null +++ b/chrobalt/build/configs/linux-x64/args.gn @@ -0,0 +1,89 @@ +target_os = "linux" +target_cpu = "x64" + +is_chrobalt=true + +enable_nacl=false +use_dawn=false +skia_use_dawn=false +# enable_vulkan=false + +use_ozone=true + +# Enterprise stuff +enable_print_content_analysis=false +# enterprise_client_certificates=false +enterprise_cloud_content_analysis=false +enterprise_content_analysis=true +enterprise_data_controls=true +enterprise_local_content_analysis=false +enterprise_watermark=false + + +optional_trace_events_enabled = false +enable_plugins = false +enable_pdf = false +enable_printing = false +enable_cast_receiver = false +enable_paint_preview=false +cast_streaming_enable_remoting = false + +# +enable_background_contents=false +enable_background_mode=false +enable_chrome_notifications=false +enable_click_to_call=false + +enable_system_notifications=false + +enable_webui_certificate_viewer=false + +enable_hidpi = false + +enable_library_cdms = false + +# disable swiftshader +enable_swiftshader = false +enable_swiftshader_vulkan = false +swiftshader_optimized_debug_build=false +use_swiftshader_with_subzero=false +angle_enable_swiftshader=false +dawn_use_swiftshader=false + + +# Disable webnn neural networks | tflite +webnn_use_tflite = false +enable_maldoca = false +enable_reading_list = false +enable_remoting = false +enable_screen_ai_service = true + +# linux system interfaces +use_bluez = false +use_cups = false +use_dbus = false +use_mpris = false +use_udev = false +use_qt = false +use_qt6 = false + +# printing stuff +enable_oop_basic_print_dialog = false +enable_basic_print_dialog = false +enable_basic_printing = false +enable_oop_basic_print_dialog = false +enable_oop_printing = false +enable_oop_printing_no_oop_basic_print_dialog=false +enable_print_content_analysis= false +enable_print_preview=false +enable_printing=false +enable_printing_tests=false +use_cups=false + +enable_vr=false + +# Network stuff +use_kerberos=false + +toolkit_views = true +chrome_pgo_phase = 0 \ No newline at end of file diff --git a/chrobalt/build/gn.py b/chrobalt/build/gn.py index 9d437f68b36f7..1d89133038280 100755 --- a/chrobalt/build/gn.py +++ b/chrobalt/build/gn.py @@ -136,10 +136,15 @@ def main(out_directory: str, platform: str, build_type: str, '-p', '--platform', default='linux', - choices=['linux-x64x11', - 'android-arm', + choices=[ + 'linux-x64x11', + 'linux-chrobalt-x64x11', + 'android-arm', 'android-arm64', - 'android-x86', + 'android-x86', + 'android-chrobalt-arm', + 'android-chrobalt-arm64', + 'android-chrobalt-x86', 'linux'], help='The platform to build.') parser.add_argument('-c',