Rework of the constant configuration system. #564
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.
This PR refactors the current configuration system built on
configurable_constants!{}to instead use an explicitXetConfigstruct defined in a newxet_configpackage and instantiated as part of the xet runtime. All of the config values that were previously configurable by environment variables have now been moved into this structure.Each of the modules having config values here has a separate group that is loaded as part of the config.
On runtime start, environment variables are still checked in the same way as before, so this PR should largely be backwards compatible.
The previous
configurable_constants!{}macro is nowtest_configurable_constants!{}and is meant for testing constants that can only be changed in debug mode for specific tests. This allows us to drop therelease_fixeddecorator.In addition, high performance mode is handled by an explicit function on XetConfig, with_high_performance_mode(), that sets the defaults of some of the constants to the high performance values. This is called if high performance mode is enabled.