Add guardrail against Bazel legacy C++ feature regressions#102
Open
nradakovic wants to merge 1 commit into
Open
Add guardrail against Bazel legacy C++ feature regressions#102nradakovic wants to merge 1 commit into
nradakovic wants to merge 1 commit into
Conversation
Add no_legacy_features_guard_test, an analysis-driven test rule under tests/guardrails/ that resolves the active C++ toolchain and fails as a test if the explicit-feature contract regresses -- i.e. the no_legacy_features marker is no longer enabled or a Bazel implicit legacy feature (legacy_compile_flags, legacy_link_flags, sysroot) becomes active again. The verdict is deterministic and surfaced via the test's exit status, so it needs no target hardware and runs on any --config. Wire the new guardrail_tests suite into every platform CI workflow and document what it validates and how to interpret failures in tests/guardrails/README.md and docs/tests_and_validation.md. resolves #82
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an analysis-driven Bazel test guardrail to prevent regression back to Bazel’s implicit legacy C/C++ feature behavior, and wires it into CI plus documentation so regressions are detected deterministically across supported --configs.
Changes:
- Introduces
no_legacy_features_guard_test(Starlark test rule) to assert theno_legacy_featurescontract and detect re-enabled Bazel legacy features. - Adds a
guardrail_testssuite and runs it in platform CI workflows. - Documents the new guardrail and test workspace structure.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/guardrails/README.md | Documents what the guardrail checks, how to run it, and how to interpret failures. |
| tests/guardrails/legacy_feature_guard.bzl | Implements the analysis-driven guardrail test rule that resolves the active C++ toolchain and checks the explicit-feature contract. |
| tests/guardrails/BUILD | Declares the no_legacy_features_guard_test target in the guardrails package. |
| tests/BUILD | Adds guardrail_tests test suite aggregating the new guardrail target. |
| docs/tests_and_validation.md | Documents the new tests/guardrails/ area and links to interpretation guidance. |
| .github/workflows/x86_64-linux.yml | Runs the new guardrail suite in the x86_64 Linux CI workflow. |
| .github/workflows/autosd.yml | Runs the new guardrail suite in the AutoSD CI workflow. |
| .github/workflows/aarch64-linux.yml | Runs the new guardrail suite in the aarch64 Linux CI workflow. |
| .github/workflows/aarch64-ebclfsa.yml | Runs the new guardrail suite in the EBcLfSA CI workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+42
| CI runs the guardrail for every platform config (see the workflows under | ||
| `.github/workflows/`). |
Comment on lines
+42
to
+44
| - name: Guardrail (no legacy features) | ||
| run: | | ||
| bazel test --config=x86_64-linux -- //:guardrail_tests |
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.
Add no_legacy_features_guard_test, an analysis-driven test rule under tests/guardrails/ that resolves the active C++ toolchain and fails as a test if the explicit-feature contract regresses -- i.e. the no_legacy_features marker is no longer enabled or a Bazel implicit legacy feature (legacy_compile_flags, legacy_link_flags, sysroot) becomes active again. The verdict is deterministic and surfaced via the test's exit status, so it needs no target hardware and runs on any --config.
Wire the new guardrail_tests suite into every platform CI workflow and document what it validates and how to interpret failures in tests/guardrails/README.md and docs/tests_and_validation.md.
resolves #82