fix(attachment_engine): put swift-tools-version as the literal first line - #60
Merged
Merged
Conversation
…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).
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFix Swift Package Manager manifest resolution for iOS and macOS by placing the File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
attachment_engine_ios/ios/attachment_engine_ios/Package.swiftandattachment_engine_macos/macos/attachment_engine_macos/Package.swifthadthe 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:
This blocks
flutter run/flutter buildon iOS and macOS for anyreal consumer app — surfaced by a teammate evaluating
attachment_enginefrom 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-packagenow succeeds (exit 0) for both packageslicense-checkstill passes (checks header presence, not position)flutter build ios --no-codesign/flutter build macosboth succeed🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes: