Support for DocC experimental features

We're almost done implementing this but have hit a weird last minute error. When generating the docs on our build machine, we're getting a "Bad CPU type in executable" error with the Nov 3 nightly toolchain. This works fine with the regular 5.7 toolchain.

Our build machine is an M1 Mac mini which doesn't have Rosetta installed. That might explain why in my testing this same command works fine on my M1 MBP which has Rosetta.

Is there anything new in the 5.8 doc generation workflow that might be calling out to an x86 only binary? We can install Rosetta on the build machines if need be but if we can avoid it that'd be even better.

Here's the whole command sequence that replicates our process and works on my machine but fails on our builder with the above mentioned error:

git clone --depth=1 --branch 0.3.5 "https://github.com/SwiftPackageIndex/SemanticVersion.git"

cd SemanticVersion

mkdir -p .docs/swiftpackageindex/semanticversion

cat <<EOF >> Package.swift

package.dependencies.append(
    .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
)
EOF

xcrun --toolchain "org.swift.57202211031a" env DOCC_JSON_PRETTYPRINT="YES" swift package --allow-writing-to-directory ".docs/swiftpackageindex/semanticversion/0.3.5" generate-documentation --disable-indexing --transform-for-static-hosting --output-path ".docs/swiftpackageindex/semanticversion/0.3.5" --hosting-base-path "swiftpackageindex/semanticversion/0.3.5" --target "SemanticVersion"
1 Like