6.9 KiB
name, description
| name | description |
|---|---|
| linux-chromium-build | MANDATORY procedure for Linux x86 Chromium configure, build, test, and build-failure investigation. Activate before proposing or executing a build-neva wrapper, GN, Ninja, autoninja, Siso, or Chromium test command. Verify configured locations, target/output directory, diagnostics, and active build state; report and stop if a prerequisite fails. |
Linux Chromium Build
Use this skill for Linux x86 Chromium builds and related tests. NEVA host builds
use build-neva wrappers.
Pre-launch hard stops
Do not launch a build, configure, or test command until every applicable check below has passed. If any check fails, report the missing or invalid value and STOP.
-
Check existing environment variables first. They may also be supplied in an existing
.envfile:CHROMIUM_SRC_DIR— Chromiumsrccheckout.CHROMIUM_WRAPPER_DIR— selectedbuild-nevadirectory.CHROMIUM_DEPOT_TOOLS_DIR— parentdepot_toolscheckout.CHROMIUM_BUILD_LOG— log file for an unattended build.
Use a set value exactly as supplied. In particular, if
CHROMIUM_BUILD_LOGis set, use it exclusively; do not construct another log path. An unattended build requiresCHROMIUM_BUILD_LOGto be set. Do not infer unverified absolute locations from the current directory or relative candidates. -
Verify that
CHROMIUM_SRC_DIR,CHROMIUM_WRAPPER_DIR, andCHROMIUM_DEPOT_TOOLS_DIRexist and that the selected wrapper directory contains the requested wrapper (chrome.bashorunit_tests.bash). -
Establish the exact output directory and target before a build. State the target explicitly even when the wrapper selects its default browser target.
-
If C/C++ source or header files changed, run the diagnostic procedure in
lsp-cli/SKILL.mdfor every modified file. Zero diagnostic errors is required before a build. Report warnings. If diagnostics cannot run or report any error, STOP. -
Check for active
autoninja, Siso, or Ninja build processes. If any is running, report it and STOP. Never kill, restart, or replace a running build without explicit user permission.
Start all builds from $CHROMIUM_WRAPPER_DIR.
Build Chromium
Build the browser with the wrapper's required depot_tools ordering:
cd "$CHROMIUM_WRAPPER_DIR"
PATH="$CHROMIUM_DEPOT_TOOLS_DIR:$CHROMIUM_WRAPPER_DIR/depot_tools:$PATH" \
TERM=xterm \
./chrome.bash
Build a focused unit-test target
For unattended runs, disable ccache as well: its setup can fail on tput under set -e.
cd "$CHROMIUM_WRAPPER_DIR"
PATH="$CHROMIUM_DEPOT_TOOLS_DIR:$CHROMIUM_WRAPPER_DIR/depot_tools:$PATH" \
CCACHE_DISABLE=1 \
TERM=xterm \
./unit_tests.bash <target>
unit_tests.bash defaults to out/unit_tests.
If you pass no target at all, get_all_targets_list() runs and builds every *_unittests target in the tree (filtering out //third_party, //chrome, //tools, //testing, plus blink).
The wrapper (unit_tests.bash) expects a GN label, and it strips the leading // before passing to ninja (build_gn_target ${target#//}). So the format is:
//extensions:extensions_unittests
//base:base_unittests
//content/test:content_unittests
And example call:
# With // prefix (what the wrapper strips internally)
./unit_tests.bash "//content/test:content_unittests"
# ninja-style, no prefix (also works since #// strips nothing)
./unit_tests.bash "content/test:content_unittests"
Unattended builds and logs
For a user-authorized new unattended build, start a new log session after the
pre-launch checks have passed. Truncate CHROMIUM_BUILD_LOG with > and write
a unique launch marker before starting the wrapper. Use >> only when
continuing that same already-running build session.
When polling, read only output after the current launch marker (or its recorded
byte offset). Do not cite earlier log entries as evidence about the current
build. Expect gclient sync, GN generation, and Siso to take substantial time
before the compiler starts.
cd "$CHROMIUM_WRAPPER_DIR"
build_session="codex-build-$(date -u +%Y%m%dT%H%M%SZ)"
: > "${CHROMIUM_BUILD_LOG:?set CHROMIUM_BUILD_LOG}"
printf '\n=== %s ===\n' "$build_session" >> "$CHROMIUM_BUILD_LOG"
nohup env \
PATH="$CHROMIUM_DEPOT_TOOLS_DIR:$CHROMIUM_WRAPPER_DIR/depot_tools:$PATH" \
CCACHE_DISABLE=1 \
TERM=xterm \
./unit_tests.bash <target> \
>> "$CHROMIUM_BUILD_LOG" 2>&1 &
When Siso is enabled, dots and S/F markers indicate activity, not a
failure or successful completion. Confirm activity using the current session's
new output and the active Siso process. Treat only explicit terminal output
such as Build Succeeded, Build Failure, FAILED:, or compiler diagnostics
as a result.
Test Chromium
Unless the user supplied the desired test command and environment, ask how tests should run before executing them. Run the relevant test after a successful build and use its output directory, for example:
cd "$CHROMIUM_SRC_DIR/out/unit_tests"
./content_unittests --gtest_filter='<suite>.<test>'
Another example with environment variables:
cd "$CHROMIUM_SRC_DIR/out/unit_tests"
XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/1000}" \
WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" \
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \
DISPLAY=:0 \
./browser_tests --gtest_filter='<suite>.<test>' \
--no-sandbox \
--headless=new \
--enable-logging=stderr
Debug Chromium failures
Read the failing source, target BUILD.gn, and at least one call site before
changing code. Consult Chromium's relevant docs/ and source rather than
relying on general knowledge. Use targeted rg queries; do not use recursive
grep, git grep, or find in this tree.
-
For a missing header, verify the target's
depsand include path. Inspect the existing, wrapper-configured graph withgn descandgn checkfrom$CHROMIUM_SRC_DIR. Do not use directgn genas the normal regeneration path: it bypasses the wrapper'sgclientconfiguration, generatedargs.gn, and ccache/icecc setup. Regenerate throughbuild-nevainstead:cd "$CHROMIUM_WRAPPER_DIR" PATH="$CHROMIUM_DEPOT_TOOLS_DIR:$CHROMIUM_WRAPPER_DIR/depot_tools:$PATH" \ TERM=xterm \ ./chrome.bash --configure
For a unit test
cd "$CHROMIUM_WRAPPER_DIR"
PATH="$CHROMIUM_DEPOT_TOOLS_DIR:$CHROMIUM_WRAPPER_DIR/depot_tools:$PATH" \
CCACHE_DISABLE=1 \
TERM=xterm \
./unit_tests.bash --configure <target>
- For an undefined symbol, confirm the providing target appears in
depsand thatis_component_buildinargs.gnmatches the intended build. - For a visibility error, inspect the dependency target's
visibilitybefore changing it. - For runtime problems, consult
docs/debugging.mdin the Chromium checkout. - Changing USE_SISO from true to false will trigger full rebuild.
- If
gclientis missing, verify that both the parent and wrapperdepot_toolsdirectories are first onPATHin that order.