Back

[SOLVED] Errors when deploying swift function with multiple dependencies

  • 0
  • Functions
Zach
22 Jul, 2023, 00:40

I am working on a function in swift that previously only had one dependency and it worked fine. Since adding a second dependency the deployment fails instantly. Changing Package.swift to have only one of either dependency works fine but I can't add both without getting the attached error. Here is my Package.swift

TypeScript
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "send-message",
    dependencies: [
        .package(url: "https://github.com/apple/swift-crypto.git", from: "2.0.3"),
        .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.9.0"),
    ],
    targets: [
        .target(
            name: "send-message",
            dependencies: [
                .product(name: "Crypto", package: "swift-crypto"),
                .product(name: "AsyncHTTPClient", package: "async-http-client"),
            ]
        )
    ]
)
TL;DR
User is experiencing errors when deploying a Swift function with multiple dependencies. One suggestion is to try using a different Docker image (`docker pull openruntimes/swift:v3-5.5`). The user also mentions discussing a fix with someone and creating an issue on GitHub.
Drake
22 Jul, 2023, 02:13

hmm ya this might be a bug...

Drake
22 Jul, 2023, 02:32

It'd be great if you could create an issue so that we don't lose track of this

Zach
22 Jul, 2023, 02:48

Should the issue be opened on the open-runtimes repository or appwrite?

Drake
22 Jul, 2023, 02:55

you can do appwrite

Zach
22 Jul, 2023, 03:09
Drake
22 Jul, 2023, 21:01

and cc @dlohani because i noticed you're working on the new runtimes.

dlohani
23 Jul, 2023, 02:38

Thanks, I see you already have a fix 👍

Zach
24 Jul, 2023, 21:38

Thank you for creating a fix so fast. How can I update my swift runtime with the changes?

Drake
24 Jul, 2023, 21:50

hmm looks like i need to apply the fix on a different branch and then create a release. i'lll work on that today

Zach
24 Jul, 2023, 21:52

Sounds good!

Drake
24 Jul, 2023, 21:54

are you on cloud or self-hosting?

Zach
24 Jul, 2023, 21:55

self hosting

Drake
26 Jul, 2023, 16:34

ok on your server, can you try running:

TypeScript
docker pull openruntimes/swift:v3-5.5

then, try to build again

Drake
26 Jul, 2023, 16:34

wait...

Drake
26 Jul, 2023, 16:35

what's docker images output?

Drake
26 Jul, 2023, 16:36

i think it's actually:

TypeScript
docker pull openruntimes/swift:v2-5.5
Zach
26 Jul, 2023, 16:38

Im away from my computer rn, ill let you know in ~30 minutes

Drake
26 Jul, 2023, 16:38

of course! no rush

Zach
26 Jul, 2023, 17:19

I ran docker pull openruntimes/swift:v2-5.5 and I was able to build! Thank you for your help

Zach
26 Jul, 2023, 17:21

[SOLVED] Errors when deploying swift function with multiple dependencies

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more