Re: Wireguard-apple 1.0.16-27 can’t be added via SPM

Andrej Mihajlov and at mullvad.net
Thu Oct 5 10:35:59 UTC 2023


Houman,

Great! 

I have added WireguardKitType as a dynamic library which contains all of the Swift data types used by WireGuardKit, such as: PrivateKey, PublicKey, IPAddressRange, etc.

It does not depend on WireGuardGoBridge, which proved to be problematic to include in unit tests (if I recall that right). Apart from that I noticed that go runtime spawns some worker threads when binary is linked against wg-go, so we didn’t want that in our main bundle or app extensions.

So in short, when using any of data types provided by WireGuardKit:

- Import WireGuardKitTypes in main bundle or app extensions.
- Import WireGuardKit in network extension. Internally WireGuardKit re-exports all types from WireGuardKitTypes.

There is a handful of other improvements besides that and I hope that all of them will be upstreamed over time.

Best,
Andrej

> On 5 Oct 2023, at 12:08, Houman <houmie at gmail.com> wrote:
> 
> Hi Andrej,
> 
> That's absolutely brilliant. Thank you for showing love to this
> project. I have pointed my SPM to your repo and it worked right away.
> What is the WireguardKitType?  That wasn't there before, but It seems
> to be working even without adding that to my project.
> 
> I've starred your project too. Well done.
> 
> Best,
> Houman
> 
> 
> 
> 
> 
> On Thu, 5 Oct 2023 at 10:28, Andrej Mihajlov <and at mullvad.net> wrote:
>> 
>> Hi Houman,
>> 
>> I maintain a fork of wireguard-apple for the past couple of years and it works with Xcode 15 and Swift 5.9:
>> github.com/mullvad/wireguard-apple (branch: mullvad-master)
>> 
>> In the app I maintain, WireGuardGoBridge target is built using bash script for flexibility, instead of bash sorcery so you might want this too:
>> github.com/mullvad/mullvadvpn-app/blob/main/ios/build-wireguard-go.sh <http://github.com/mullvad/mullvadvpn-app/blob/main/ios/build-wireguard-go.sh>
>> 
>> Hope any of this helps.
>> 
>> Best,
>> Andrej
>> 
>>> On 4 Oct 2023, at 18:04, Houman <houmie at gmail.com> wrote:
>>> 
>>> Hello Andrej,
>>> 
>>> Thank you for your reply.  I have already forked the branch and set
>>> Package.swift to swift-tools-version:5.5. But I still get the same
>>> error as before.
>>> 
>>> Swift-tools-version:5.5 only worked with the previous version
>>> 1.0.15-26 that was released on 23rd Sep 2021.
>>> The 1.0.16-27 that was tagged on 15th Feb 2023 is completely broken
>>> and doesn't work with SPM.  I have tried swift-tools-versions 5.6,
>>> 5.7, 5.8 and 5.9.  I strongly believe that this commit from Jason
>>> ccc7472fd7d1c7c19584e6a30c45a56b8ba57790 on 14th Feb 2023 has broken
>>> it.  I don't think he tested it afterwards with SPM.
>>> 
>>> This (outdated) PR proves that more people are having problems with
>>> installing the latest version since the February release:
>>> https://github.com/WireGuard/wireguard-apple/pull/24
>>> 
>>> Error Message:
>>> Invalid manifest (compiled with: "/Applications/Xcode
>>> app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/us/bin/swift",
>>> "visoverlay", "/ar/folders/9m/lwx244892997kpg7vb5vssh0000gn/T/TemporaryDirectory.
>>> BBHXP8/vfs.yaml*, "-", "/Applicationscode.
>>> app/Contents/SharedFrameworks/SwiftM.framework/SharedSupport/ManifestA*,
>>> "PackageDescription, "-Xlinker", "-rath", "-Xlinker", "/Applicatio..
>>> 
>>> Xcode version: Version 15.0 (15A240d)
>>> Mac version: 14.0 (23A344)
>>> 
>>> Your help is much appreciated,
>>> Thanks,
>>> Houman
>>> 
>>> 
>>> On Wed, 4 Oct 2023 at 12:46, Andrej Mihajlov <and at mullvad.net> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> Right. I think that preamble in Package.swift should be changed from:
>>>> 
>>>>> // swift-tools-version:5.3
>>>> 
>>>> to at least:
>>>> 
>>>>> // swift-tools-version:5.5
>>>> 
>>>> Which works with Xcode 15 based on my experience.
>>>> 
>>>> Jason could you please bump it?
>>>> 
>>>> Best,
>>>> 
>>>> Andrej
>>>> 
>>>>> On 30 Sep 2023, at 21:09, Houman <houmie at gmail.com> wrote:
>>>>> 
>>>>> Hello Jason, Andrej
>>>>> 
>>>>> Please try to add the latest Wireguard-Apple 1.0.16-27 via Swift
>>>>> Package Manager and you will see that fails. The issue could be
>>>>> related to swift-tools-version.
>>>>> 
>>>>> Please advise what to do?
>>>>> Thank you.
>>>>> Houman
>>>> 
>> 



More information about the WireGuard mailing list