Skip to content

fix(attachment_engine): put swift-tools-version as the literal first line - #60

Merged
digvijaysinh-cloudemy merged 1 commit into
mainfrom
fix/spm-manifest-header-order
Aug 25, 2026
Merged

fix(attachment_engine): put swift-tools-version as the literal first line#60
digvijaysinh-cloudemy merged 1 commit into
mainfrom
fix/spm-manifest-header-order

Conversation

@dhc-tech

@dhc-tech dhc-tech commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Bug

attachment_engine_ios/ios/attachment_engine_ios/Package.swift and
attachment_engine_macos/macos/attachment_engine_macos/Package.swift had
the copyright/license header before // swift-tools-version:.

Swift Package Manager requires the tools-version line to be the literal
first line of the manifest. With the header above it, Xcode fails to
resolve the package:

Could not resolve package dependencies:
the manifest is backward-incompatible with Swift < 6.0 because the
tools-version was specified in a subsequent line of the manifest, not
the first line.

This blocks flutter run/flutter build on iOS and macOS for any
real consumer app — surfaced by a teammate evaluating attachment_engine
from a separate app via a local path dependency.

Fix

Swapped the order in both files: swift-tools-version (+ its comment)
first, then the copyright header, then import PackageDescription.

Verified

  • swift package dump-package now succeeds (exit 0) for both packages
  • license-check still passes (checks header presence, not position)
  • flutter build ios --no-codesign / flutter build macos both succeed

🤖 Generated with Claude Code

Summary by Sourcery

Bug Fixes:

  • Ensure the Swift Package Manager tools-version declaration is the literal first line in the iOS and macOS package manifests so the packages resolve correctly.

…line

Swift Package Manager requires '// swift-tools-version:' to be the first
line of the manifest — putting the license header above it makes SPM
treat the tools-version as unspecified, which Xcode then rejects:

  Could not resolve package dependencies:
  the manifest is backward-incompatible with Swift < 6.0 because the
  tools-version was specified in a subsequent line of the manifest, not
  the first line.

This blocked flutter run/build on iOS and macOS for any real consumer
app (surfaced by a teammate evaluating attachment_engine from
cloudemy_student). Swapped the order in both Package.swift files:
swift-tools-version (+ its comment) first, then the copyright header,
then import PackageDescription.

Verified: 'swift package dump-package' now succeeds (exit 0) for both
attachment_engine_ios and attachment_engine_macos, and
license-check still passes (it checks for header presence, not position).
@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fix Swift Package Manager manifest resolution for iOS and macOS by placing the // swift-tools-version: 5.9 declaration first in both Package.swift files, while retaining the license headers and package configuration.

File-Level Changes

Change Details Files
Make the Swift Package Manager tools-version declaration the literal first line in both platform manifests.
  • Move the Swift tools-version directive and explanatory comment above the copyright/license header.
  • Preserve the existing package declaration and license text unchanged after the reordered comments.
packages/attachment_engine/attachment_engine_ios/ios/attachment_engine_ios/Package.swift
packages/attachment_engine/attachment_engine_macos/macos/attachment_engine_macos/Package.swift

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f83cd1ea-7580-4966-abfa-a61452ff4cb2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S Small diff (<=100 lines changed) type:fix Bug fix status:needs-review Awaiting review or checks labels Aug 25, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions github-actions Bot added status:ci-failed A required check is failing and removed status:needs-review Awaiting review or checks labels Aug 25, 2026
@digvijaysinh-cloudemy
digvijaysinh-cloudemy merged commit 2d45009 into main Aug 25, 2026
9 of 12 checks passed
@digvijaysinh-cloudemy
digvijaysinh-cloudemy deleted the fix/spm-manifest-header-order branch August 25, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S Small diff (<=100 lines changed) status:ci-failed A required check is failing type:fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants