The Swift Package Index logo.Swift Package Index

Build Information

Failed to build Logic Parser with Swift 5.9 for Linux.

Build Command

docker run --rm -v "checkouts-4609320-1":/host -w "/host/spi-builder-workspace" registry.gitlab.com/finestructure/spi-images:basic-5.9-latest swift build 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.19.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/Gerzer/LogicParser.git
Reference: main
Cloned https://github.com/Gerzer/LogicParser.git into spi-builder-workspace
SUCCESS checkout https://github.com/Gerzer/LogicParser.git at main
========================================
Build
========================================
Selected platform:         linux
Swift version:             5.9
Building package at path:  spi-builder-workspace
Running build ...
docker run --rm -v "checkouts-4609320-1":/host -w "/host/spi-builder-workspace" registry.gitlab.com/finestructure/spi-images:basic-5.9-latest swift build 2>&1
Fetching https://github.com/palle-k/Covfefe.git
[1/2438] Fetching covfefe
Fetched https://github.com/palle-k/Covfefe.git (0.39s)
Computing version for https://github.com/palle-k/Covfefe.git
Computed https://github.com/palle-k/Covfefe.git at 0.6.1 (0.29s)
Creating working copy for https://github.com/palle-k/Covfefe.git
Working copy of https://github.com/palle-k/Covfefe.git resolved at 0.6.1
Building for debugging...
[1/17] Emitting module Covfefe
[2/19] Compiling Covfefe Tokenizer.swift
[3/19] Compiling Covfefe Utility.swift
[4/19] Compiling Covfefe Normalization.swift
[5/19] Compiling Covfefe Parser.swift
[6/19] Compiling Covfefe PrefixGrammar.swift
[7/19] Compiling Covfefe Productions.swift
[8/19] Compiling Covfefe Grammar.swift
[9/19] Compiling Covfefe GrammarCheck.swift
error: compile command failed due to signal 6 (use -v to see invocation)
[10/19] Compiling Covfefe StringUtility.swift
[11/19] Compiling Covfefe Symbols.swift
[12/19] Compiling Covfefe SyntaxTree.swift
[13/19] Compiling Covfefe Terminal.swift
/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:468:22: error: member 'terminal' expects argument of type 'Terminal'
                                                if case .some(.terminal) = production.production.first {
                                                               ^
swift-frontend: /home/build-user/swift/lib/Sema/TypeCheckPattern.cpp:767: swift::ExprPatternMatchResult swift::ExprPatternMatchRequest::evaluate(swift::Evaluator &, const swift::ExprPattern *) const: Assertion `EP->isResolved() && "Must only be queried once resolved"' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /usr/bin/swift-frontend -frontend -c /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/ABNFImporter.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/BNFImporter.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/CYKParser.swift -primary-file /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/CharacterSets.swift -primary-file /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EBNFImporter.swift -primary-file /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Grammar.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/GrammarCheck.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Normalization.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Parser.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/PrefixGrammar.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Productions.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/StringUtility.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Symbols.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/SyntaxTree.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Terminal.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Tokenizer.swift /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/Utility.swift -supplementary-output-file-map /tmp/TemporaryDirectory.1Tpcit/supplementaryOutputs-2 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug -enable-testing -g -module-cache-path /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -suppress-warnings -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /usr/bin/swift-driver -empty-abi-descriptor -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins -resource-dir /usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fPIC -module-name Covfefe -parse-as-library -o /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug/Covfefe.build/CharacterSets.swift.o -o /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug/Covfefe.build/EBNFImporter.swift.o -o /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug/Covfefe.build/EarleyParser.swift.o -index-store-path /host/spi-builder-workspace/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules
1.	Swift version 5.9-dev (LLVM 464b04eb9b157e3, Swift 7203d52cb1e074d)
2.	Compiling with the current language version
3.	While evaluating request TypeCheckSourceFileRequest(source_file "/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift")
4.	While evaluating request TypeCheckFunctionBodyRequest(Covfefe.(file).EarleyParser.parse@/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:404:15)
5.	While type-checking statement at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:404:123 - line:508:2] RangeText="{
		//TODO: Better support for right recursion
		
		let nonTerminalProductions = Dictionary(grouping: grammar.productions, by: {$0.pattern})
		
		// The start state contains all productions which can be reached directly from the starting non terminal
		let initState = nonTerminalProductions[grammar.start, default: []].map({ (production) -> ParseStateItem in
			ParseStateItem(production: production, productionPosition: 0, startTokenIndex: 0)
		}).collect(Set.init).collect { initState in
			processState(productions: nonTerminalProductions, allStates: [], knownItems: initState, newItems: initState)
		}
		
		var tokenization: [[(terminal: Terminal, range: Range<String.Index>)]] = []
		tokenization.reserveCapacity(string.count)
		
		var stateCollection: [Set<ParseStateItem>] = [initState]
		stateCollection.reserveCapacity(string.count + 1)
		
		var currentIndex = string.startIndex
		
		// Tokenize string while parsing it
		while currentIndex < string.endIndex {
			let lastState = stateCollection.last!
			
			// Collect all terminals which could occur at the current location according to the grammar
			let expectedTerminals = Dictionary(
				grouping: lastState.compactMap { item -> (item: ParseStateItem, terminal: Terminal)? in
					guard case .some(.terminal(let terminal)) = item.nextSymbol else {
						return nil
					}
					return (item: item, terminal: terminal)
				},
				by: { pair in
					pair.terminal
				}
			).mapValues { pairs in
				pairs.map { pair in
					pair.item
				}
			}
			
			// Find the tokens which match the string
			let (newItems, tokens): ([[ParseStateItem]], [(terminal: Terminal, range: Range<String.Index>)]) =
				expectedTerminals.compactMap { (terminal, items) -> ([ParseStateItem], (terminal: Terminal, range: Range<String.Index>))? in
					guard let range = string.rangeOfPrefix(terminal, from: currentIndex), range.lowerBound == currentIndex else {
						return nil
					}
					return (items.map{$0.advanced()}, (terminal, range))
				}.collect(unzip)
			
			// Check if tokens have been found. Report a syntax error if none have been found
			guard !newItems.isEmpty else {
				// Find non terminals which are expected at the current location
				let context = lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				}
				throw SyntaxError(
					range: currentIndex ..< string.index(after: currentIndex),
					in: string,
					reason: context.isEmpty ? .unexpectedToken : .unmatchedPattern,
					context: context
				)
			}
			
			let newItemSet = newItems.flatMap{$0}.collect(Set.init)
			
			tokenization.append(tokens)
			stateCollection.append(
				processState(
					productions: nonTerminalProductions,
					allStates: stateCollection,
					knownItems: newItemSet,
					newItems: newItemSet
				)
			)
			
			currentIndex = tokens.first!.range.upperBound
		}
		
		// Find all successfully parsed Earley items
		let parseStates = stateCollection.enumerated().reduce(Array<Set<ParsedItem>>(repeating: [], count: stateCollection.count)) { (parseStates, element) in
			let (index, state) = element
			let completed = state.filter {$0.isCompleted}
			return completed.reduce(into: parseStates) { (parseStates, item) in
				parseStates[item.startTokenIndex].insert(ParsedItem(production: item.production, completedIndex: index))
			}
		}
		
		return (parseStates, tokenization)
	"
6.	While type-checking statement at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:425:3 - line:496:3] RangeText="while currentIndex < string.endIndex {
			let lastState = stateCollection.last!
			
			// Collect all terminals which could occur at the current location according to the grammar
			let expectedTerminals = Dictionary(
				grouping: lastState.compactMap { item -> (item: ParseStateItem, terminal: Terminal)? in
					guard case .some(.terminal(let terminal)) = item.nextSymbol else {
						return nil
					}
					return (item: item, terminal: terminal)
				},
				by: { pair in
					pair.terminal
				}
			).mapValues { pairs in
				pairs.map { pair in
					pair.item
				}
			}
			
			// Find the tokens which match the string
			let (newItems, tokens): ([[ParseStateItem]], [(terminal: Terminal, range: Range<String.Index>)]) =
				expectedTerminals.compactMap { (terminal, items) -> ([ParseStateItem], (terminal: Terminal, range: Range<String.Index>))? in
					guard let range = string.rangeOfPrefix(terminal, from: currentIndex), range.lowerBound == currentIndex else {
						return nil
					}
					return (items.map{$0.advanced()}, (terminal, range))
				}.collect(unzip)
			
			// Check if tokens have been found. Report a syntax error if none have been found
			guard !newItems.isEmpty else {
				// Find non terminals which are expected at the current location
				let context = lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				}
				throw SyntaxError(
					range: currentIndex ..< string.index(after: currentIndex),
					in: string,
					reason: context.isEmpty ? .unexpectedToken : .unmatchedPattern,
					context: context
				)
			}
			
			let newItemSet = newItems.flatMap{$0}.collect(Set.init)
			
			tokenization.append(tokens)
			stateCollection.append(
				processState(
					productions: nonTerminalProductions,
					allStates: stateCollection,
					knownItems: newItemSet,
					newItems: newItemSet
				)
			)
			
			currentIndex = tokens.first!.range.upperBound
		"
7.	While type-checking statement at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:425:40 - line:496:3] RangeText="{
			let lastState = stateCollection.last!
			
			// Collect all terminals which could occur at the current location according to the grammar
			let expectedTerminals = Dictionary(
				grouping: lastState.compactMap { item -> (item: ParseStateItem, terminal: Terminal)? in
					guard case .some(.terminal(let terminal)) = item.nextSymbol else {
						return nil
					}
					return (item: item, terminal: terminal)
				},
				by: { pair in
					pair.terminal
				}
			).mapValues { pairs in
				pairs.map { pair in
					pair.item
				}
			}
			
			// Find the tokens which match the string
			let (newItems, tokens): ([[ParseStateItem]], [(terminal: Terminal, range: Range<String.Index>)]) =
				expectedTerminals.compactMap { (terminal, items) -> ([ParseStateItem], (terminal: Terminal, range: Range<String.Index>))? in
					guard let range = string.rangeOfPrefix(terminal, from: currentIndex), range.lowerBound == currentIndex else {
						return nil
					}
					return (items.map{$0.advanced()}, (terminal, range))
				}.collect(unzip)
			
			// Check if tokens have been found. Report a syntax error if none have been found
			guard !newItems.isEmpty else {
				// Find non terminals which are expected at the current location
				let context = lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				}
				throw SyntaxError(
					range: currentIndex ..< string.index(after: currentIndex),
					in: string,
					reason: context.isEmpty ? .unexpectedToken : .unmatchedPattern,
					context: context
				)
			}
			
			let newItemSet = newItems.flatMap{$0}.collect(Set.init)
			
			tokenization.append(tokens)
			stateCollection.append(
				processState(
					productions: nonTerminalProductions,
					allStates: stateCollection,
					knownItems: newItemSet,
					newItems: newItemSet
				)
			)
			
			currentIndex = tokens.first!.range.upperBound
		"
8.	While type-checking statement at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:455:4 - line:481:4] RangeText="guard !newItems.isEmpty else {
				// Find non terminals which are expected at the current location
				let context = lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				}
				throw SyntaxError(
					range: currentIndex ..< string.index(after: currentIndex),
					in: string,
					reason: context.isEmpty ? .unexpectedToken : .unmatchedPattern,
					context: context
				)
			"
9.	While type-checking statement at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:455:33 - line:481:4] RangeText="{
				// Find non terminals which are expected at the current location
				let context = lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				}
				throw SyntaxError(
					range: currentIndex ..< string.index(after: currentIndex),
					in: string,
					reason: context.isEmpty ? .unexpectedToken : .unmatchedPattern,
					context: context
				)
			"
10.	While type-checking declaration 0xd17fbd0 (at /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:457:5)
11.	While evaluating request PatternBindingEntryRequest((unknown decl), 0, 0)
12.	While type-checking expression at [/host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:457:19 - line:474:5] RangeText="lastState.compactMap { item -> NonTerminal? in
					switch item.nextSymbol {
					case .none:
						return nil
					case .some(.terminal):
						return nil
					case .some(.nonTerminal(let nonTerminal)):
						return nonTerminal
					}
				}.filter { nonTerminal -> Bool in
					nonTerminalProductions[nonTerminal, default: []].contains(where: { production -> Bool in
						if case .some(.terminal) = production.production.first {
							return true
						} else {
							return false
						}
					})
				"
13.	While type-checking-target starting at /host/spi-builder-workspace/.build/checkouts/Covfefe/Sources/Covfefe/EarleyParser.swift:466:7
14.	While evaluating request ExprPatternMatchRequest((pattern @ 0xd17f828))
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[0x6b367f3]
/usr/bin/swift-frontend[0x6b3440e]
/usr/bin/swift-frontend[0x6b36b5f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7f1a1b1ed420]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f1a1a63400b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f1a1a613859]
/lib/x86_64-linux-gnu/libc.so.6(+0x22729)[0x7f1a1a613729]
/lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f1a1a624fd6]
/usr/bin/swift-frontend[0x1b7eac8]
/usr/bin/swift-frontend[0x21c1933]
/usr/bin/swift-frontend[0x21c16a5]
/usr/bin/swift-frontend[0x21c05f0]
/usr/bin/swift-frontend[0x21c05b8]
/usr/bin/swift-frontend[0x1a42a5b]
/usr/bin/swift-frontend[0x1c9c581]
/usr/bin/swift-frontend[0x1c9b11d]
/usr/bin/swift-frontend[0x1c99f0f]
/usr/bin/swift-frontend[0x1c99b2b]
/usr/bin/swift-frontend[0x1c5233f]
/usr/bin/swift-frontend[0x1ae74b6]
/usr/bin/swift-frontend[0x1ae72dd]
/usr/bin/swift-frontend[0x1ae8be8]
/usr/bin/swift-frontend[0x1ae8f5a]
/usr/bin/swift-frontend[0x1bf96c3]
/usr/bin/swift-frontend[0x1b10895]
/usr/bin/swift-frontend[0x1b10629]
/usr/bin/swift-frontend[0x1afbc8b]
/usr/bin/swift-frontend[0x1b3734e]
/usr/bin/swift-frontend[0x1b32e48]
/usr/bin/swift-frontend[0x1b32cd1]
/usr/bin/swift-frontend[0x1beffcc]
/usr/bin/swift-frontend[0x1bede5c]
/usr/bin/swift-frontend[0x1bf03bb]
/usr/bin/swift-frontend[0x1beff1c]
/usr/bin/swift-frontend[0x1bec4ed]
/usr/bin/swift-frontend[0x1beffcc]
/usr/bin/swift-frontend[0x1beff1c]
/usr/bin/swift-frontend[0x1bf0389]
/usr/bin/swift-frontend[0x1beff1c]
/usr/bin/swift-frontend[0x1bec4ed]
/usr/bin/swift-frontend[0x1beffcc]
/usr/bin/swift-frontend[0x1bede5c]
/usr/bin/swift-frontend[0x1bed292]
/usr/bin/swift-frontend[0x2098a28]
/usr/bin/swift-frontend[0x20987b9]
/usr/bin/swift-frontend[0x1fec7bb]
/usr/bin/swift-frontend[0x1fec76d]
/usr/bin/swift-frontend[0x1c32d73]
/usr/bin/swift-frontend[0x1c35959]
/usr/bin/swift-frontend[0x1c35705]
/usr/bin/swift-frontend[0x1c32a98]
/usr/bin/swift-frontend[0x1c32a74]
/usr/bin/swift-frontend[0x909fa9]
/usr/bin/swift-frontend[0x8ffeca]
/usr/bin/swift-frontend[0x8ffe67]
/usr/bin/swift-frontend[0x67b3ee]
/usr/bin/swift-frontend[0x6684a2]
/usr/bin/swift-frontend[0x4c43d1]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f1a1a615083]
/usr/bin/swift-frontend[0x4c3b1e]
BUILD FAILURE 5.9 linux

Build Machine: Linux 2