You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to include grpc-swift in https://github.com/rvolosatovs/docker-protobuf, an all-inclusive Dockerised bundle of protoc compilers. Our CI runs on x86_64, and we use Docker with QEMU to build an ARM64 image. I'm having a lot of difficulty with random crashes at various points in the compilation process, and these crashes do not occur when running on native ARM64.
Simplified Dockerfile to reproduce the issue:
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
What have you tried so far?
I've had issues open on the Swift Forums since Swift 5.6 to try and get this working. The errors have changed now with Swift 5.9, but successfully compiling the plugin is still impossible. Compiler devs have suggested that grpc-swift may be using fatalError() to report expected error messages to the user. I wonder if devs here could confirm they are able to reproduce this and maybe join the discussion at https://forums.swift.org/t/swift-runtime-unable-to-suspend-thread-when-compiling-in-qemu/67676 or help us out by suggesting an alternative method to build a plugin binary for ARM64 in CI. Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for this issue! Unfortunately I recommend continuing to pursue this with the Swift team on the forums. We cannot trigger this error message with our own package code, and we do not. The packages compile fine under Rosetta for Linux so it’s highly likely this is specifically an interaction between QEMU and either Swift or SwiftPM.
What are you trying to achieve?
I am trying to include
grpc-swift
in https://github.com/rvolosatovs/docker-protobuf, an all-inclusive Dockerised bundle of protoc compilers. Our CI runs on x86_64, and we use Docker with QEMU to build an ARM64 image. I'm having a lot of difficulty with random crashes at various points in the compilation process, and these crashes do not occur when running on native ARM64.Simplified Dockerfile to reproduce the issue:
Running
docker buildx build --platform linux/arm64 .
results in the following error:What have you tried so far?
I've had issues open on the Swift Forums since Swift 5.6 to try and get this working. The errors have changed now with Swift 5.9, but successfully compiling the plugin is still impossible. Compiler devs have suggested that
grpc-swift
may be usingfatalError()
to report expected error messages to the user. I wonder if devs here could confirm they are able to reproduce this and maybe join the discussion at https://forums.swift.org/t/swift-runtime-unable-to-suspend-thread-when-compiling-in-qemu/67676 or help us out by suggesting an alternative method to build a plugin binary for ARM64 in CI. Thanks!The text was updated successfully, but these errors were encountered: