Skip to content

Conversation

jkrukowski
Copy link
Contributor

MLTensor is available for tvOS 18.0+, visionOS 2.0+ and watchOS 11.0+ (see the docs here).
This has to be specified explicitly in already existing @available attributes in order to make it compile on the mentioned platforms.

Copy link
Collaborator

@mattt mattt left a comment

Choose a reason for hiding this comment

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

Hi @jkrukowski. Thanks for opening this PR!

The package itself targets only iOS and macOS, so I'm not sure expanding these @available annotations to include these unsupported platforms will have the desired effect.

let package = Package(
    name: "swift-transformers",
    platforms: [.iOS(.v16), .macOS(.v13)],

Curious to know: Are you developing for any of these platforms specifically and think we should update the package to target them as well?

@jkrukowski
Copy link
Contributor Author

hi @mattt thanks for the answer.
AFAIK specifying platforms in Package.swift does not restrict the package usage only to the specified platforms. It still allows the package to be used elsewhere but the minimum compatible version is provided implicitly, see the comment here https://forums.swift.org/t/swift-package-manager-and-supported-platforms-avoiding-available-macos-10-15-0/59882/2

I'm the creator of swift-embeddings and after updating to swift-transformers 1.0 my package stopped building on watchOS and tvOS and expanding @available annotations (as done in the PR) fixes that. Let me know what you think

@mattt
Copy link
Collaborator

mattt commented Oct 6, 2025

@jkrukowski Ah, thanks for clarifying! In that case, I agree that this is the correct change to make.

@mattt mattt requested a review from pcuenca October 6, 2025 16:32
Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Thank you @jkrukowski!

@pcuenca pcuenca merged commit 9461057 into huggingface:main Oct 6, 2025
2 checks passed
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.

3 participants