swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.74k stars 1.34k forks source link

Suppress repeating warnings/errors from repeating in `swift build` output when building swift package #7810

Closed valeriyvan closed 3 months ago

valeriyvan commented 3 months ago

Description

swift build output polluted with repeating same warning multiple times.

Expected behavior

Repeating warnings should be suppressed to improve output readability.

Actual behavior

Here's real life example where the same warning repeats 8 times:

swift build
[1/1] Compiling plugin GenerateManual
[2/2] Compiling plugin SwiftLintBuildToolPlugin
[3/3] Compiling plugin SwiftLintCommandPlugin
Building for debugging...
[3/25] Write sources
[6/25] Write geometrize-entitlement.plist
[6/25] Write sources
[8/25] Copying PrivacyInfo.xcprivacy
[13/25] Write sources
[20/25] Compiling _NumericsShims _NumericsShims.c
[21/25] Write swift-version--58304C5D6DBC2206.txt
[23/47] Emitting module ArgumentParserToolInfo
[24/47] Emitting module RealModule
[25/48] Compiling RealModule Float80+Real.swift
[26/48] Compiling RealModule ElementaryFunctions.swift
[27/48] Emitting module BaseDigits
[28/48] Compiling BaseDigits BaseDigits.swift
[29/48] Compiling RealModule Real.swift
[30/48] Compiling RealModule AlgebraicField.swift
[31/48] Compiling RealModule ApproximateEquality.swift
[32/48] Compiling RealModule AugmentedArithmetic.swift
[33/48] Compiling RealModule Double+Real.swift
[34/48] Compiling RealModule Float+Real.swift
[35/48] Compiling RealModule Float16+Real.swift
[36/48] Compiling RealModule RealFunctions.swift
[37/78] Compiling SwiftJPEG debug.swift
[38/79] Compiling Base16 Base16.swift
[39/79] Compiling Base16 Base16.Values.swift
[40/79] Compiling Base16 Base16.UppercaseDigits.swift
[41/79] Compiling Base16 Base16.LowercaseDigits.swift
[42/79] Emitting module Base16
[43/81] Emitting module SwiftJPEG
[44/81] Compiling SwiftJPEG error.swift
[45/81] Compiling ArgumentParserToolInfo ToolInfo.swift
[46/81] Compiling CRC CRC32.swift
[47/81] Emitting module CRC
[48/81] Compiling SwiftJPEG common.swift
[49/171] Compiling LZ77 LZ77.DeflatorWindow.Element.swift
[50/171] Compiling LZ77 LZ77.DeflatorWindow.swift
[51/171] Compiling LZ77 Gzip.Format.swift
[52/171] Compiling LZ77 Gzip.Inflator.swift
[53/171] Compiling LZ77 LZ77.Codeword.swift
[54/171] Compiling LZ77 F14.District.Index.swift
[55/171] Compiling LZ77 F14.District.swift
[56/174] Compiling SwiftJPEG os.swift
[59/174] Compiling LZ77 Gzip.InflatorState.swift
[60/174] Compiling LZ77 Gzip.StreamHeader.swift
[61/174] Compiling LZ77 Gzip.StreamHeaderError.swift
[62/174] Compiling LZ77 Gzip.swift
[64/181] Compiling LZ77 LZ77.DeflatorTables.swift
[65/181] Compiling LZ77 LZ77.DeflatorTerm.Meta.swift
[66/181] Compiling LZ77 LZ77.DeflatorTerm.swift
[67/181] Compiling LZ77 LZ77.Distance.swift
[68/181] Compiling LZ77 LZ77.Heap.swift
[69/181] Compiling LZ77 LZ77.HuffmanPattern.swift
[70/181] Compiling LZ77 LZ77.HuffmanTree.swift
[71/181] Compiling Algorithms Trim.swift
[72/181] Compiling Algorithms Unique.swift
[73/181] Compiling Algorithms Windows.swift
[79/181] Compiling LZ77 FixedWidthInteger (ext).swift
[80/181] Compiling LZ77 Gzip.Deflator.swift
[81/181] Compiling LZ77 Gzip.Format.Integral.swift
[82/181] Compiling LZ77 LZ77.InflatorIn.swift
[83/181] Compiling LZ77 LZ77.InflatorOut.swift
[84/181] Compiling LZ77 LZ77.InflatorState.swift
[85/181] Compiling LZ77 LZ77.InflatorTables.swift
[86/181] Compiling LZ77 LZ77.StreamHeader.swift
[87/181] Compiling LZ77 LZ77.StreamHeaderError.swift
[88/181] Compiling LZ77 LZ77.Composites.swift
[89/181] Compiling LZ77 LZ77.BlockShape.swift
[90/181] Compiling LZ77 LZ77.BlockState.swift
[91/181] Compiling LZ77 LZ77.BlockType.swift
[92/181] Compiling LZ77 LZ77.DecompressionError.swift
[93/181] Compiling LZ77 LZ77.Inflator.swift
[94/181] Compiling LZ77 LZ77.InflatorBuffers.Stream.swift
[95/181] Compiling LZ77 LZ77.InflatorBuffers.swift
[96/181] Compiling LZ77 LZ77.Reversed.swift
[97/181] Compiling LZ77 LZ77.swift
[98/181] Compiling LZ77 SIMD16 (ext).swift
[99/181] Compiling LZ77 LZ77.Format.swift
[100/181] Compiling LZ77 LZ77.FormatType.swift
[101/181] Compiling LZ77 LZ77.MRC32.swift
[102/181] Compiling LZ77 LZ77.StreamIntegral.swift
[103/181] Compiling SwiftJPEG metadata.swift
[104/181] Emitting module LZ77
[105/181] Compiling LZ77 LZ77.Decades.swift
[106/181] Compiling LZ77 LZ77.Deflator.swift
[107/181] Compiling LZ77 LZ77.DeflatorBuffers.Stream.swift
[108/181] Compiling LZ77 LZ77.DeflatorBuffers.swift
[109/181] Compiling LZ77 LZ77.DeflatorDicing.Node.swift
[110/181] Compiling LZ77 LZ77.DeflatorDicing.swift
[111/181] Compiling LZ77 LZ77.DeflatorIn.swift
[112/181] Compiling LZ77 LZ77.DeflatorMatches.Depths.swift
[113/181] Compiling SwiftJPEG jpeg.swift
[114/181] Compiling LZ77 LZ77.DeflatorMatches.swift
[115/181] Compiling LZ77 LZ77.DeflatorOut.swift
[116/181] Compiling LZ77 LZ77.DeflatorSearch.swift
[121/181] Compiling LZ77 LZ77.Metaword.swift
[122/181] Compiling LZ77 LZ77.RunLiteral.swift
[123/181] Compiling LZ77 LZ77.BlockMetadata.swift
[124/181] Emitting module Algorithms
[125/181] Compiling SwiftJPEG encode.swift
[126/222] Compiling Geometrize BitmapExporter.swift
[127/222] Compiling Geometrize Bounds.swift
[128/222] Compiling Geometrize Line.swift
[129/222] Compiling Geometrize Polyline.swift
[130/222] Compiling Geometrize QuadraticBezier.swift
[131/227] Emitting module ArgumentParser
[132/227] Compiling Geometrize Point.swift
[133/227] Compiling Geometrize BinaryInteger.swift
[134/227] Compiling Geometrize Bitmap+UIImage.swift
[135/227] Compiling Geometrize Bitmap.swift
[136/227] Compiling Geometrize BitmapDifference.swift
[137/227] Compiling Geometrize GeometrizingSequence.swift
[138/227] Compiling Geometrize HillClimb.swift
[139/227] Compiling Geometrize ImageGrigRunner.swift
[140/227] Compiling Geometrize ImageRunner.swift
[141/227] Compiling Geometrize Int_random.swift
[142/227] Compiling Geometrize String-ShapeType.swift
[143/227] Compiling Geometrize Triangle.swift
[144/227] Compiling Geometrize allShapeTypes.swift
[145/227] Compiling Geometrize Polygon.swift
[146/227] Compiling Geometrize Rgba.swift
[147/227] Compiling ArgumentParser CollectionExtensions.swift
[148/227] Compiling ArgumentParser Platform.swift
[149/227] Compiling ArgumentParser SequenceExtensions.swift
[150/227] Compiling ArgumentParser StringExtensions.swift
[151/227] Compiling ArgumentParser Tree.swift
[167/271] Compiling SwiftJPEG decode.swift
[168/271] Compiling PNG PNG.Chunk.swift
[169/271] Compiling PNG PNG.LexingError.swift
[170/271] Compiling PNG PNG.Error.swift
[171/271] Compiling PNG PNG.Image.swift
[172/271] Compiling PNG PNG.swift
[173/271] Compiling PNG PNG.Layout.swift
[174/271] Compiling PNG General.swift
[175/271] Compiling PNG LZ77.DecompressionError (ext).swift
[176/271] Compiling PNG LZ77.DeflateHeaderError (ext).swift
[177/271] Compiling PNG PNG.BytestreamDestination.swift
[178/271] Compiling PNG PNG.BytestreamSource.swift
[179/271] Compiling PNG PNG.Background.Case.swift
[180/271] Compiling PNG PNG.Background.swift
[181/271] Compiling PNG PNG.Chromaticity.swift
[182/271] Compiling PNG PNG.ColorProfile.swift
[183/271] Compiling PNG PNG.ColorRendering.swift
[184/271] Emitting module PNG
[185/277] Compiling PNG PNG.DecodingError.swift
[186/277] Compiling PNG PNG.Metadata.swift
[187/277] Compiling PNG PNG.Standard.swift
[188/277] Compiling PNG PNG.Encoder.Pass.swift
[189/277] Compiling PNG PNG.Encoder.swift
[190/277] Compiling PNG PNG.FormattingError.swift
[191/277] Compiling PNG PNG.PhysicalDimensions.swift
[192/277] Compiling PNG PNG.SignificantBits.Case.swift
[193/277] Compiling PNG PNG.SignificantBits.swift
[194/277] Compiling PNG PNG.SuggestedPalette.Entries.swift
[195/277] Compiling PNG PNG.SuggestedPalette.swift
[196/277] Compiling PNG PNG.Text.swift
[203/277] Compiling PNG PNG.Gamma.swift
[204/277] Compiling PNG PNG.Header.swift
[205/277] Compiling PNG PNG.Histogram.swift
[206/277] Compiling PNG PNG.Palette.swift
[207/277] Compiling PNG PNG.ParsingError.swift
[208/277] Compiling PNG PNG.Percentmille.swift
[209/277] Compiling PNG PNG.TimeModified.swift
[210/277] Compiling PNG PNG.Transparency.Case.swift
[211/277] Compiling PNG PNG.Transparency.swift
[212/277] Compiling PNG System.swift
[213/277] Compiling PNG UnsafeMutableBufferPointer (ext).swift
[214/277] Compiling PNG __Entrypoint.swift
[221/282] Emitting module Geometrize
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
[222/282] Compiling PNG Array (ext).swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[223/282] Compiling PNG ArraySlice (ext).swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[224/282] Compiling PNG PNG.Color.swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[225/282] Compiling PNG PNG.RGBA.swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[226/282] Compiling PNG PNG.VA.swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[227/282] Compiling PNG PNG.Context.swift
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: warning: var '_randomImplementationReference' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: isolate '_randomImplementationReference' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'
var _randomImplementationReference = _randomImplementation
    ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:18:9: warning: reference to var '_randomImplementationReference' is not concurrency-safe because it involves shared mutable state; this is an error in Swift 6
        _randomImplementationReference(range, &generator)
        ^
/Users/*****/geometrize/swift-geometrize/Sources/geometrize/Int_random.swift:7:5: note: var declared here
var _randomImplementationReference = _randomImplementation
    ^
[234/282] Compiling PNG PNG.Format.Pixel.swift
[235/282] Compiling PNG PNG.Format.swift
[244/282] Compiling PNG PNG.Decoder.swift
[257/282] Compiling Geometrize SplitMix64.swift
[258/282] Compiling Geometrize State.swift
[259/282] Compiling Geometrize bresenham.swift
[260/282] Compiling Geometrize mapShapeBoundsToImage.swift
[261/282] Compiling Geometrize resource_bundle_accessor.swift
[280/289] Compiling BitmapImportExport resource_bundle_accessor.swift
[281/289] Compiling BitmapImportExport JPEG.Data.Rectangular.swift
[282/289] Compiling BitmapImportExport SourceStream.swift
[283/289] Compiling BitmapImportExport Bitmap+PNG.swift
/Users/*****/geometrize/swift-geometrize/.build/checkouts/swift-png/Sources/PNG/Lexing/PNG.Chunk.swift:94:13: warning: static property 'CgBI' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
        let CgBI:Self = .init(unchecked: 0x43_67_42_49)
            ^
/Users/*****/geometrize/swift-geometrize/.build/checkouts/swift-png/Sources/PNG/Lexing/PNG.Chunk.swift:99:13: warning: static property 'IHDR' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
        let IHDR:Self = .init(unchecked: 0x49_48_44_52)
            ^
/Users/*****/geometrize/swift-geometrize/.build/checkouts/swift-png/Sources/PNG/Lexing/PNG.Chunk.swift:104:13: warning: static property 'PLTE' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
        let PLTE:Self = .init(unchecked: 0x50_4c_54_45)
            ^
/Users/*****/geometrize/swift-geometrize/.build/checkouts/swift-png/Sources/PNG/Lexing/PNG.Chunk.swift:109:13: warning: static property 'IDAT' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
        let IDAT:Self = .init(unchecked: 0x49_44_41_54)
            ^
/Users/*****/geometrize/swift-geometrize/.build/checkouts/swift-png/Sources/PNG/Lexing/PNG.Chunk.swift:114:13: warning: static property 'IEND' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
        let IEND:Self = .init(unchecked: 0x49_45_4e_44)
            ^
[284/289] Compiling BitmapImportExport DestinationStream.swift
[285/289] Emitting module BitmapImportExport
[286/289] Compiling BitmapImportExport Bitmap+JPEG.swift
[287/292] Emitting module geometrize_cli
[288/292] Compiling geometrize_cli main.swift
[289/292] Compiling geometrize_cli resource_bundle_accessor.swift
[289/292] Write Objects.LinkFileList
[290/292] Linking geometrize
[291/292] Applying geometrize
Build complete! (15.78s)

Steps to reproduce

  1. git clone --single-branch --branch warnings-showcase git@github.com:valeriyvan/swift-geometrize.git
  2. cd swift-geometrize
  3. swift build

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.10.0-dev

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Darwin VV-LIN-MBP.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64
MaxDesiatov commented 3 months ago

Duplicate of swiftlang/swift-driver#1669.