Skip to content

fix(uniffi): unblock publish workflow + polish output#1091

Open
pblazej wants to merge 9 commits into
mainfrom
blaze/fix-workflow-permissions
Open

fix(uniffi): unblock publish workflow + polish output#1091
pblazej wants to merge 9 commits into
mainfrom
blaze/fix-workflow-permissions

Conversation

@pblazej
Copy link
Copy Markdown
Contributor

@pblazej pblazej commented May 14, 2026

Follow-up fixes surfaced while validating the publish pipeline against livekit/livekit-uniffi-xcframework#12.

Workflow

  • drop nested-job contents: write (blocked startup after the CodeQL autofix in UniFFI: Publish Swift packages #1078)
  • drop duplicate --force arg now that cargo-make adds its own
  • repin cargo-swift to upstream main (antoniusnaumann/cargo-swift@fe7becf — fork retired)
  • switch to macos-26-xlarge for ~½ wall-clock

Build output

  • bump Package.swift to swift-tools 6.0
  • clean tera whitespace so no stray blank line lands in .binaryTarget
  • include PrivacyInfo.xcprivacy in the publish set
  • inject CARGO_PROFILE_RELEASE_{DEBUG=limited,SPLIT_DEBUGINFO=packed} into the swift-xcframework task so each per-arch dylib gets a sidecar .dSYM (~8.5 MB × 11 targets, ~94 MB raw) without touching the workspace's lean Cargo.toml profile

Docs

  • document the dev-vs-release modes + local deps
  • symlink AGENTS.md → README.md

After merge: re-dispatch UniFFI packages with dry_run=false on a fresh test version to confirm end-to-end.

@pblazej pblazej requested a review from ladvoc as a code owner May 14, 2026 11:14
The CodeQL autofix landed in #1078 added `permissions: contents: read`
at the top level of uniffi-packages.yml, which then forbids any
nested job (including the called workflow uniffi-swift.yml) from
requesting higher permissions — workflow validation fails with:

  Error calling workflow ... The nested job 'build-and-publish' is
  requesting 'contents: write', but is only allowed 'contents: read'.

Neither job actually needs write: `gh release list` in resolve-tag is
read-only, and the publish step authenticates to the hosting repo
with UNIFFI_XCFRAMEWORK_PAT (not GITHUB_TOKEN). Drop the elevation
on both so the workflow can start.
@pblazej pblazej force-pushed the blaze/fix-workflow-permissions branch from d78bf92 to a60f3a8 Compare May 14, 2026 11:15
cargo-make 0.37.25+ adds its own --force when running install_crate,
so the explicit --force here makes cargo install reject the duplicate
argument with exit 105.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

No changeset found

This PR modifies the following packages but doesn't include a changeset:

Directly changed:

  • livekit-uniffi

Click here to create a changeset

The link pre-populates a changeset file with patch bumps for all affected packages.
Edit the description and bump types as needed before committing.

If this change doesn't require a version bump, add the internal label to this PR.

pblazej added 2 commits May 14, 2026 13:46
LiveKit's feature/framework-wrapping branch (PR #96 against
antoniusnaumann/cargo-swift) has been merged upstream. Point at the
upstream merge commit fe7becf so the fork dependency goes away.
Multi-arch xcframework build is the long pole. -xlarge is arm64 +
paid; expect roughly half the wall-clock of the default macos-26
runner.
@pblazej pblazej changed the title fix(uniffi): drop unneeded contents:write permissions UniFFI: Fix Swift workflow issues May 14, 2026
pblazej added 4 commits May 14, 2026 14:39
Dedent the if/elif/else/endif tags to column 0 and use {%- consistently
so the rendered Package.swift no longer emits a blank line between
.target and .binaryTarget. Verified locally — diff against the existing
hosting-repo manifest now shows only the intended version/checksum
changes.

Add the built PrivacyInfo.xcprivacy to the publish files list so the
hosting repo's copy stays in sync if the source manifest ever changes
(today it's identical, but the workflow shouldn't depend on that).
build-and-publish:
name: Build & publish Swift xcframework
runs-on: macos-26
runs-on: macos-26-xlarge
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it leverages the cache heavily now.

Inject CARGO_PROFILE_RELEASE_DEBUG=limited and
CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=packed into the swift-xcframework
task only, gated on the cargo-make release profile. Cargo treats them
as [profile.release] overrides during this build, so dsymutil emits a
sidecar .dSYM next to each per-arch dylib at
target/<arch>/release/deps/liblivekit_uniffi.dylib.dSYM (~8.5 MB each,
~94 MB across the 11 Apple targets).

Scoping via env vars keeps the workspace Cargo.toml profile lean —
FFI, node, and Linux/Windows/Android release builds stay stripped and
debug-info-free. limited (line tables + types) is ~3× smaller than full.

Verified locally with a clean rebuild.
@pblazej pblazej changed the title UniFFI: Fix Swift workflow issues fix(uniffi): unblock publish workflow + polish output May 15, 2026
# Linux/Windows/Android) remain on the lean Cargo.toml profile.
# `split-debuginfo = "packed"` triggers dsymutil → produces .dSYM bundles next
# to each per-arch .dylib at target/<arch>/release/deps/lib<name>.dylib.dSYM.
CARGO_PROFILE_RELEASE_DEBUG = { value = "limited", condition = { profiles = ["release"] } }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt @ladvoc?

It's not integrated into cargo-swift yet (needs another patch) but would be good to have, especially during initial adoption.

I confirmed it works locally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also tackle that in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant