Closed david-hm-morgan closed 1 month ago
Please provide some source code that triggers this.
Something in the code is causing SourceKit to return a string for a field that sourcekitten is expecting to be a map.
It's probably a new / unusual construct -- all of our regular test projects run cleanly on Xcode 16 RC1.
Hi @johnfairh thanks for responding... strangely (AFAIK) there is nothing new here just rebuilding with latest Xcode, so I am not able to pinpoint which part of the code is triggering this complaint. I'll probably need to narrow down the scope of the doc generation incrementally. Can jazzy provide more logs as to its progress to get any clues as to where it is when it falls over?
This is the sourcekitten phase crashing. If there's really no per-sourcefile output that you've elided (kind of thing like Parsing SwiftTopLevelClass.swift (1/1)
) then that is curious, it looks to me as though it does that printf before starting each file.
a more complete log... 95 files handled apparently correctly, then this error.
...
Parsing OTVAVPlayer.swift (91/95)
Parsing OTVAVPlayerItem+InsightExt.swift (92/95)
Parsing OTVAVPlayerItem.swift (93/95)
Parsing OTVAVURLAsset.swift (94/95)
Parsing OTVSDK.swift (95/95)
Could not cast value of type 'Swift.String' (0x7ff8556a6848) to 'Swift.Dictionary<Swift.String, SourceKittenFramework.SourceKitRepresentable>' (0x7ff855e42708).
Aha ok. So if we're lucky the problem is in OTVSDK.swift
. If unlucky (bit suspicious it's the last file...) then it might be in some kind of end-module processing that will need narrowing.
The most recent run of this (a few weeks ago) logged some warnings after the 95th file was processed, could the issue now be in this wrap up activity?
...
Parsing OTVSDK.swift (95/95)
WARNING: No documented top-level declarations match name "OTVSSPTokenCallback" specified in categories file
WARNING: No documented top-level declarations match name "AVURLAsset" specified in categories file
WARNING: No documented top-level declarations match name "OTVWatermarkDelegate" specified in categories file
WARNING: No documented top-level declarations match name "OTVWatermarkError" specified in categories file
building site
Nope - those WARNING
s are from Jazzy (the ruby layer) after sourcekitten (the swift layer that is now crashing for you) has finished.
Fixed by pulling in a version of sourcekitten that includes the update to parse the new Swift-6 output format.
Using: