Handle Swift 6.2 SPM build layout when compiling Dangerfile#662
Conversation
|
@copilot update the CHANGELOG |
|
Hi @f-meloni, any update on this? |
|
@copilot CI is failing |
Generated by 🚫 Danger Swift against eda5cdd |
|
@copilot CI is still failing |
|
@f-meloni CI is still failing :( |
|
Hi @f-meloni — I hit this same bug and want to share a reproduction plus a possible amendment to this PR's approach, since it looks like the CI issue is the only thing blocking it. A regression in this PR's approachThis PR moves
I verified this locally in both directions (swiftbuild→native and native→swiftbuild, each without a clean) — Suggested amendmentLeave public var moduleFolder: String {
let flatModule = buildFolder + "/Danger.swiftmodule"
let nestedModule = buildFolder + "/Modules/Danger.swiftmodule"
switch (fileManager.fileExists(atPath: flatModule), fileManager.fileExists(atPath: nestedModule)) {
case (true, false):
return buildFolder
case (false, true):
return buildFolder + "/Modules"
default:
#if compiler(<6.0)
return buildFolder
#else
return buildFolder + "/Modules"
#endif
}
}This keeps every currently-working configuration byte-identical (both unambiguous branches match today's two I've written this up as a full PR with tests (including coverage for the empty/partial- |
Swift 6.2 (Xcode 27) changed SwiftPM build outputs from
.build/debug[/Modules]to.build/out/Products/Debug, which caused Dangerfile compilation to fail withno such module 'Danger'. This update makes path resolution layout-aware while preserving legacy behavior.Build artifact path resolution
SPMDangernow detects build layout and resolvesbuildFolderto:.build/out/Products/Debug(when present).build/debugmoduleFoldernow aligns with the resolved layout:.../Modulesbehavior for newer compilersTargeted test coverage
RunnerLibtests to cover: