vapor / toolbox

Simplifies common command line tasks when using Vapor
MIT License
283 stars 85 forks source link

Issue building the toolbox on Arch #436

Closed bx2 closed 7 months ago

bx2 commented 7 months ago

I am following the tutorial available on https://www.swift.org/getting-started/vapor-web-server/. In order to install Vapor it asks me to follow build steps here: https://docs.vapor.codes/install/linux/#install-toolbox.

After cloning the repo and running make, the installation fails with the following error:

/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1392:64: error: value of optional type 'UnsafeMutablePointer<tm>?' must be unwrapped to a value of type 'UnsafeMutablePointer<tm>'
        strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime)
                                                               ^
/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1391:13: note: short-circuit using 'guard' to exit this function early if the optional value contains 'nil'
        let localTime = localtime(&timestamp)
            ^
        guard                                 else { return <#default value#> }
/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1391:25: note: coalesce using '??' to provide a default when the optional value contains 'nil'
        let localTime = localtime(&timestamp)
                        ^
                                              ?? <#default value#>
/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1391:25: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
        let localTime = localtime(&timestamp)
                        ^
                                             !
/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1392:64: note: coalesce using '??' to provide a default when the optional value contains 'nil'
        strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime)
                                                               ^
                                                                         ?? <#default value#>
/home/bx2/Projects/toolbox/.build/checkouts/swift-log/Sources/Logging/Logging.swift:1392:64: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
        strftime(&buffer, buffer.count, "%Y-%m-%dT%H:%M:%S%z", localTime)
                                                               ^
                                                                        !
error: fatalError
[6/15] Compiling Logging Locks.swift
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: build.ShellError(terminationStatus: 1)
Current stack trace:
0    libswiftCore.so                    0x00007f0a2d4a8000 _swift_stdlib_reportFatalErrorInFile + 109
1    libswiftCore.so                    0x00007f0a2d16cb35 <unavailable> + 1493813
2    libswiftCore.so                    0x00007f0a2d16c957 <unavailable> + 1493335
3    libswiftCore.so                    0x00007f0a2d16b8c0 _assertionFailure(_:_:file:line:flags:) + 342
4    libswiftCore.so                    0x00007f0a2d1d2a0c <unavailable> + 1911308
5    build                              0x00005583fa937167 <unavailable> + 8551
6    libc.so.6                          0x00007f0a2ba45cd0 <unavailable> + 163024
7    libc.so.6                          0x00007f0a2ba45d00 __libc_start_main + 138
8    build                              0x00005583fa936e55 <unavailable> + 7765

💣 Program crashed: Illegal instruction at 0x00007f0a2d16ba22

Thread 0 "build" crashed:

0 0x00007f0a2d16ba22 _assertionFailure(_:_:file:line:flags:) + 354 in libswiftCore.so
1 0x00007f0a2d1d2a0c swift_errorInMain + 619 in libswiftCore.so
2 0x00005583fa937167 main + 54 in build

To Reproduce

  1. git clone ...
  2. cd toolbox
  3. git checkout 18.7.4
  4. make install

The error appears after:

$ make install
swiftc ./scripts/build.swift
./build
$ swift build --disable-sandbox --configuration release -Xswiftc -cross-module-optimization
Building for production...
(error)

Expected behavior

I would expect it to build.

Environment

gwynne commented 7 months ago

Duplicate of #430