Avatar
omochimetaru 5/8/2019 9:47 AM
SwiftPMのリソースサポートの進捗を調べた。 話してるスレッド https://forums.swift.org/t/swift-pm-bundles-and-resources/13981 によると、OSS FoundationにBundleサポートを実装すれば、SwiftPMでそれを取り扱えるようになる、という流れで、 Bundleの仕様書がここ https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/FHS%20Bundles.md#freestanding-bundles Bundleの実装が、2018年1月に出て https://github.com/apple/swift-corelibs-foundation/pull/1573 でも完了してなくて、 26日前に別PRのBundle実装が出てマージ待ち https://github.com/apple/swift-corelibs-foundation/pull/2093 SwiftPM側のリソースサポートの提案の下書きがコレ https://github.com/abertelrud/swift-evolution/blob/package-manager-resources/proposals/NNNN-package-manager-resources.md というわけで、ゆっくり進んでる事がわかった
Once Swift Foundation PR #1573 and #1570 are merged we will be able to use Bundle API on Linux with Freestanding bundles. This means that with the following structure: FooExecutable FooExecutable.resources/Info.plist FooExecutable.resources/FooResource.json libBarLibrary.so ...
The Foundation Project, providing core utilities, internationalization, and OS independence - apple/swift-corelibs-foundation
Implements Bundle(for:) by using dladdr() on the type descriptor of a class. For further discussion, see apple/swift#16964, which is a dependency of this patch. Resolves SR-953.
Adds support for finding the bundle path for implicitly loaded bundles (for which we only know the executable path). Unifies Windows and other platforms implementation. Enables Freestanding Bundles...
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - abertelrud/swift-evolution
👀 2
9:54 AM
PR1573はBundle(for: class)で、Bundle実装自体は1570だけどcloseされて2093に引き継がれたんだ。 https://github.com/apple/swift-corelibs-foundation/pull/1570 Bundle(for: class)のためにtypedescriptorを取るランタイム関数がSwiftランタイムに追加されて、その結果のシンボルをdladdrにかけてdylibの名前を参照してる。
This enables finding Freestanding bundles directory from the executable path as specified on the FHS Bundles doc. Unifies Windows implementation with other platforms.