Previous possibly related thread: Build crash when building in QEMU using new Swift 5.6 arm64 image
I am trying to build the following Dockerfile on a Linux x86_64 host:
FROM swift:5.9 RUN apt-get update RUN apt-get install -y \ build-essential \ curl \ libnghttp2-dev \ libssl-dev \ patchelf \ unzip \ zlib1g-dev RUN mkdir -p /protoc-gen-swift && \ mkdir -p /grpc-swift RUN curl -sSL https://api.github.com/repos/grpc/grpc-swift/tarball/1.19.1 | tar xz --strip 1 -C /grpc-swift WORKDIR /grpc-swift RUN make RUN make plugins Running docker buildx build --platform linux/arm64 . results in the following error:
119.4 Creating working copy for https://github.com/apple/swift-nio.git 120.6 Working copy of https://github.com/apple/swift-nio.git resolved at 2.59.0 125.6 error: 'swift-nio-extras': Invalid manifest (compiled with: ["/usr/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.xvbRB2/vfs.yaml", "-L", "/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/usr/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/usr/lib/swift/pm/ManifestAPI", "-package-description-version", "5.6.0", "/grpc-swift/.build/checkouts/swift-nio-extras/Package.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.7Tvpa4/swift-nio-extras-manifest"]) 125.6 swift-runtime: unable to suspend thread 2739 125.6 swift-runtime: unable to suspend thread 2739 140.0 make: *** [Makefile:25: all] Error 1 I'm unable to find any previous reference to this error on the internet, it is emitted from here: https://github.com/apple/swift/blob/main/stdlib/public/runtime/CrashHandlerLinux.cpp#L506
Attempting to run the build multiple times shows that the failure occurs at a range of different points during the compile process, but it always occurs at some point before completion. Watching my CPU load, I can see that it usually occurs soon after a large number of threads are started, putting load on multiple CPU cores rather than just one. Can anyone reproduce this or help me get it working? Would a cross compiler be an alternative option to running the compile in the QEMU emulator?
Edit: ping @al45tair I think you might know more about thread handling under Linux?