Repository navigation
evergreen: Generate a truthful build-time manifest.json - #13462
Merged
Merged
Conversation
Contributor
|
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to automatically generate an Evergreen manifest.json file during the build process, mapping the Cobalt LTS version to its corresponding Evergreen version. It adds a GN helper to parse the Cobalt version, a Python script to perform the conversion and write the manifest, and corresponding unit tests. However, there is a critical issue in cobalt_version.gni where string_replace is called with four arguments, which is not supported in GN and will cause a build generation error.
jellefoks
approved these changes
Oct 20, 2026
Local Evergreen builds did not include a manifest.json under app/<target>/, so both the loader app and the updater fell back to the default Evergreen version 1.0.0 for the system image (slot 0). As a result, a device running a local LTS build would be served any production package whose version is greater than 1.0.0. This change generates app/<target>/manifest.json at build time with the Evergreen version derived from COBALT_VERSION, following the documented mapping <MAJOR>.lts.<MINOR> -> <MAJOR - 20>.<MINOR>.2 (2 denotes the "latest" release candidate). For example, 27.lts.10 maps to 7.10.2 and 27.lts.11 maps to 7.11.2. Development versions such as 27.master.0 have no Evergreen counterpart, so no manifest is generated for them and the existing behavior is unchanged. - Add //cobalt/build/cobalt_version.gni, which reads COBALT_VERSION from //cobalt/version.h via read_file() (no exec_script needed) and exposes `cobalt_version` and `cobalt_is_lts_version`. - Add cobalt/updater/version_manifest/generate_manifest.py (+ unit test) that performs the version mapping and writes the manifest. - Hook a generate_<target>_manifest action into the Evergreen loaded content in modular_executable.gni so the file is part of the runtime_deps and gets packaged/deployed with the rest of the installation. Bug: 573320042 TAG=agy CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915
Instead of skipping manifest generation for development versions such as 27.master.0, always generate app/<target>/manifest.json and write the default Evergreen version 1.0.0 for versions without an Evergreen counterpart. 1.0.0 is what the loader app and the updater already assume when no manifest is present, so the behavior of development builds is unchanged, and switching between LTS and development versions in the same output directory can no longer leave a stale manifest behind. Bug: 573320042 TAG=agy CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915
Address review feedback by documenting why non-LTS Cobalt versions fall back to the default Evergreen version. Bug: 573320042 TAG=agy CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915
yuying-y
enabled auto-merge (squash)
October 21, 2026 00:10
yuying-y
force-pushed
the
evergreen_build_time_manifest
branch
from
October 21, 2026 00:10
1c74cdc to
733ffc4
Compare
briantting
pushed a commit
that referenced
this pull request
Oct 22, 2026
…fest.json Refer to original PR: #13462 Local Evergreen builds did not include a `manifest.json` under `app/<target>/`, so both the loader app and the updater fell back to the default Evergreen version `1.0.0` for the system image (slot 0). As a result, a device running a local LTS build would be served any production package whose version is greater than `1.0.0`. This change generates `app/<target>/manifest.json` at build time with the Evergreen version derived from `COBALT_VERSION`, following the documented mapping `<MAJOR>.lts.<MINOR>` → `<MAJOR - 20>.<MINOR>.2` (2 denotes the "latest" release candidate). For example, `27.lts.10` maps to `7.10.2` and `27.lts.11` maps to `7.11.2`. Development versions such as `27.master.0` have no Evergreen counterpart, so their manifest is written with the default version `1.0.0` — the value the loader app and the updater already assume when no manifest is present — keeping their behavior unchanged. Always generating the file also means switching between LTS and development versions in the same out dir cannot leave a stale manifest behind. ### Changes - Add `//cobalt/build/cobalt_version.gni`, which reads `COBALT_VERSION` from `//cobalt/version.h` via `read_file()` (no `exec_script` needed) and exposes `cobalt_version`. - Add `cobalt/updater/version_manifest/generate_manifest.py` (+ unit tests) that performs the version mapping and writes the manifest. - Hook a `generate_<target>_manifest` action into the Evergreen loaded content in `modular_executable.gni` so the file is part of the `runtime_deps` and gets packaged/deployed with the rest of the installation. ### Verification - `python3 -m unittest cobalt.updater.version_manifest.generate_manifest_test` — 11/11 pass. - On `main` (`27.master.0`): `//cobalt:generate_cobalt_manifest` builds `{"version": "1.0.0"}` and `app/cobalt/manifest.json` is listed in `cobalt_loader` `runtime_deps`. - With `COBALT_VERSION` temporarily set to `27.lts.10` / `27.lts.11`: builds `{"version": "7.10.2"}` / `{"version": "7.11.2"}`; switching back to `27.master.0` regenerates `1.0.0`; a repeated build is a no-op. Bug: 573320042 TAG=agy CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915 (cherry picked from commit dd7a4d5)
briantting
pushed a commit
that referenced
this pull request
Oct 26, 2026
…fest.json Refer to original PR: #13462 Local Evergreen builds did not include a `manifest.json` under `app/<target>/`, so both the loader app and the updater fell back to the default Evergreen version `1.0.0` for the system image (slot 0). As a result, a device running a local LTS build would be served any production package whose version is greater than `1.0.0`. This change generates `app/<target>/manifest.json` at build time with the Evergreen version derived from `COBALT_VERSION`, following the documented mapping `<MAJOR>.lts.<MINOR>` → `<MAJOR - 20>.<MINOR>.2` (2 denotes the "latest" release candidate). For example, `27.lts.10` maps to `7.10.2` and `27.lts.11` maps to `7.11.2`. Development versions such as `27.master.0` have no Evergreen counterpart, so their manifest is written with the default version `1.0.0` — the value the loader app and the updater already assume when no manifest is present — keeping their behavior unchanged. Always generating the file also means switching between LTS and development versions in the same out dir cannot leave a stale manifest behind. ### Changes - Add `//cobalt/build/cobalt_version.gni`, which reads `COBALT_VERSION` from `//cobalt/version.h` via `read_file()` (no `exec_script` needed) and exposes `cobalt_version`. - Add `cobalt/updater/version_manifest/generate_manifest.py` (+ unit tests) that performs the version mapping and writes the manifest. - Hook a `generate_<target>_manifest` action into the Evergreen loaded content in `modular_executable.gni` so the file is part of the `runtime_deps` and gets packaged/deployed with the rest of the installation. ### Verification - `python3 -m unittest cobalt.updater.version_manifest.generate_manifest_test` — 11/11 pass. - On `main` (`27.master.0`): `//cobalt:generate_cobalt_manifest` builds `{"version": "1.0.0"}` and `app/cobalt/manifest.json` is listed in `cobalt_loader` `runtime_deps`. - With `COBALT_VERSION` temporarily set to `27.lts.10` / `27.lts.11`: builds `{"version": "7.10.2"}` / `{"version": "7.11.2"}`; switching back to `27.master.0` regenerates `1.0.0`; a repeated build is a no-op. Bug: 573320042 TAG=agy CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915 (cherry picked from commit dd7a4d5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local Evergreen builds did not include a
manifest.jsonunderapp/<target>/, so both the loader app and the updater fell back to the default Evergreen version1.0.0for the system image (slot 0). As a result, a device running a local LTS build would be served any production package whose version is greater than1.0.0.This change generates
app/<target>/manifest.jsonat build time with the Evergreen version derived fromCOBALT_VERSION, following the documented mapping<MAJOR>.lts.<MINOR>→<MAJOR - 20>.<MINOR>.2(2 denotes the "latest" release candidate). For example,27.lts.10maps to7.10.2and27.lts.11maps to7.11.2.Development versions such as
27.master.0have no Evergreen counterpart, so their manifest is written with the default version1.0.0— the value the loader app and the updater already assume when no manifest is present — keeping their behavior unchanged. Always generating the file also means switching between LTS and development versions in the same out dir cannot leave a stale manifest behind.Changes
//cobalt/build/cobalt_version.gni, which readsCOBALT_VERSIONfrom//cobalt/version.hviaread_file()(noexec_scriptneeded) and exposescobalt_version.cobalt/updater/version_manifest/generate_manifest.py(+ unit tests) that performs the version mapping and writes the manifest.generate_<target>_manifestaction into the Evergreen loaded content inmodular_executable.gniso the file is part of theruntime_depsand gets packaged/deployed with the rest of the installation.Verification
python3 -m unittest cobalt.updater.version_manifest.generate_manifest_test— 11/11 pass.main(27.master.0)://cobalt:generate_cobalt_manifestbuilds{"version": "1.0.0"}andapp/cobalt/manifest.jsonis listed incobalt_loaderruntime_deps.COBALT_VERSIONtemporarily set to27.lts.10/27.lts.11: builds{"version": "7.10.2"}/{"version": "7.11.2"}; switching back to27.master.0regenerates1.0.0; a repeated build is a no-op.Bug: 573320042
TAG=agy
CONV=cfbabc8d-e0a3-4bc7-84ca-97a280716915