0

linux: Do not checkout mutter sources by default

Mutter and its dependencies in third_party are currently checked out by
default on linux, which require an additional 300 MB disk space.

Since developers don't need to run these tests locally most of the time,
add the option to checkout the mutter sources by explicitly setting
`checkout_mutter` .gclient custom var.

Bug: 401977530
Change-Id: I83a976c7a15da69e7c3a6e86fe0dca8966cd339c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6338729
Reviewed-by: Maksim Sisov <msisov@igalia.com>
Commit-Queue: Orko Garai <orko@igalia.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431078}
This commit is contained in:
Orko Garai
2025-03-11 12:52:46 -07:00
committed by Chromium LUCI CQ
parent 17e042dfc1
commit 98c06a582f
5 changed files with 56 additions and 20 deletions
.gitmodulesDEPS
docs
testing
ui/ozone/platform/wayland

12
.gitmodules vendored

@ -902,24 +902,24 @@
[submodule "third_party/libdisplay-info/src"]
path = third_party/libdisplay-info/src
url = https://chromium.googlesource.com/external/gitlab.freedesktop.org/emersion/libdisplay-info
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter
[submodule "third_party/libinput/src"]
path = third_party/libinput/src
url = https://chromium.googlesource.com/external/gitlab.freedesktop.org/libinput/libinput
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter
[submodule "third_party/gvdb/src"]
path = third_party/gvdb/src
url = https://chromium.googlesource.com/external/gitlab.gnome.org/GNOME/gvdb
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter
[submodule "third_party/glib/src"]
path = third_party/glib/src
url = https://chromium.googlesource.com/external/gitlab.gnome.org/GNOME/glib
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter
[submodule "third_party/libgudev/src"]
path = third_party/libgudev/src
url = https://chromium.googlesource.com/external/gitlab.gnome.org/GNOME/libgudev
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter
[submodule "third_party/mutter/src"]
path = third_party/mutter/src
url = https://chromium.googlesource.com/external/gitlab.gnome.org/GNOME/mutter
gclient-condition = checkout_linux
gclient-condition = checkout_linux and checkout_mutter

17
DEPS

@ -45,6 +45,7 @@ gclient_gn_args = [
'checkout_copybara',
'checkout_glic_e2e_tests',
'checkout_ios_webkit',
'checkout_mutter',
'checkout_nacl',
'checkout_openxr',
'checkout_src_internal',
@ -113,6 +114,10 @@ vars = {
# output.
'checkout_js_coverage_modules': True,
# Checkout out mutter and its dependencies to be able to run tests like
# interactive_ui_tests on the linux/wayland compositor.
'checkout_mutter': False,
# Check out and download nacl for ChromeOS only.
# This can be disabled e.g. with custom_vars.
'checkout_nacl': 'checkout_chromeos',
@ -2031,12 +2036,12 @@ deps = {
'src/third_party/glib/src': {
'url': Var('chromium_git') + '/external/gitlab.gnome.org/GNOME/glib.git' + '@' + '95eafc073843cb6e8c848f3850c074a83e01427c',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
'src/third_party/gvdb/src': {
'url': Var('chromium_git') + '/external/gitlab.gnome.org/GNOME/gvdb.git' + '@' + 'b54bc5da25127ef416858a3ad92e57159ff565b3',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
'src/third_party/freetype/src':
@ -2314,7 +2319,7 @@ deps = {
'src/third_party/libdisplay-info/src': {
'url': Var('chromium_git') + '/external/gitlab.freedesktop.org/emersion/libdisplay-info.git' + '@' + '66b802d05b374cd8f388dc6ad1e7ae4f08cb3300',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
# Userspace interface to kernel DRM services.
@ -2325,12 +2330,12 @@ deps = {
'src/third_party/libgudev/src': {
'url': Var('chromium_git') + '/external/gitlab.gnome.org/GNOME/libgudev.git' + '@' + 'df7c9c9940160307aaeb31347f4776a46f8736a9',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
'src/third_party/libinput/src': {
'url': Var('chromium_git') + '/external/gitlab.freedesktop.org/libinput/libinput.git' + '@' + '3aa004b96488bf0b2446c11b97a7f8a75ff37c23',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
'src/third_party/expat/src':
@ -2451,7 +2456,7 @@ deps = {
'src/third_party/mutter/src': {
'url': Var('chromium_git') + '/external/gitlab.gnome.org/GNOME/mutter.git' + '@' + '30b7162b54de7681fb585d095de8a5ffaf771d38',
'condition': 'checkout_linux',
'condition': 'checkout_linux and checkout_mutter',
},
'src/third_party/nasm': {

@ -309,19 +309,33 @@ you can use a locally compiled version of Weston or Mutter. This is what the
build bots do. Please note that this is required for interactive_ui_tests, as
those tests use a patched version of the compositor.
Add this to your gn args:
Mutter and its dependencies are not checked out by default to keep the disk
usage optimal for most developers. In order to checkout mutter, add the
`checkout_mutter` custom var in your .gclient file and set it to `True` and run `gclient sync`.
```
solutions = [
{
"url": "https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"name": "src",
"custom_deps": {},
"custom_vars": {
"checkout_mutter": True,
},
},
]
```
For weston, simply add this to your gn args:
``` shell
# For weston
use_bundled_weston = true
```
``` shell
# For mutter
use_bundled_mutter = true
```
Then run the xvfb.py wrapper script and tell it to start the compositor with the tests:
Then after building the test executable, run the xvfb.py wrapper script and tell
it to start the compositor with the tests:
``` shell
cd out/debug # or your out directory

@ -611,6 +611,18 @@ def _weston_config_file_path():
def _run_with_mutter(cmd, env, stdoutfile, cwd):
# Ensure mutter is checked out first.
if not os.path.isdir(
os.path.join(os.path.dirname(__file__), '..', 'third_party', 'mutter',
'src')):
print(
'In order to run tests using mutter, its sources need to be checked out'
' explicitly and built.\n'
'Add \'"checkout_mutter": True\' in the "custom_vars" section of your'
' .gclient file, and run gclient sync.\n'
'Then build the test executable or mutter and run this script again.',
file=sys.stderr)
return 1
with dbus_session(env):
mutter_proc = None

@ -17,5 +17,10 @@ declare_args() {
use_bundled_weston = false
# Checks if mutter must be compiled
use_bundled_mutter = false
use_bundled_mutter = checkout_mutter
}
assert(
!use_bundled_mutter || checkout_mutter,
"'use_bundled_mutter' gn arg is set to true but sources not checked out. " +
"Set 'checkout_mutter' custom var in .gclient and run gclient sync.")