Is it possible to use SwiftData?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 28/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- swift
- 領域
- build-system, tooling
調査の方向性
Start by reading the reported example in Sources/tracker/Data.swift and running xtool dev to reproduce the missing SwiftDataMacros plugin error. Investigate whether xtool can support SwiftData macro expansion; the issue gives no implementation path or tests. Done means the example builds successfully, or the project documents that SwiftData is unsupported.
索引モデルが issue の本文から書いたものです。
説明
I'm really new to swift and i don't really know if it's a bug, so filing without the bug label. Thanks in advance for helping :)
if i do something like this:
import SwiftData
@Model
final class Person {
var firstName: String
var lastName: String
var relatives: [Person] = []
}
compilation will fail with a massive wall of repeating errors like this:
root@48e2171c8734:/ios/tracker# xtool dev
Planning...
[1/1] Planning build
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
/ios/tracker/Sources/tracker/Data.swift:4:13: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
2 |
3 | @Model
4 | final class Person {
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:5:9: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
3 | @Model
4 | final class Person {
5 | var firstName: String
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
6 | var lastName: String
7 | var relatives: [Person] = []
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:6:9: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
4 | final class Person {
5 | var firstName: String
6 | var lastName: String
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
7 | var relatives: [Person] = []
8 | }
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:7:6: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
7 | var relatives: [Person] = []
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
8 | }
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:4:13: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
2 |
3 | @Model
4 | final class Person {
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:4:13: error: class 'Person' has no initializers
2 |
3 | @Model
4 | final class Person {
| `- error: class 'Person' has no initializers
5 | var firstName: String
| `- note: stored property 'firstName' without initial value prevents synthesized initializers
6 | var lastName: String
| `- note: stored property 'lastName' without initial value prevents synthesized initializers
7 | var relatives: [Person] = []
8 | }
/ios/tracker/Sources/tracker/Data.swift:4:13: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
2 |
3 | @Model
4 | final class Person {
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:5:9: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
3 | @Model
4 | final class Person {
5 | var firstName: String
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
6 | var lastName: String
7 | var relatives: [Person] = []
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:6:9: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
4 | final class Person {
5 | var firstName: String
6 | var lastName: String
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
7 | var relatives: [Person] = []
8 | }
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:7:6: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
7 | var relatives: [Person] = []
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
8 | }
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:4:13: error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
2 |
3 | @Model
4 | final class Person {
| `- error: external macro implementation type 'SwiftDataMacros.PersistentModelMacro' could not be found for macro 'Model()'; plugin for module 'SwiftDataMacros' not found
5 | var firstName: String
6 | var lastName: String
SwiftData.Model:3:320: note: 'Model()' declared here
1 | @available(swift 5.9)
2 | @available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
3 | @attached(member, names: named(_$backingData), named(persistentBackingData), named(schemaMetadata), named(init), named(_$observationRegistrar), named(_SwiftDataNoType), named(access), named(withMutation)) @attached(memberAttribute) @attached(extension, conformances: Observable, PersistentModel, Sendable) public macro Model() = #externalMacro(module: "SwiftDataMacros", type: "PersistentModelMacro")
| `- note: 'Model()' declared here
/ios/tracker/Sources/tracker/Data.swift:4:13: error: class 'Person' has no initializers
2 |
3 | @Model
4 | final class Person {
| `- error: class 'Person' has no initializers
5 | var firstName: String
| `- note: stored property 'firstName' without initial value prevents synthesized initializers
6 | var lastName: String
| `- note: stored property 'lastName' without initial value prevents synthesized initializers
7 | var relatives: [Person] = []
8 | }
[3/6] Compiling tracker Data.swift
Error: exit(1)
is it generally possible to use swiftData, and if no, could you recommend some alternative please?
P.S. probably shouldn't affect anything, but i'm building from a docker container because i couldn't set xtool up on my Nixos host
- 主要言語
- Swift
- スター
- 5.5k
- フォーク
- 163
- 平均マージ
- 19時間 33分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xtool-org/xtool のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
Error: exited(127)オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
xtool-org/xtool#365 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
xtool-org/xtool#364 · リアクション 6 件 ·
メンテナーはふだん 1 日以内に返信
xtool-org/xtool の issue をすべて見る
似ている issue
-
product / auth product / databases product / functions product / messaging product / storage product / vcs
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
storage: eliminate force-unwraps and fatalError in continueStreamingUpload対応中かも @chingor13 が今日担当しました。 オープンapi: storage type: cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-swift#1527 ·
メンテナーはふだん 1 日以内に返信
-
ci-failure ci:assertion test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openwatersio/slackwater-ios#811 ·
メンテナーはふだん 1 日以内に返信
-
ai-assisted
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
swiftlang/swift-testing#1979 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
foxglove/mcap#1907 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信