swift icon indicating copy to clipboard operation
swift copied to clipboard

Building `stdlib/public/Backtracing/Backtrace.swift` fails

Open AnthonyLatsis opened this issue 2 years ago • 5 comments

Description

Command:

utils/build-script --skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs="$(uname -m)" --release-debuginfo --sccache --swift-disable-dead-stripping --skip-early-swift-driver --bootstrapping=off

Error:

/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:479:21: error: expected a macro identifier for a pound literal expression
    let mapRegex = #/
                    ^
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:479:21: error: consecutive statements on a line must be separated by ';'
    let mapRegex = #/
                    ^
                    ;
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:479:21: error: operator with postfix spacing cannot start a subexpression
    let mapRegex = #/
                    ^
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:480:49: error: consecutive statements on a line must be separated by ';'
    ^(?<start>[A-Fa-f0-9]+)-(?<end>[A-Fa-f0-9]+)\s+
                                                ^
                                                ;
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:481:22: error: expected ',' separator
    (?<perms>[-rwxsp]{4})\s+
                     ^
                     ,
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:481:26: error: consecutive statements on a line must be separated by ';'
    (?<perms>[-rwxsp]{4})\s+
                         ^
                         ;
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:482:28: error: consecutive statements on a line must be separated by ';'
    (?<offset>[A-Fa-f0-9]+)\s+
                           ^
                           ;
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:483:27: error: consecutive statements on a line must be separated by ';'
    (?<major>[A-Fa-f0-9]+):(?<minor>[A-Fa-f0-9]+)\s+
                          ^
                          ;
/Users/mac/Desktop/swift-project/swift/stdlib/public/Backtracing/Backtrace.swift:483:27: error: expected expression
    (?<major>[A-Fa-f0-9]+):(?<minor>[A-Fa-f0-9]+)\s+
                          ^

Environment

  • Swift version 5.9-dev (LLVM d638e0929fa87b0, Swift 23e2f345b51ca0c)

AnthonyLatsis avatar Jun 08 '23 17:06 AnthonyLatsis

It seems like --bootstrapping=off is no longer a valid option (or it should cause building of the Backtracing module to be skipped if possible).

AnthonyLatsis avatar Jun 08 '23 17:06 AnthonyLatsis

@al45tair is working on a fix for this. The Backtracing module doesn't technically need to use a regex here.

tbkka avatar Jun 08 '23 18:06 tbkka

That's in #66449, FWIW. I hadn't appreciated when I wrote that code that it would cause this problem, but it's easy to fix.

al45tair avatar Jun 09 '23 07:06 al45tair

Should be fixed on main. I'll cherry pick the fix to 5.9 as well.

al45tair avatar Jun 09 '23 07:06 al45tair

Cherry pick to 5.9 is #66485.

al45tair avatar Jun 09 '23 07:06 al45tair