Parent Platform Condition Not Passed to Child Targets

SPM seems to ignore a parent Target's conditional when a target is nested inside it.

.target(name: "LinuxSupport",  dependencies: [
    "LinuxImports",
    "LinuxExtensions",
]),
.systemLibrary(name: "LinuxImports"),
.target(name: "LinuxExtensions"),

With LinuxSupport being a dep on a library marked platforms: [.linux].
Pretty sure this is a bug.

A workaround is to give the nested targets a conditional as well.

.target(name: "LinuxSupport",  dependencies: [
    .targetItem(name: "LinuxImports", condition: .when(platforms: [.linux])),
    .targetItem(name: "LinuxExtensions", condition: .when(platforms: [.linux]))
]),
.target(name: "LinuxExtensions"),
.systemLibrary(name: "LinuxImports"),

However this will not work for every situation. I have the same issue with swiftWasm's support packages but those packages support macOS too with stubs as a convenience. Currently the wasm packages balloon my macOS builds by 26MB.

Is this perhaps an oversight? Or is tracking nested targets and applying the parent conditionals to them not possible for some reason?

After experimenting it turns out this issue happens with C targets. It has nothing to do with target relationships as far as I can tell.

I did submit an issue on GitHub with a reproducible.