Version-specific Package.swift file causes Danger to not load plugins
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 152
- Avg merge
- 9h 54m
- Merged PRs (30d)
- 2
Description
This may be out of scope but it took me a while to debug so I wanted to open an issue for it:
I only run Danger on CI so the main Package.swift does not include Danger, but rather a specific Package@swift-5.3.swift file contains Danger.
I can build Danger with the usual `swift build --target DangerDependencies` but when running (e.g. `swift run danger-swift ci`) I get an error:
Error Message
```
JIT session error: Symbols not found: [ _$s23SwiftChecksDangerPlugin4FileMp, _$s23SwiftChecksDangerPlugin21InfoPlistFileProviderVN, _$s23SwiftChecksDangerPlugin21InfoPlistFileProviderVAA0gH0AAWP, _$s23SwiftChecksDangerPlugin11VersionFileVN, _$s23SwiftChecksDangerPlugin11VersionFileVAA0F0AAWP, _$s23SwiftChecksDangerPlugin11VersionFileV4path11interpreterACSS_AC11InterpreterOtcfC,
_$s23SwiftChecksDangerPlugin13InfoPlistFileV0F3KeyV13versionNumberAEvau, _$s23SwiftChecksDangerPlugin12FileProviderMp, _$s23SwiftChecksDangerPlugin0aB0V5check13fileProviders5files11versionKindySayAA12FileProvider_pG_SayAA0K0_pGSStFZ, _$s23SwiftChecksDangerPlugin21InfoPlistFileProviderVMn, _$s23SwiftChecksDangerPlugin21InfoPlistFileProviderV15discoveryMethod8plistKey07projectG4PathA2C09DiscoveryJ0O_AA0efG0V0fL0VSStcfC, _$s23SwiftChecksDangerPlugin11VersionFileVMn ]
Failed to materialize symbols: { (0x7fc4bddb9540, { ___swift_instantiateConcreteTypeFromMangledName, _$s23SwiftChecksDangerPlugin0aB0V5check13fileProviders5files11versionKindySayAA12FileProvider_pG_SayAA0K0_pGSStFZfA_, _$s23SwiftChecksDangerPlugin11VersionFileV11InterpreterOWOe, _got.$s6Danger6GitHubVMn, __swift_FORCE_LOAD_$_swiftCoreGraphics_$__tmp_dangerfile, _got.$s23SwiftChecksDangerPlugin11VersionFileVMn, _symbolic ______p 23SwiftChecksDangerPlugin12FileProviderP, _$s15_tmp_dangerfile11projectNameSSvp, _got.$s10Foundation4DateVMn, _got.$s23SwiftChecksDangerPlugin4FileMp, _symbolic _____Sg 6Danger6GitHubV9MilestoneV, _$s15_tmp_dangerfile20checkProjectVersionsyyF, _$s23SwiftChecksDangerPlugin21InfoPlistFileProviderV15DiscoveryMethodOWOe, _$s6Danger9SwiftLintO4lint_6inline10configFile6strict5quiet13swiftlintPathSayAA0bC9ViolationVGAC0C5StyleO_SbSSSgS2bAOtFZfA3_, _$s23SwiftChecksDangerPlugin12FileProvider_pMD, _$s6Danger9SwiftLintO4lint_6inline10configFile6strict5quiet13swiftlintPathSayAA0bC9ViolationVGAC0C5StyleO_SbSSSgS2bAOtFZfA_, _$s6Danger6GitHubVSgWOc, __swift_FORCE_LOAD_$_swiftDispatch_$__tmp_dangerfile, __swift_FORCE_LOAD_$_swiftDarwin_$__tmp_dangerfile, _$s10Foundation4DateVSgMD, __swift_FORCE_LOAD_$_swiftCoreFoundation_$__tmp_dangerfile, _symbolic _____ 23SwiftChecksDangerPlugin21InfoPlistFileProviderV, _$s15_tmp_dangerfile18checkSwiftVersionsyyF, _$s6Danger6GitHubV9MilestoneVSgMD, _main, _$s6Danger6GitHubVSgMD, _$ss26DefaultStringInterpolationVWOh, _$s6Danger9SwiftLintO4lint_6inline10configFile6strict5quiet13swiftlintPathSayAA0bC9ViolationVGAC0C5StyleO_SbSSSgS2bAOtFZfA1_, _symbolic _____Sg 6Danger6GitHubV, _$s15_tmp_dangerfile4isPRSbvp, _symbolic ______p 23SwiftChecksDangerPlugin4FileP, _symbolic _____Sg 10Foundation4DateV, __swift_FORCE_LOAD_$_swiftXPC_$__tmp_dangerfile, _$s6Danger6GitHubVSgWOh, _$s6Danger6GitHubVWOh, _got.$s6Danger6GitHubV9MilestoneVMn, __swift_FORCE_LOAD_$_swiftObjectiveC_$__tmp_dangerfile, _$s6Danger9SwiftLintO0C5StyleOWOe, _$s6Danger9SwiftLintO4lint_6inline10configFile6strict5quiet13swiftlintPathSayAA0bC9ViolationVGAC0C5StyleO_SbSSSgS2bAOtFZfA2_, _got.$s23SwiftChecksDangerPlugin12FileProviderMp, ___swift_project_value_buffer, _$sSSWOh, _$s23SwiftChecksDangerPlugin4File_pMD, _symbolic _____ 23SwiftChecksDangerPlugin11VersionFileV, _got.$s23SwiftChecksDangerPlugin21InfoPlistFileProviderVMn, __swift_FORCE_LOAD_$_swiftFoundation_$__tmp_dangerfile, _$s6Danger9SwiftLintO4lint_6inline10configFile6strict5quiet13swiftlintPathSayAA0bC9ViolationVGAC0C5StyleO_SbSSSgS2bAOtFZfA4_, ___swift_allocate_value_buffer, _$s15_tmp_dangerfile6danger6Danger0D3DSLVvp, __swift_FORCE_LOAD_$_swiftIOKit_$__tmp_dangerfile }) }
```
`SwiftChecksDangerPlugin` is the name of my plugin.
To fix this I've added a comment to my Package.swift:
```swift
// Needed to make Danger work: .library(name: "DangerDeps",
```
This seems to satisfy the lookup that Danger performs.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Package.swift and Package@swift-5.3.swift manifests and reproduce the behavior with `swift build --target DangerDependencies` followed by `swift run danger-swift ci`. Trace the lookup that loads plugin symbols and verify that a version-specific manifest works without the comment workaround; done means the reported plugin loads successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100