Swift Package Manager not creating library (.a) files


(Michael Brown) #1

Hi,

I tried using the Swift Package Manager for the first time today. I was trying to adapt a library I'm working on to support it. When I run "swift build" it builds, but there is no .a file anywhere in the .build directory tree. All I get is a .swiftmodule file.

In case I had something wrong setup in my library, I downloaded the SPM example (https://github.com/apple/example-package-playingcard) and tried to build that. According to the documentation here (https://swift.org/package-manager/#example-usage) this should produce a .a file in the root of the .build/debug directory. It doesn't. There is no .a file anywhere, only a .swiftmodule file. By the way, the documentation is out of date as the intermediate build .o files are now in a <modulename>.build directory, not at the root of .build.

I'm using the latest development snapshot downloaded from swift.org <http://swift.org/>.

Thanks,
- Michael.


(Max Howell) #2

Yes this is by design.

You have to specify binary products if you want them since testing integration landed.

What are you trying to do?

···

Hi,

I tried using the Swift Package Manager for the first time today. I was trying to adapt a library I'm working on to support it. When I run "swift build" it builds, but there is no .a file anywhere in the .build directory tree. All I get is a .swiftmodule file.

In case I had something wrong setup in my library, I downloaded the SPM example (https://github.com/apple/example-package-playingcard) and tried to build that. According to the documentation here (https://swift.org/package-manager/#example-usage) this should produce a .a file in the root of the .build/debug directory. It doesn't. There is no .a file anywhere, only a .swiftmodule file. By the way, the documentation is out of date as the intermediate build .o files are now in a <modulename>.build directory, not at the root of .build.

I'm using the latest development snapshot downloaded from swift.org <http://swift.org/>.

Thanks,
- Michael.
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Michael Brown) #3

I was trying to add SPM support to this library: https://github.com/Velhotes/Vinyl

I wanted to make sure I had done it properly and was concerned the absence of a .a file meant I hadn't. It looks like it's ok now though.

···

Sent from my iPhone.

On 26 Feb 2016, at 21:34, Max Howell <max.howell@apple.com> wrote:

Yes this is by design.

You have to specify binary products if you want them since testing integration landed.

What are you trying to do?

Hi,

I tried using the Swift Package Manager for the first time today. I was trying to adapt a library I'm working on to support it. When I run "swift build" it builds, but there is no .a file anywhere in the .build directory tree. All I get is a .swiftmodule file.

In case I had something wrong setup in my library, I downloaded the SPM example (https://github.com/apple/example-package-playingcard) and tried to build that. According to the documentation here (https://swift.org/package-manager/#example-usage) this should produce a .a file in the root of the .build/debug directory. It doesn't. There is no .a file anywhere, only a .swiftmodule file. By the way, the documentation is out of date as the intermediate build .o files are now in a <modulename>.build directory, not at the root of .build.

I'm using the latest development snapshot downloaded from swift.org.

Thanks,
- Michael.
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Max Howell) #4

I was trying to add SPM support to this library: https://github.com/Velhotes/Vinyl

I wanted to make sure I had done it properly and was concerned the absence of a .a file meant I hadn't. It looks like it's ok now though.

Oh ok. So, if you get the .swiftmodule in your .build/debug directory then a client package can import it.