yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.3k stars 123 forks source link

Running (or rather, building) swiftlint 0.50.0-rc.1 fails #250

Closed gereons closed 2 years ago

gereons commented 2 years ago

Running mint run swiftlint fails:

mint run swiftlint 🌱 Finding latest version of swiftlint 🌱 Cloning swiftlint 0.50.0-rc.1 🌱 Resolving package 🌱 Building package Compiling plugin SwiftLintPlugin... Building for production... [0/13] Compiling Clang_C Clang_C.c [1/13] Compiling SourceKit SourceKit.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimization[2/15] Compiling reader.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[3/16] Compiling parser.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[4/16] Compiling api.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[5/17] Compiling writer.c [7/18] Compiling CollectionConcurrencyKit CollectionConcurrencyKit.swift [7/18] Compiling emitter.c [8/18] Compiling scanner.c remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[10/19] Compiling ArgumentParserToolInfo ToolInfo.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[11/20] Compiling SwiftyTextTable TextTable.swift [12/20] Compiling SWXMLHash XMLAttributeDeserializable.swift [13/20] Compiling Yams Constructor.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[14/21] Compiling ArgumentParser BashCompletionsGenerator.swift [15/21] Compiling SourceKittenFramework ByteCount.swift [16/21] Compiling SwiftSyntax AbsolutePosition.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimization[16/23] Archiving libSwiftSyntax.a [18/23] Compiling SwiftDiagnostics Diagnostic.swift [19/23] Compiling SwiftBasicFormat Trivia+Indented.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[20/24] Compiling SwiftParser Attributes.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimization[20/26] Archiving libSwiftParser.a [22/26] Compiling SwiftOperators Operator.swift [22/26] Archiving libSwiftOperators.a [24/26] Compiling SwiftSyntaxBuilder BuildBuildable.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimization[24/27] Archiving libSwiftSyntaxBuilder.a [26/27] Compiling SwiftLintFramework RuleDocumentation.swift remark: Incremental compilation has been disabled: it is not compatible with whole module optimizationremark: Incremental compilation has been disabled: it is not compatible with whole module optimization[27/29] Compiling swiftlint Analyze.swift [28/29] Compiling SwiftLintTestHelpers RuleDescription+Examples.swift /private/var/folders/1p/wpwdypm96_s5zfwxxzvwwp0m0000gn/T/mint/github.com_realm_swiftlint/Tests/SwiftLintTestHelpers/TestHelpers.swift:3:18: error: module 'SwiftLintFramework' was not compiled for testing

@testable import SwiftLintFramework
~~~~~~~~~~       ^
swift_driver/main.swift:42: Fatal error: Invalid state, could not kill process
[28/29] Linking swiftlint
🌱 Encountered error during "swift build -c release -Xswiftc -target -Xswiftc arm64-apple-macosx12.6". Use --verbose to see full output
🌱  Failed to build swiftlint 0.50.0-rc.1 with SPM

This was reported in the swiftlint repo as https://github.com/realm/SwiftLint/issues/4341 and the solution appears to be to add additional parameters (--product swiftlint) to the compiler invocation.

Is there a way to do this in mint?

417-72KI commented 2 years ago

I tried to apply the solution on build command inside Mint, and seems to be fine 😊. https://github.com/yonaskolb/Mint/pull/251

mthole commented 2 years ago

The above solution worked for me as well. @yonaskolb , would it be possible to get a release out with this fix?

acosmicflamingo commented 2 years ago

Getting a release with that fix would be great indeed :D

yonaskolb commented 2 years ago

Released in 0.17.3