swift-backtrace
swift-backtrace copied to clipboard
Crash extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
Docker 5.6.2-centos7
> [builder 7/11] RUN swift build -c release --static-swift-stdlib:
#13 1.577 Building for production...
#13 1.738 In file included from /build/.build/checkouts/swift-backtrace/Sources/CBacktrace/elf.c:41:
#13 1.738 /usr/include/unistd.h:1147:35: error: __block attribute not allowed, only allowed on local variables
#13 1.738 extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
#13 1.738 ^
#13 1.766 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization1 error generated.
#13 1.808 [0/875] Compiling CBacktrace elf.c
#13 1.809 [1/875] Compiling _NumericsShims _NumericsShims.c
#13 1.812 [1/875] Compiling CBacktrace dwarf.c
#13 1.812 [2/875] Compiling printf.c
#13 1.813 [3/875] Compiling CBacktrace backtrace.c
#13 1.813 [3/875] Compiling socket.c
------
executor failed running [/bin/sh -c swift build -c release --static-swift-stdlib]: exit code: 1
https://github.com/VineFiner/vapor-hello-action/blob/main/docker/Dockerfile.centos
hi @VineFiner was this fixed? if so, how?
No fixed。 you can test
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace \
swift:5.6.2-centos7 \
/bin/bash -cl " \
yum update -y \
&& yum remove git -y \
&& yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \
&& yum install git -y \
&& swift package resolve \
&& swift build -c release --static-swift-stdlib"
error:
Building for production...
[1/13] Compiling CBacktrace state.c
[2/13] Compiling CBacktrace simple.c
[3/13] Compiling CBacktrace sort.c
In file included from /workspace/Sources/CBacktrace/posix.c:40:
/usr/include/unistd.h:1147:35: error: __block attribute not allowed, only allowed on local variables
extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
^
[4/13] Compiling CBacktrace print.c
hi @VineFiner was this fixed? if so, how? centos7 image
sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
invalid
me add one action
https://github.com/VineFiner/swift-backtrace/blob/main/.github/workflows/build_ci.yaml
hi @VineFiner not clear to me if this is resolved or not. sounded like the centos 7 image used did not have the block swizelling mentioned above applied, tho it should be part of the official swift centos 7 image so its surprising to me that one would need to do that on their own