Repository navigation
Feature flags live where they are read - #85
Merged
Merged
Conversation
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.
Phase 5b of docs/STRUCTURE.md.
foundation/features/features.def,FeatureId,FeatureEnabled()andFeatures()are gone. A module declares a flag as abase::Featureat namespace scope in the file that reads it (base::Feature ClothFeature{"physics.cloth", true};inphysics_world.cc) and reads it as a bool. Adding a flag no longer edits a shared file.InitFeatures()appliesRX_FEATURESby walkingbase::Feature's chain. Since Shared build links and runs: exports, one option registry, per-DSO volk, linux-dev #84 that chain is one per process, so a flag inrx_physicsis reachable fromrx_foundationin the component build too. Unknown names still warn.render.pathtracer,render.mesh_shader_lodandrender.distant_lod, which were declared but never read anywhere.RX_FEATURESnaming them now warns instead of silently doing nothing.Verified, static and shared:
ctest155/155 in both; lint 0 violationsRX_FEATURES=-physics.cloth cloth_sim_test --feature-offlogs "feature 'physics.cloth' off by RX_FEATURES" and the gate holds in both builds; a bogus name warns and leaves cloth onDownstream: replace
FeatureEnabled(FeatureId::kX)with abase::Featuredeclared next to its reader.