Use Starlark tuples for C++ object-file groups #814
@lberki can you take a quick look at this one? I know you added some of these freezes.
IIRC it was for mutability which the tuple should address, but just wanted to get another pair of 👀 .
Ran some benchmarks on this and https://github.com/bazelbuild/rules_cc/pull/809. Effects range from negligible to 0.05% increases in Post-Analysis JVM Heap Memory (nothing that should trip alerts).
From my POV, this works; all I care about is that these values are immutable, and a frozen list and a tuple both are good enough for the job. I guess lists fit the use case "philosophically" more, since the arity of a tuple is part of its type and with this change, you are effectively introducing a field whose type is a tuple of unknown arity.
That said, it's appealing to remove the cc_internal dependency. @pzembrod , which approach do you prefer?
going to send to pzembrod for review internally, if he won't look at it here
lilygorsheneva
dzbarsky
Store private
_ObjectFileGroupInfo.object_filescollections as immutable Starlark tuples instead of Java-backed_cc_internal.freezelists. Tuple iteration preserves object order, generated-directory expansion, and whole-archive grouping while removing the module's remainingcc_internaldependency.Validation:
buildifier -mode=checkand 30 passing link-variable and Linux, macOS, and Windows toolchain-feature analysis tests.