Skip to content

[BUG] Swift 6.2 / Xcode 26.0.1でビルドが通らない #302

@mtgto

Description

@mtgto

Describe the bug (不具合を説明してください)

正確にはAzooKeyKanaKanjiConverter自体の問題ではなくSwift 6.2の不具合と思われますが共有しておきます。

https://github.com/gitusp/azoo-key-skkserv をXcode 26.0.1でビルドしようとしたところ、error: no such module 'llama' といわれてAzooKeyKanaKanjiConverterのビルドがこけることに気付きました。
@gitusp さんと一緒に調べたところ、Xcode 16.4やXcode 26.1beta3ではビルドが通るが、Xcode 26.0.1では通らないようです。

また最初はAzooKeyKanaKanjiConverterを使用しているアプリで起きると思ったのですが、Traitを指定するとAzooKeyKanaKanjiConverterでもビルドエラーが起きることがわかりました。

swift build --traits Zenzai
[1/1] Planning build
Building for debugging...
/Users/user/work/cocoa/AzooKeyKanaKanjiConverter/Sources/KanaKanjiConverterModule/ConversionAlgorithms/Zenzai/Zenz/ZenzContext.swift:3:8: error: no such module 'llama'
  1 | #if Zenzai || ZenzaiCPU
  2 | // Zenzai/ZenzaiCPU が有効でない場合、llama-mock.swift の実装が利用される
  3 | import llama
    |        `- error: no such module 'llama'
  4 | #endif
  5 |
(以下略)

Xcode 26.1beta3 ではビルドできることからSwift 6.2の不具合ではないかと思い、Issueを探したところ、「Traitsが複数あるパッケージで起きる問題」がSwift 6.2.1の修正に入っていることがわかりました。

swiftlang/swift-package-manager#9141

実際AzooKeyKanaKanjiConverterのPackage.swiftからTraits "ZenzaiCPU" を取り除いて swift build --traits Zenzai するとXcode 26.0.1でもビルドは通るようでした。

azooKey/azooKey-Desktop#205 のような対応はXcode 26.0では必要かとは思いますが、おそらくXcode 26.1では不要になるんじゃないかと思います。

このIssueは情報共有が目的なのでご自由なタイミングで閉じていただいて大丈夫です。

A clear and concise description of what the bug is.

To Reproduce (どのような手順で実行すると不具合が生じるのか、詳しく教えてください)
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior (どういう動作になるのが正しいと思いますか?)
A clear and concise description of what you expected to happen.

Screenshots (スクリーンショットがあれば添付してください)
If applicable, add screenshots to help explain your problem.

Environment (環境を詳しく教えてください):

  • Device: [e.g. iPhone12]
  • iOS / iPadOS and its version: [e.g. iOS 16.2]
  • App Running Keyboard [e.g. LINE, notes, Slack]
  • App Version [e.g. 1.9]

Is it possible to keep in touch with you on an ongoing basis to fix this bug? (バグの修正のため、継続的なやり取りは可能ですか?)

Additional context (その他共有したい事項があれば記述してください)
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions