Use a more flexible approach when determining which features are enabled or disabled.
Use a more flexible approach when determining which features are enabled or disabled.

This treats the requested and disabled features as coming from different layers, with the more general layers providing defaults that are overridden by more specific layers. Features unsupported by the toolchain are treated as the most specific layer of all. The result more closely matches Bazel's treatment of features.

This will allow explicit modules to be enabled at the toolchain level, with per-package overrides in the toolchain configuration that can be overridden again at the target level.

PiperOrigin-RevId: 444273296
(cherry picked from commit 8b3732bfad7e70b7056f5a412302b0d1e279d0c8)

bazelbuild/rules_swift,bazelbuild/rules_swift