Skip to content

ci/cto: Flatten compile-time options testing - #49161

Merged
phlax merged 2 commits into
envoyproxy:mainfrom
phlax:ci-cto-per-option
Nov 11, 2026
Merged

phlax merged 2 commits into
envoyproxy:mainfrom
phlax:ci-cto-per-option

Conversation

@phlax

@phlax phlax commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

The check ran the whole tree twice in one job, each time with several options mixed in. It is now one do_ci.sh subtask and one Check/build job per option:

  • cto.base: the compile-time-options config plus jemalloc, all tests
  • cto.noadmin: admin disabled, all tests
  • cto.gperftools: the server tests and those that observe allocation
  • cto.wamr, cto.wasmtime: the wasm extension tests, and those that link the engine with the rest of Envoy (the server, dynamic modules)
  • cto.asserts, cto.nolog: the same targets as before

compile_time_options (or cto) runs them all. Test runs use --build_tests_only.

Jobs are enabled and path selected by check-build-cto-<option> run flags; a branch with none keeps the single compile_time_options job.

Fixes AdminInstanceTest.MemoryTcmalloc under jemalloc.

Requires #49170, which this is stacked on.

This comment was marked as outdated.

@phlax
phlax force-pushed the ci-cto-per-option branch 2 times, most recently from 9463c29 to b40c173 Compare November 10, 2026 22:20
@phlax
phlax marked this pull request as draft November 10, 2026 22:22
@phlax phlax changed the title ci: One Check/build job per compile-time option [WIP] ci: One Check/build job per compile-time option Nov 10, 2026
@phlax
phlax force-pushed the ci-cto-per-option branch 9 times, most recently from 6b5f21c to 0b0df52 Compare November 11, 2026 11:35
@phlax phlax changed the title [WIP] ci: One Check/build job per compile-time option [WIP] ci/cto: Flatten compile-time options testing Nov 11, 2026
@phlax
phlax force-pushed the ci-cto-per-option branch 2 times, most recently from 96f4592 to ec407bd Compare November 11, 2026 11:44
@phlax
phlax requested a balanced review from Copilot November 11, 2026 11:46
@phlax
phlax force-pushed the ci-cto-per-option branch from ec407bd to 0567854 Compare November 11, 2026 11:53

This comment was marked as outdated.

@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

tested in parallel in staging

The check ran the whole tree twice in one job, each time with several
options mixed in. It is now one `do_ci.sh` subtask and one Check/build
job per option:

- `cto.base`: the `compile-time-options` config plus jemalloc, all tests
- `cto.noadmin`: admin disabled, all tests
- `cto.gperftools`: the server tests and those that observe allocation
- `cto.wamr`, `cto.wasmtime`: the wasm extension tests, and those that link
  the engine with the rest of Envoy (the server, dynamic modules)
- `cto.asserts`, `cto.nolog`: the same targets as before

`compile_time_options` (or `cto`) runs them all. Test runs use
`--build_tests_only`.

Jobs are enabled and path selected by `check-build-cto-<option>` run
flags; a branch with none keeps the single `compile_time_options` job.

Fixes AdminInstanceTest.MemoryTcmalloc under jemalloc.

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax force-pushed the ci-cto-per-option branch from be13a82 to bf5d863 Compare November 11, 2026 13:51
@phlax phlax changed the title [WIP] ci/cto: Flatten compile-time options testing ci/cto: Flatten compile-time options testing Nov 11, 2026
@phlax
phlax marked this pull request as ready for review November 11, 2026 13:52
@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

/retest flakey docker

@jwendell jwendell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flattening into per-option jobs looks good. I checked the run-flag to matrix wiring (with the single-job fallback for older branches), that dropping docker-ci: true is a no-op on main (GITHUB_ACTIONS selects the ci image), that the wasm/allocator target lists cover the tests that depend on them, and that the jemalloc test fix matches Memory::Stats::dumpStats() (malloc_stats_print output). A few comments inline.

Comment thread .github/config.yml Outdated
- source/common/common/BUILD
- source/common/common/assert.cc
- source/common/common/assert.h
- source/server/**/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path filter seems too narrow. The point of this job is to build with -c opt while ASSERTs stay compiled in. That catches ASSERTs that refer to things only defined in debug builds (e.g. #ifndef NDEBUG members), and those ASSERTs can be anywhere in the code server_test links. A change to source/common/**, envoy/** or an extension wouldn't trigger the job, so the break would only appear after merge. assert.h itself includes envoy/common/logger.h and source/common/common/logger.h, which aren't listed either. Could this use the same source/** / envoy/** set as nolog?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, done in 649f71b: cto.asserts now has the nolog set (api/**, envoy/**, source/**, third_party/**) plus test/**, as the tests it runs link test code too.

Comment thread ci/do_ci.sh
# The options their test runs add. They build only what the tests depend on: targets under test/
# that no test uses (benchmark, fuzz and tool binaries) are built by the rest of CI, and leaving
# them out here takes about a third off the analysis.
read -ra CTO_TEST_OPTIONS <<< "${CTO_TEST_OPTIONS:---build_tests_only}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says benchmark, fuzz and tool binaries "are built by the rest of CI", but not with --config=compile-time-options. Nothing builds them with google_grpc=disabled, hot_restart=disabled, deprecated_features=disabled or uhv any more. Is losing that coverage intended? If so, the comment should probably say so.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, intended: a target under test/ that no test depends on is not built with these options any more, only with the defaults elsewhere in CI. Everything the tests depend on still is. The comment now says that rather than implying equivalent coverage (649f71b).

Comment thread ci/do_ci.sh
--@envoy//bazel:jemalloc=True \
"${TEST_TARGETS[@]}"
;;
cto.wamr|cto.wasmtime)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cto.wamr, cto.wasmtime and cto.gperftools ignore any targets passed on the command line. For example, ./ci/do_ci.sh cto.wamr //test/foo/... quietly runs the default list. Either honour explicit targets or note this in ci/README.md next to cto.base <test>.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honoured in 649f71b: tests given on the command line now replace the default lists for cto.wamr, cto.wasmtime and cto.gperftools. ci/README.md says cto.<option> <test>, and that cto.asserts and cto.nolog have fixed targets.

Comment thread ci/do_ci.sh Outdated
# these tests under "-c opt" to save time in CI.
bazel_with_collection \
test "${BAZEL_BUILD_OPTIONS[@]}" \
--config=compile-time-options \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: cto.asserts hard-codes --config=compile-time-options instead of using CTO_OPTIONS, so overriding that variable has no effect on this job. Since it needs -c opt anyway, maybe a short comment saying it intentionally skips CTO_OPTIONS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 649f71b to use CTO_OPTIONS followed by -c opt, which replaces any -c in it, so the override applies here too.

- widen the `cto.asserts` path selection to the source and test trees
- say that test binaries no test uses are no longer built with the options
- tests given on the command line replace the wamr, wasmtime and
  gperftools test lists
- `cto.asserts` uses `CTO_OPTIONS`

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax merged commit 3b16c1b into envoyproxy:main Nov 11, 2026
24 of 25 checks passed
phlax added a commit to phlax/envoy that referenced this pull request Nov 11, 2026
The check ran the whole tree twice in one job, each time with several
options mixed in. It is now one `do_ci.sh` subtask and one Check/build
job per option:

- `cto.base`: the `compile-time-options` config plus jemalloc, all tests
- `cto.noadmin`: admin disabled, all tests
- `cto.gperftools`: the server tests and those that observe allocation
- `cto.wamr`, `cto.wasmtime`: the wasm extension tests, and those that
link the engine with the rest of Envoy (the server, dynamic modules)
- `cto.asserts`, `cto.nolog`: the same targets as before

`compile_time_options` (or `cto`) runs them all. Test runs use
`--build_tests_only`.

Jobs are enabled and path selected by `check-build-cto-<option>` run
flags; a branch with none keeps the single `compile_time_options` job.

Fixes AdminInstanceTest.MemoryTcmalloc under jemalloc.

Requires envoyproxy#49170, which this is stacked on.

---------

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 11, 2026
The check ran the whole tree twice in one job, each time with several
options mixed in. It is now one `do_ci.sh` subtask and one Check/build
job per option:

- `cto.base`: the `compile-time-options` config plus jemalloc, all tests
- `cto.noadmin`: admin disabled, all tests
- `cto.gperftools`: the server tests and those that observe allocation
- `cto.wamr`, `cto.wasmtime`: the wasm extension tests, and those that
link the engine with the rest of Envoy (the server, dynamic modules)
- `cto.asserts`, `cto.nolog`: the same targets as before

`compile_time_options` (or `cto`) runs them all. Test runs use
`--build_tests_only`.

Jobs are enabled and path selected by `check-build-cto-<option>` run
flags; a branch with none keeps the single `compile_time_options` job.

Fixes AdminInstanceTest.MemoryTcmalloc under jemalloc.

Requires envoyproxy#49170, which this is stacked on.

---------

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 11, 2026
The check ran the whole tree twice in one job, each time with several
options mixed in. It is now one `do_ci.sh` subtask and one Check/build
job per option:

- `cto.base`: the `compile-time-options` config plus jemalloc, all tests
- `cto.noadmin`: admin disabled, all tests
- `cto.gperftools`: the server tests and those that observe allocation
- `cto.wamr`, `cto.wasmtime`: the wasm extension tests, and those that
link the engine with the rest of Envoy (the server, dynamic modules)
- `cto.asserts`, `cto.nolog`: the same targets as before

`compile_time_options` (or `cto`) runs them all. Test runs use
`--build_tests_only`.

Jobs are enabled and path selected by `check-build-cto-<option>` run
flags; a branch with none keeps the single `compile_time_options` job.

Fixes AdminInstanceTest.MemoryTcmalloc under jemalloc.

Requires #49170, which this is stacked on.

---------

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 12, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 16, 2026
Port of envoyproxy#49161 (with the target names of envoyproxy#49188), as on release/v1.38
and release/v1.39, so that each compile-time option runs as its own job
and a failure can be seen per option. CI's workflows run from main and
set the jobs from the `check-build-cto-*` run flags in this branch's
`.github/config.yml`.

This branch differs from the later ones, so the targets do too:

- there is no jemalloc, and `compile-time-options` already builds with
  gperftools and zlib-ng, so there are no `cto.jemalloc` or
  `cto.gperftools` targets
- `cto.wamr` and `cto.noadmin` run the whole tree, as the two
  whole-tree runs of the previous target did; the others run the tests
  their option can affect
- `cto.noadmin`, `cto.asserts` and `cto.nolog` build with wasmtime, as
  before
- `cto.zlib_ng` keeps this branch's check of zlib-ng without the rest of
  the options
- the targets that cannot build with BoringSSL FIPS are left out, as
  before

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

(cherry picked from commit 3b16c1b)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
Port of envoyproxy#49161 (with the naming from envoyproxy#49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

(cherry picked from commit 3b16c1b)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 17, 2026
Port of envoyproxy#49161 (with the target names of envoyproxy#49188), as on release/v1.38
and release/v1.39, so that each compile-time option runs as its own job
and a failure can be seen per option. CI's workflows run from main and
set the jobs from the `check-build-cto-*` run flags in this branch's
`.github/config.yml`.

This branch differs from the later ones, so the targets do too:

- there is no jemalloc, and `compile-time-options` already builds with
  gperftools and zlib-ng, so there are no `cto.jemalloc` or
  `cto.gperftools` targets
- `cto.wamr` and `cto.noadmin` run the whole tree, as the two
  whole-tree runs of the previous target did; the others run the tests
  their option can affect
- `cto.noadmin`, `cto.asserts` and `cto.nolog` build with wasmtime, as
  before
- `cto.zlib_ng` keeps this branch's check of zlib-ng without the rest of
  the options
- the targets that cannot build with BoringSSL FIPS are left out, as
  before

(cherry picked from commit 3b16c1b)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit that referenced this pull request Nov 17, 2026
Port of #49161 (with the naming from #49188) for this branch.

`compile_time_options` ran everything in one job, and exited after the
wamr run: the jemalloc, admin-disabled, release-assert and
logging-disabled runs were never executed here. Each is now its own
`cto.*` target and, through the `check-build-cto-*` run flags, its own
job.

Differences from main:

- the wasm engine is selected with `--define wasm=`, as elsewhere on this
  branch
- `cto.wasmtime` is kept but commented out, in `.github/config.yml` and in
  the `cto.all` list, until the wasmtime tests are re-enabled here
- the workflow changes are not needed: the workflows run from main and
  read the run flags from this branch

(cherry picked from commit 3b16c1b)

Signed-off-by: Ryan Northey <[email protected]>
phlax added a commit to phlax/envoy that referenced this pull request Nov 18, 2026
Port of envoyproxy#49161 (with the target names of envoyproxy#49188), as on release/v1.38
and release/v1.39, so that each compile-time option runs as its own job
and a failure can be seen per option. CI's workflows run from main and
set the jobs from the `check-build-cto-*` run flags in this branch's
`.github/config.yml`.

This branch differs from the later ones, so the targets do too:

- there is no jemalloc, and `compile-time-options` already builds with
  gperftools and zlib-ng, so there are no `cto.jemalloc` or
  `cto.gperftools` targets
- `cto.wamr` and `cto.noadmin` run the whole tree, as the two
  whole-tree runs of the previous target did; the others run the tests
  their option can affect
- `cto.noadmin`, `cto.asserts` and `cto.nolog` build with wasmtime, as
  before
- `cto.zlib_ng` keeps this branch's check of zlib-ng without the rest of
  the options
- the targets that cannot build with BoringSSL FIPS are left out, as
  before

(cherry picked from commit 3b16c1b)

Signed-off-by: Ryan Northey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants