Open dabrahams opened 1 year ago
That was with jazzy version: 0.14.3 but I just reproduced it with the tip of main. @compnerd any idea about this?
@dabrahams unfortunately, SourceKitten doesn't (officially) support Windows yet. I do have it working on Windows, but need to get some more patches merged which are waiting on @jpsim to help with. In the mean time, I would recommend that you experiment with https://github.com/thebrowsercompany/SourceKitten/tree/compnerd/windows (the file handling in SourceKitten was making assumptions that don't hold).
You mean, even though I'm running on a Mac, your fork might solve the problem?
Oh! I missed the fact it was on macOS!
@dabrahams what version of the toolchain are you using? There was a change recently in SPM that would could cause conflicts as the contents of the manifest has changed.
@compnerd Thanks; I only asked you because I saw a recent commit of yours in this repo and though you might have a clue.
@dabrahams what version of the toolchain are you using?
Whatever comes with 14.3.1
Quick workaround: temporarily replace line 1364 of that debug.yaml
with "Generating XCTestCases":
. (And probably replace the module name in the command with ValModule
).
The error is because Yams is refusing to load the file; it turns out SPM (or maybe something called TestGeneratorPlugin
?) is creating technically invalid yaml.
TIL that yaml specifies the maximum key length is 1024 characters, and Yams implements this strictly.
SPM (or maybe this plugin? at any rate SPM permits it) creates a yaml key in this case by concatenating all of the test source file names. This is fundamentally doomed and hits the limit at line 1364 of your debug.yaml
starting "Generating XCTestcases for [\"While\".....
Pragmatically I wonder if the long-term solution here is to allow Yams to be more relaxed about this constraint: I doubt SPM will be particularly enthusiastic about policing their key lengths and the behaviour is already shipped.
Wow, thanks for the info. I don't know how to intervene in Jazzy's process to rewrite that file though. I think I probably ought to be using Swift-DocC anyway.
Wow, I really don't like what Swift-DocC generates. So I'm back to looking for a solution to this.
I can't think of a simple solution.
To pursue the workaround above your process would be something like swift build <your args>; <kludge the yaml file>; jazzy <stuff to provide same 'your args' to spm>
-- it looks like SPM won't recreate the file, though I don't know if this is guaranteed.
You could track down the TestGeneratorPlugin
owner/code and ask if they recognise the key text and can trim it.
(drastically, even knock out that part of your project out of the Package.swift
for the purposes of building docs?)
You could try jazzy in symbolgraph mode, but you will get better results with the SPM version if you can get it going.
Opened apple/swift-package-manager#6790 to query the yaml.
It turns out I'm in a perfect position to trim the text from TextGeneratorPlugin; perhaps I'll try that.
I did, and got Jazzy to work for the most part. Please feel free to close this issue unless it is marking something you still want to address (like maybe resiliency to non-conformant YAML).
Great. I'm going to keep this around while SwiftPM decide whether they have a bug or not.
I'm using SourceKitten indirectly through the Jazzy doc generator. The YAML file does in fact exist and is attached (compressed)