anthropics / anthropics/ClaudeForFoundationModels

Using ClaudeForFoundationModels in projects that support earlier OS versions

Open
#12 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
292
Forks
30
Avg merge
23m
Merged PRs (30d)
4

Description

### Request

I wanted to integrate this package into our existing project that supports macOS 15, iOS 18, and visionOS 2 and I ran into problems because your `Package.swift` specifies that the package can only be used on Apple’s OS 27 versions. If I’m not missing something, it should be possible to lower that version number and annotate all your (public?) symbols with `@available(anyAppleOS 27.0, *)`, right? If you did that, many more projects could use your code.

Are there any plans on doing this? Do you accept pull requests with this kind of change?
Or am I missing something and there’s a good reason not to do this?

### Steps to reproduce

These are the steps to reproduce this issue:
```
> mkdir ClaudeTest
> cd ClaudeTest
> swift package init
> xed Package.swift
```
Then, add the ClaudeForFoundationModels dependency to the package and target and specify the platforms supported by the package to e.g. include macOS 15. The complete `Package.swift` file should then look like this:

Complete Package.swift

```
// swift-tools-version: 6.4
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "ClaudeTest",
platforms: [.macOS(.v15), .iOS(.v18), .visionOS(.v2)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "ClaudeTest",
targets: ["ClaudeTest"]
),
],
dependencies: [
.package(url: "https://github.com/anthropics/ClaudeForFoundationModels", branch: "main")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "ClaudeTest",
dependencies: [
"ClaudeForFoundationModels"
],
swiftSettings: [
.enableUpcomingFeature("ApproachableConcurrency"),
],
),
.testTarget(
name: "ClaudeTestTests",
dependencies: ["ClaudeTest"],
swiftSettings: [
.enableUpcomingFeature("ApproachableConcurrency"),
],
),
]
)
```

Then:
```
> swift build
Fetching https://github.com/anthropics/ClaudeForFoundationModels from cache
Fetched https://github.com/anthropics/ClaudeForFoundationModels from cache (0.48s)
Creating working copy for https://github.com/anthropics/ClaudeForFoundationModels
Working copy of https://github.com/anthropics/ClaudeForFoundationModels resolved at main (f7b70b6)
Building for debugging...
error: The package product 'ClaudeForFoundationModels-product' requires minimum platform version 27.0 for the macOS platform, but this target supports 15.0
error: The package product 'ClaudeForFoundationModels-product' requires minimum platform version 27.0 for the macOS platform, but this target supports 15.0

error: Build failed
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.