hummingbird-project / hummingbird-examples

Examples demonstrating various aspects of the Hummingbird swift server framework
Apache License 2.0
88 stars 19 forks source link

Hummingbird with the Static Linux SDK #121

Closed diuming closed 1 month ago

diuming commented 1 month ago

I try to build Hummingbird hello example with Debian12 in 2 ways

1)normal build(works very well)
  % swift build -c release
  % sudo .build/release/App
    ... info Hummingbird : [HummingbirdCore] Server started and listening on 192.168.1.31:80
2)build with static linux SDK(It doesn’t work)
  % swift build --swift-sdk aarch64-swift-linux-musl -c release
  % sudo .build/release/App
  ... info Hummingbird : [HummingbirdCore] Server started and listening on 192.168.1.31:80
  Trace/breakpoint trap

Do i forget something or it can't build with static linux SDK?

Hardware: Raspberry pi 5 OS: Linux pi 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt2 (2024-10-01) aarch64 GNU/Linux Swift: Swift version 6.0.1 (swift-6.0.1-RELEASE) Swift SDK: swift-6.0.1-RELEASE_static-linux-0.0.1

adam-fowler commented 1 month ago

What version of hummingbird are you running with?

adam-fowler commented 1 month ago

This may also be due to https://github.com/apple/swift-async-algorithms/pull/325 not being in a released build.

EDIT: Looks like that PR made it into swift-async-algorithms 1.0.2

diuming commented 1 month ago

What version of hummingbird are you running with?

Hummingbird 2.1.0

adam-fowler commented 1 month ago

And swift-async-algorithms?

diuming commented 1 month ago

And swift-async-algorithms?

swift-async-algorithms 1.0.1

diuming commented 1 month ago

Package.resolved

{
  "originHash" : "23acdebd0eccccb72c31bca65361991239b9a3bd20dd232bc0498b6ba4ccd2e4",
  "pins" : [
    {
      "identity" : "async-http-client",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swift-server/async-http-client.git",
      "state" : {
        "revision" : "64abc77edf1ef81e69bd90a2ac386de615c8e8ea",
        "version" : "1.23.0"
      }
    },
    {
      "identity" : "hummingbird",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/hummingbird-project/hummingbird.git",
      "state" : {
        "revision" : "913e6a0b4bd9c1c0efd399cd870c47187e74d00e",
        "version" : "2.1.0"
      }
    },
    {
      "identity" : "swift-algorithms",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-algorithms.git",
      "state" : {
        "revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
        "version" : "1.2.0"
      }
    },
    {
      "identity" : "swift-argument-parser",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-argument-parser.git",
      "state" : {
        "revision" : "41982a3656a71c768319979febd796c6fd111d5c",
        "version" : "1.5.0"
      }
    },
    {
      "identity" : "swift-async-algorithms",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-async-algorithms.git",
      "state" : {
        "revision" : "6ae9a051f76b81cc668305ceed5b0e0a7fd93d20",
        "version" : "1.0.1"
      }
    },
    {
      "identity" : "swift-atomics",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-atomics.git",
      "state" : {
        "revision" : "cd142fd2f64be2100422d658e7411e39489da985",
        "version" : "1.2.0"
      }
    },
    {
      "identity" : "swift-collections",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-collections.git",
      "state" : {
        "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
        "version" : "1.1.4"
      }
    },
    {
      "identity" : "swift-distributed-tracing",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-distributed-tracing.git",
      "state" : {
        "revision" : "11c756c5c4d7de0eeed8595695cadd7fa107aa19",
        "version" : "1.1.1"
      }
    },
    {
      "identity" : "swift-http-types",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-http-types.git",
      "state" : {
        "revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
        "version" : "1.3.0"
      }
    },
    {
      "identity" : "swift-log",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-log.git",
      "state" : {
        "revision" : "9cb486020ebf03bfa5b5df985387a14a98744537",
        "version" : "1.6.1"
      }
    },
    {
      "identity" : "swift-metrics",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-metrics.git",
      "state" : {
        "revision" : "e0165b53d49b413dd987526b641e05e246782685",
        "version" : "2.5.0"
      }
    },
    {
      "identity" : "swift-nio",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio.git",
      "state" : {
        "revision" : "665206000b8307cab5ac51203d29b0f232d7e31b",
        "version" : "2.74.0"
      }
    },
    {
      "identity" : "swift-nio-extras",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio-extras.git",
      "state" : {
        "revision" : "d1ead62745cc3269e482f1c51f27608057174379",
        "version" : "1.24.0"
      }
    },
    {
      "identity" : "swift-nio-http2",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio-http2.git",
      "state" : {
        "revision" : "b5f7062b60e4add1e8c343ba4eb8da2e324b3a94",
        "version" : "1.34.0"
      }
    },
    {
      "identity" : "swift-nio-ssl",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio-ssl.git",
      "state" : {
        "revision" : "7b84abbdcef69cc3be6573ac12440220789dcd69",
        "version" : "2.27.2"
      }
    },
    {
      "identity" : "swift-nio-transport-services",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-nio-transport-services.git",
      "state" : {
        "revision" : "dbace16f126fdcd80d58dc54526c561ca17327d7",
        "version" : "1.22.0"
      }
    },
    {
      "identity" : "swift-numerics",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-numerics.git",
      "state" : {
        "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
        "version" : "1.0.2"
      }
    },
    {
      "identity" : "swift-service-context",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-service-context.git",
      "state" : {
        "revision" : "0c62c5b4601d6c125050b5c3a97f20cce881d32b",
        "version" : "1.1.0"
      }
    },
    {
      "identity" : "swift-service-lifecycle",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swift-server/swift-service-lifecycle.git",
      "state" : {
        "revision" : "24c800fb494fbee6e42bc156dc94232dc08971af",
        "version" : "2.6.1"
      }
    },
    {
      "identity" : "swift-system",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-system.git",
      "state" : {
        "revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5",
        "version" : "1.3.2"
      }
    }
  ],
  "version" : 3
}
adam-fowler commented 1 month ago

Can you try with v1.0.2

diuming commented 1 month ago

Can you try with v1.0.2

How do I control swift-async-algorithms version to 1.0.2?

adam-fowler commented 1 month ago

swift package update should use the latest available versions.

adam-fowler commented 1 month ago

Otherwise there is a PR that requires v1.0.2. https://github.com/hummingbird-project/hummingbird/pull/581

compufox commented 1 month ago

chiming in since I have been trying to deal with the same issue, and running swift package update to get the 1.0.2 of swift-async-algorithms fixed the issue for me. thanks!

diuming commented 1 month ago

Yes! It works. thanks!