Compiling issue on Centos7
harry9679 opened this issue · 4 comments
I encountered an error when I tried to build and install the newest version of toolbox (18.5.1) on Centos 7.3.
As explained in the documentation, I first installed the latest swift distribution, which is swift-5.6.3-RELEASE.
Then I follow the steps in the documentation:
git clone https://github.com/vapor/toolbox.git
cd toolbox
git checkout <desired version>
make install
I got the same issue mentioned in #355. And I upgraded git to 2.36.1 to solve the issue.
After I solved the issue, I got another one, the outputs are:
swiftc ./scripts/build.swift
./build
$ swift build --disable-sandbox --configuration release -Xswiftc -cross-module-optimization
Building for production...
In file included from /root/toolbox/.build/checkouts/swift-nio/Sources/CNIOLinux/shim.c:27:
/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));
^
1 error generated.
[0/6] Compiling CNIOLinux shim.c
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: build.ShellError(terminationStatus: 1)
Current stack trace:
0 libswiftCore.so 0x00007fa41403bd50 _swift_stdlib_reportFatalErrorInFile + 112
1 libswiftCore.so 0x00007fa413d35a7c <unavailable> + 1419900
2 libswiftCore.so 0x00007fa413d358a3 <unavailable> + 1419427
3 libswiftCore.so 0x00007fa413d343b0 _assertionFailure(_:_:file:line:flags:) + 411
4 libswiftCore.so 0x00007fa413d97e81 <unavailable> + 1822337
5 build 0x000055acdacab1c7 <unavailable> + 8647
6 libc.so.6 0x00007fa41382f460 __libc_start_main + 245
7 build 0x000055acdacaaf09 <unavailable> + 7945
make: *** [build] Illegal instruction
make: *** Deleting file `build'
I'm not sure how to fix this. Has anyone else met the same problem?
Hmm this looks like a missing dependency I think? Can you build a simple Swift package or just SwiftNIO?
I tried another SwiftNIO example and got the same error.
I found another thread on https://forums.swift.org/t/vapor-build-crash-swift-5-6-2-centos7/58302/4 . I'll try in other environments. Thank you!
@harry9679 ok cool, best thing would be the create an issue on NIO and see what they say
Going to close this as things should be working with the latest main
and Swift release. Feel free to reopen if not!