Skip to content

"swift build" command duplicates error messages #1387

Open
@Stiivi

Description

@Stiivi

Description
swift build command prints the same error multiple times. Example output:

% swift build
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:9: error: consecutive statements on a line must be separated by ';'
let this is error
        ^
        ;
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:10: error: expected expression
let this is error
         ^
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:5: error: type annotation missing in pattern
let this is error
    ^
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:9: error: consecutive statements on a line must be separated by ';'
let this is error
        ^
        ;
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:10: error: expected expression
let this is error
         ^
/home/stefan/Dupe/Sources/Dupe/Dupe.swift:4:5: error: type annotation missing in pattern
let this is error
    ^
error: fatalError

EDIT: In one of my projects (can't share the source) the error has been duplicated 16 times.

Steps to reproduce

  1. Create a new package:
    • mkdir Dupe
    • cd Dupe
    • swift package init
  2. Create an erroneous source file:
    • echo "let this is error" > Sources/Dupe/Dupe.swift
  3. Run swift build

Expected behavior

Each error is displayed only once.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions