Compose C++ toolchain variables in Starlark #828
why sorted?
Why is the duplicate check performed only here in create_compile_variables? Every combine_cc_toolchain_variables checks for duplicates.
Requested changes.
Bazel’s MapVariables stores names in sorted order, so the native duplicate error reports them alphabetically. I kept that ordering for compatibility, moved the sort into the error branch, and documented why. The existing test supplies the names in a different order and checks the alphabetical result.
I rechecked all 12 native calls. The first argument is a parent whose values may be overridden; the duplicate check only compares the remaining arguments with each other. create_compile_variables was the only call with two such arguments. The other 11 had one each. I documented this and added a test showing that compile-action values override the same extension entries that create_compile_variables rejects as duplicates
lilygorsheneva
dzbarsky
Keep C++ compile and ThinLTO build variables in Starlark dictionaries until native action registration requires
CcToolchainVariables. This removes all 12_cc_internal.combine_cc_toolchain_variablescalls while preserving parent-variable overrides, duplicate-variable errors, public return types, and action-template behavior.Validation: 127 C++ common, binary, ThinLTO, and compile-variable analysis tests passed, including new override and duplicate-variable tests. Stable analysis heap increased 0.44% on the 127-test workload.