Support tree artifacts in Swift `srcs` #3388
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 211 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.320
Real PR Conversation Timeline
1 comments
"Review active on #3388"
general
weight: 0.35
aaronsky
A
swift_librarycan have a directory (tree artifact) insrcs, e.g. a directory of generated sources. rules_swift 4.2.0 compiles its files individually, but generating a project with one fails:Three actions expand the directory without having it as an input:
WriteTargetBuildSettingsreuses theSwiftCompileaction'sArgs, which expand the directory. The target's directorysrcsare now passed along with theArgs(swift_directories) and are inputs of the action. They're taken from the target'ssrcsrather than from theSwiftCompileaction's inputs, so no transitive inputs are flattened. Targets without directories get the same action as before.WriteGeneratedDirectoriesFilelistand the generated xcfilelist mapsrcsto paths. They now useexpand_directories = Falseand list a directory itself, since its files aren't known until it's built.Tests:
write_generated_directories_filelist(no tests until now) and twowrite_target_build_settingscases. They fail without the fix;//test/...passes. The mockArgs.use_param_filenow acceptsuse_always.xcodebuild; without this changebazel run //:xcodeprojfails as above.