anthropics / anthropics/ClaudeForFoundationModels

Using ClaudeForFoundationModels in projects that support earlier OS versions

Aperta
#12 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Swift
Stelle
292
Fork
30
Merge medio
23m
PR unite (30g)
4

Descrizione

### 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
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.