Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbox install fails in Swift 5.5.1 #371

Closed
carlhung opened this issue Oct 29, 2021 · 8 comments
Closed

Toolbox install fails in Swift 5.5.1 #371

carlhung opened this issue Oct 29, 2021 · 8 comments

Comments

@carlhung
Copy link

Describe the bug

When running make install:

swiftc ./scripts/build.swift
scripts/build.swift:48:10: warning: 'launchPath' is deprecated: renamed to 'executableURL'
    task.launchPath = "/usr/bin/env"
         ^
scripts/build.swift:48:10: note: use 'executableURL' instead
    task.launchPath = "/usr/bin/env"
         ^~~~~~~~~~
         executableURL
scripts/build.swift:50:10: warning: 'launch()' is deprecated: renamed to 'run'
    task.launch()
         ^
scripts/build.swift:50:10: note: use 'run' instead
    task.launch()
         ^~~~~~
         run
scripts/build.swift:61:10: warning: 'launchPath' is deprecated: renamed to 'executableURL'
    task.launchPath = "/usr/bin/env"
         ^
scripts/build.swift:61:10: note: use 'executableURL' instead
    task.launchPath = "/usr/bin/env"
         ^~~~~~~~~~
         executableURL
scripts/build.swift:69:10: warning: 'launch()' is deprecated: renamed to 'run'
    task.launch()
         ^
scripts/build.swift:69:10: note: use 'run' instead
    task.launch()
         ^~~~~~
         run
./build
$ swift build --disable-sandbox --configuration release -Xswiftc -cross-module-optimization --enable-test-discovery
Fetching https://github.com/vapor/console-kit.git from cache
Fetching https://github.com/tanner0101/mustache.git from cache
Fetching https://github.com/jpsim/Yams.git from cache
Fetched https://github.com/vapor/console-kit.git (1.03s)
Fetching https://github.com/apple/swift-nio.git from cache
Fetched https://github.com/jpsim/Yams.git (1.20s)
Fetched https://github.com/tanner0101/mustache.git (1.24s)
Fetched https://github.com/apple/swift-nio.git (3.45s)
Computing version for https://github.com/jpsim/Yams.git
Computed https://github.com/jpsim/Yams.git at 2.0.0 (0.80s)
Computing version for https://github.com/tanner0101/mustache.git
Computed https://github.com/tanner0101/mustache.git at 0.1.1 (0.78s)
Computing version for https://github.com/vapor/console-kit.git
Computed https://github.com/vapor/console-kit.git at 4.2.7 (6.23s)
Fetching https://github.com/apple/swift-log.git from cache
Fetched https://github.com/apple/swift-log.git (1.39s)
Computing version for https://github.com/apple/swift-log.git
Computed https://github.com/apple/swift-log.git at 1.4.2 (0.71s)
Computing version for https://github.com/apple/swift-nio.git
Computed https://github.com/apple/swift-nio.git at 2.33.0 (1.29s)
Creating working copy for https://github.com/tanner0101/mustache.git
Working copy of https://github.com/tanner0101/mustache.git resolved at 0.1.1
Creating working copy for https://github.com/jpsim/Yams.git
Working copy of https://github.com/jpsim/Yams.git resolved at 2.0.0
Creating working copy for https://github.com/apple/swift-log.git
Working copy of https://github.com/apple/swift-log.git resolved at 1.4.2
Creating working copy for https://github.com/apple/swift-nio.git
Working copy of https://github.com/apple/swift-nio.git resolved at 2.33.0
Creating working copy for https://github.com/vapor/console-kit.git
Working copy of https://github.com/vapor/console-kit.git resolved at 4.2.7
warning: '--enable-test-discovery' option is deprecated; tests are automatically discovered on all platforms
remark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with wh === NIOConcurrencyHelpers, SwiftOverlayShims, timeval
remark: Incremental compilation has been disabled: it is not compatible with wh/home/ubuntu/toolbox/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:32: warning: initialization of 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') results in a dangling pointer
            versionDirective = UnsafeMutablePointer(&versionDirectiveValue)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/toolbox/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: implicit argument conversion from 'yaml_version_directive_t' (aka 'yaml_version_directive_s') to 'UnsafeMutablePointer<yaml_version_directive_t>' (aka 'UnsafeMutablePointer<yaml_version_directive_s>') produces a pointer valid only for the duration of the call to 'init(_:)'
            versionDirective = UnsafeMutablePointer(&versionDirectiveValue)
                                                    ^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/toolbox/.build/checkouts/Yams/Sources/Yams/Emitter.swift:338:53: note: use 'withUnsafeMutablePointer' in order to explicitly convert argument to pointer valid for a defined scope
            versionDirective = UnsafeMutablePointer(&versionDirectiveValue)
                                                    ^
remark: Incremental compilation has been disabled: it is not compatible with whremark: Incremental compilation has been disabled: it is not compatible with whswift-frontend: /home/build-user/swift/lib/SILOptimizer/Analysis/CallerAnalysis.cpp:237: (anonymous namespace)::FunctionInfo &swift::CallerAnalysis::unsafeGetFunctionInfo(swift::SILFunction *): Assertion `r != funcInfos.end() && "Function does not have functionInfo!"' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.      Program arguments: /usr/bin/swift-frontend -frontend -c /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BSDSocketAPICommon.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BSDSocketAPIPosix.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BSDSocketAPIWindows.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BaseSocket.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BaseSocketChannel+SocketOptionProvider.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BaseSocketChannel.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/BaseStreamSocketChannel.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Bootstrap.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/ControlMessage.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/DatagramVectorReadManager.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/FileDescriptor.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/GetaddrinfoResolver.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/HappyEyeballs.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/IO.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/IntegerBitPacking.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/IntegerTypes.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Linux.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/LinuxCPUSet.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/LinuxUring.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/MultiThreadedEventLoopGroup.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/NIOThreadPool.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/NonBlockingFileIO.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/PendingDatagramWritesManager.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/PendingWritesManager.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/PipeChannel.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/PipePair.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/PointerHelpers.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Resolver.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Selectable.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectableChannel.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectableEventLoop.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectorEpoll.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectorGeneric.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectorKqueue.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SelectorUring.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/ServerSocket.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Socket.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SocketChannel.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/SocketProtocols.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/System.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Thread.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/ThreadPosix.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/ThreadWindows.swift /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/NIOPosix/Utilities.swift -supplementary-output-file-map /tmp/TemporaryDirectory.ETX5kP/supplementaryOutputs-1 -target aarch64-unknown-linux-gnu -Xllvm -aarch64-use-tbi -disable-objc-interop -I /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release -color-diagnostics -g -module-cache-path /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -new-driver-path /usr/bin/swift-driver -resource-dir /usr/lib/swift -Xcc -fmodule-map-file=/home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/CNIOAtomics.build/module.modulemap -Xcc -I -Xcc /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/CNIOAtomics/include -Xcc -fmodule-map-file=/home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap -Xcc -I -Xcc /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/CNIOWindows/include -Xcc -fmodule-map-file=/home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/CNIODarwin.build/module.modulemap -Xcc -I -Xcc /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/CNIODarwin/include -Xcc -fmodule-map-file=/home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/CNIOLinux.build/module.modulemap -Xcc -I -Xcc /home/ubuntu/toolbox/.build/checkouts/swift-nio/Sources/CNIOLinux/include -module-name NIOPosix -parse-as-library -num-threads 4 -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BSDSocketAPICommon.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BSDSocketAPIPosix.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BSDSocketAPIWindows.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BaseSocket.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BaseSocketChannel+SocketOptionProvider.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BaseSocketChannel.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/BaseStreamSocketChannel.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Bootstrap.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/ControlMessage.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/DatagramVectorReadManager.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/FileDescriptor.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/GetaddrinfoResolver.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/HappyEyeballs.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/IO.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/IntegerBitPacking.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/IntegerTypes.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Linux.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/LinuxCPUSet.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/LinuxUring.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/MultiThreadedEventLoopGroup.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/NIOThreadPool.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/NonBlockingFileIO.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/PendingDatagramWritesManager.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/PendingWritesManager.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/PipeChannel.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/PipePair.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/PointerHelpers.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Resolver.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Selectable.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectableChannel.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectableEventLoop.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectorEpoll.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectorGeneric.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectorKqueue.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SelectorUring.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/ServerSocket.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Socket.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SocketChannel.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/SocketProtocols.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/System.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Thread.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/ThreadPosix.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/ThreadWindows.swift.o -o /home/ubuntu/toolbox/.build/aarch64-unknown-linux-gnu/release/NIOPosix.build/Utilities.swift.o -cross-module-optimization
1.      Swift version 5.5 (swift-5.5-RELEASE)
2.
3.      While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for NIOPosix.NIOPosix)
4.      While running pass #19711 SILModuleTransform "GlobalOpt".
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/usr/bin/swift-frontend[0x529e5c4]

Swift/ErrorType.swift:200: Fatal error: Error raised at top level: build.ShellError(terminationStatus: 1)
Current stack trace:
0    libswiftCore.so                    0x0000ffff9b89ea54 swift_reportError + 64
1    libswiftCore.so                    0x0000ffff9b90ecf4 _swift_stdlib_reportFatalErrorInFile + 124
2    libswiftCore.so                    0x0000ffff9b64ca28 _assertionFailure(_:_:file:line:flags:) + 296
3    libswiftCore.so                    0x0000ffff9b6ad18c swift_errorInMain + 516
4    build                              0x0000aaaae04a212c <unavailable> + 8492
5    libc.so.6                          0x0000ffff9b15dfa8 __libc_start_main + 232
6    build                              0x0000aaaae04a1ef4 <unavailable> + 7924
make: *** [Makefile:5: build] Trace/breakpoint trap (core dumped)
make: *** Deleting file 'build'

To Reproduce

run on raspberry pi 4 with ubuntu 20.04.3 64bit OS

Environment

  • Vapor from origin/main of commit of 7575fe2
  • Swift 5.5
  • OS version: ubuntu 20.04.3 64bit OS for raspberry pi 4
@fouadhatem
Copy link

@carlhung I think there was another similar issue filed a few days back, related to a minor Swift 5.5 bug which was resolved in 5.5.1. Try upgrading your Swift toolchain to 5.5.1 and then run make install again.

@assasix11
Copy link

same problem in 5.5.1

  • ubuntu 16.04

@0xTim 0xTim transferred this issue from vapor/vapor Nov 16, 2021
@0xTim 0xTim changed the title crash on make install Toolbox install fails in Swift 5.5.1 Nov 17, 2021
@rafikkasmi
Copy link

Hello everyone, i've been in this and i wasnt able to install it using the way the docs said , so i tried using the vapor 3 docs way, and it did work for me ,
so u can try to compile it using this command : swift build -c release --disable-sandbox
and then move to the /usr/local/bin using this command : mv .build/release/vapor /usr/local/bin
this worked for me , and hope it'll work for y'all , and i hope the vapor team would fix either the docs or errors showing .

@0xTim
Copy link
Member

0xTim commented Nov 20, 2021

It's a bug with the script/Swift interpreting the script, I'm hoping to fix it next week

@timsonner
Copy link

timsonner commented Nov 22, 2021

Build failing after make install

1. Swift version 5.5.1 (swift-5.5.1-RELEASE)
2.
3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for NIOPosix.NIOPosix)
4. While running pass #19707 SILModuleTransform "GlobalOpt".
#0 0x00000000059e1783 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/share/swift/usr/bin/swift-frontend+0x59e1783)
#1 0x00000000059df66e llvm::sys::RunSignalHandlers() (/usr/share/swift/usr/bin/swift-frontend+0x59df66e)
#2 0x00000000059e1b05 SignalHandler(int) (/usr/share/swift/usr/bin/swift-frontend+0x59e1b05)
#3 0x00007f76075247e0 __restore_rt (/lib64/libpthread.so.0+0x117e0)
#4 0x00007f7605e72ca0 raise (/lib64/libc.so.6+0x33ca0)
#5 0x00007f7605e74148 abort (/lib64/libc.so.6+0x35148)
#6 0x00007f7605e6ba4a __assert_fail_base (/lib64/libc.so.6+0x2ca4a)
#7 0x00007f7605e6bac2 (/lib64/libc.so.6+0x2cac2)
#8 0x0000000001039cbf swift::CallerAnalysis::unsafeGetFunctionInfo(swift::SILFunction*) (/usr/share/swift/usr/bin/swift-frontend+0x1039cbf)
#9 0x000000000103bf80 swift::CallerAnalysis::invalidate() (/usr/share/swift/usr/bin/swift-frontend+0x103bf80)
#10 0x00000000010e7899 (anonymous namespace)::SILGlobalOptPass::run() (/usr/share/swift/usr/bin/swift-frontend+0x10e7899)
#11 0x0000000000d9d5b0 swift::SILPassManager::runModulePass(unsigned int) (/usr/share/swift/usr/bin/swift-frontend+0xd9d5b0)
#12 0x0000000000d9fe8a swift::SILPassManager::execute() (/usr/share/swift/usr/bin/swift-frontend+0xd9fe8a)
#13 0x0000000000d99dc8 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) (/usr/share/swift/usr/bin/swift-frontend+0xd99dc8)
#14 0x0000000000d99d7b swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const (/usr/share/swift/usr/bin/swift-frontend+0xd99d7b)
#15 0x0000000000dbc9ba swift::SimpleRequest (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) (/usr/share/swift/usr/bin/swift-frontend+0xdbc9ba)
#16 0x0000000000da51f3 llvm::Expected swift::Evaluator::getResultUncached(swift::ExecuteSILPipelineRequest const&) (/usr/share/swift/usr/bin/swift-frontend+0xda51f3)
#17 0x0000000000d99f95 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) (/usr/share/swift/usr/bin/swift-frontend+0xd99f95)
#18 0x0000000000da6abf swift::runSILOptimizationPasses(swift::SILModule&) (/usr/share/swift/usr/bin/swift-frontend+0xda6abf)
#19 0x00000000006f4902 swift::CompilerInstance::performSILProcessing(swift::SILModule*) (/usr/share/swift/usr/bin/swift-frontend+0x6f4902)
#20 0x000000000056c72b performCompileStepsPostSILGen(swift::CompilerInstance&, std::unique_ptr >, llvm::PointerUnion, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) (/usr/share/swift/usr/bin/swift-frontend+0x56c72b)
#21 0x000000000056c10e performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) (/usr/share/swift/usr/bin/swift-frontend+0x56c10e)
#22 0x000000000055f9b8 swift::performFrontend(llvm::ArrayRef, char const*, void*, swift::FrontendObserver*) (/usr/share/swift/usr/bin/swift-frontend+0x55f9b8)
#23 0x00000000004b2529 main (/usr/share/swift/usr/bin/swift-frontend+0x4b2529)
#24 0x00007f7605e6013a __libc_start_main (/lib64/libc.so.6+0x2113a)
#25 0x00000000004b218a _start (/usr/share/swift/usr/bin/swift-frontend+0x4b218a)
[1/3] Compiling CMustache mustach.c
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: build.ShellError(terminationStatus: 1)
Current stack trace:
0 libswiftCore.so 0x00007f3056649ea0 swift_reportError + 50
1 libswiftCore.so 0x00007f30566c2360 _swift_stdlib_reportFatalErrorInFile + 109
2 libswiftCore.so 0x00007f30563cf8c2 + 1398978
3 libswiftCore.so 0x00007f30563cf5eb + 1398251
4 libswiftCore.so 0x00007f30563ce2d0 _assertionFailure(_:_:file:line:flags:) + 447
5 libswiftCore.so 0x00007f305642f080 swift_errorInMain + 731
6 build 0x0000563ea7e80347 + 9031
7 libc.so.6 0x00007f3055129050 __libc_start_main + 234
8 build 0x0000563ea7e800ba + 8378
make: *** [build] Illegal instruction
make: *** Deleting file `build'

To reproduce

Fresh instance of Amazon Linux 2
yum install clang
yum install llvm

Environment

uname -r:
5.10.75-79.358.amzn2.x86_64
Swift 5.5.1
git clone https://github.com/vapor/toolbox.git
git checkout main
cd toolbox
make install

I tried @rafikkasmi 's method of swift build -c release --disable-sandbox
it worked great, built with no errors
Hope this stack trace helps
I don't know why the markdown insists on putting a flag emoji where the word ":flags" should be.

@0xTim
Copy link
Member

0xTim commented Dec 20, 2021

I believe this is fixed in 5.5.2 - can anyone confirm? Just tried running in Docker and it successfully built for me

@MCF241
Copy link

MCF241 commented Jan 3, 2022

Hi i'm new to swift (more than roockie), but i face this issue trying to install VAPOR on a swift:5.5.2 docker container following the install (https://docs.vapor.codes/4.0/install/linux/).

Then i found a related page on the issue => https://eclecticlight.co/2019/02/02/scripting-in-swift-process-deprecations/

Edit /opt/toolbox/scripts/build.swift as launchPath() is deprecated and should be replaced by executableURL with following syntax for PATH:

// task.launchPath = "/usr/bin/env"
task.executableURL = URL(fileURLWithPath: "/usr/bin/env/")

launch() is deprecated, also, and should be replaced by run() with following syntax:
(Effectively run() require a try and the try require a 'do ... catch' sequence)

// task.launch()
do { try task.run() } catch { ...your code... }

As i'm a newby i didn't know what to insert in the catch sequence.
But after having modifying the scripts/build.swift script lines 48 and 60 for launchPath() and 50 & 69 for launch, i have got 👍

swiftc ./scripts/build.swift
./build
$ swift build --disable-sandbox --configuration release -Xswiftc -cross-module-optimization --enable-test-discovery
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
[3/3] Build complete!
rm ./build
sudo mv .build/release/vapor /usr/local/bin/vapor
sudo chmod 755 /usr/local/bin/vapor

and for the vapor help command:

vapor --help
Usage: vapor <command>

Vapor Toolbox (Server-side Swift web framework)

Commands:
       build Builds an app in the console.
       clean Cleans temporary files.
      heroku Commands for working with Heroku.
         new Generates a new app.
         run Runs an app from the console.
             Equivalent to `swift run --enable-test-discovery Run`.
  supervisor Commands for working with supervisord.
       xcode Opens an app in Xcode.

Use `vapor <command> [--help,-h]` for more information on a command.

Then:

  1. doing the hello install work
  2. swift run work (take a while)
root@c25010ba8205:/opt/apps/hello# swift run
[0/0] Build complete!
[ NOTICE ] Server starting on http://127.0.0.1:8080
[ INFO ] GET / [request-id: C97BA4CA-FB69-47BD-9357-8E4CCE65EF65]
  1. Tested with links2 and i got the It's work

Hope this can help

@0xTim
Copy link
Member

0xTim commented Jan 3, 2022

Going to close this as it appears fixed in 5.5.2 - feel free to reopen if it's still an issue

@0xTim 0xTim closed this as completed Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants