[SR-6368] swift build
fetch log is printed after compile log when output is redirected
#4919
Labels
swift build
fetch log is printed after compile log when output is redirected
#4919
Environment
macOS Sierra 10.12.6
Xcode9.0
Additional Detail from JIRA
md5: 9d61f2f5913c0019495d6209d1e22d2a
Issue Description:
With this `Package.swift`, `swift build` output normally this.
```
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SwiftPMClient",
dependencies: [
.package(url: "https://github.com/jpsim/Yams.git", .exact("0.5.0"))
],
targets: [
.target(name: "SwiftPMClient",
dependencies: ["Yams"]),
]
)
```
```
$ rm -rf .build
$ swift build
Fetching https://github.com/jpsim/Yams.git
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 0.5.0
Compile CYaml src/writer.c
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/api.c
Compile Swift Module 'Yams' (15 sources)
Compile Swift Module 'SwiftPMClient' (1 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/SwiftPMClient
```
But If output is redirected, `Fetch` messages are delayed after `Compile` messages.
```
$ rm -rf .build
$ swift build > a.txt
$ cat a.txt
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/writer.c
Compile CYaml src/parser.c
Compile CYaml src/emitter.c
Compile CYaml src/api.c
Compile Swift Module 'Yams' (15 sources)
Compile Swift Module 'SwiftPMClient' (1 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/SwiftPMClient
Fetching https://github.com/jpsim/Yams.git
Cloning https://github.com/jpsim/Yams.git
Resolving https://github.com/jpsim/Yams.git at 0.5.0
```
The text was updated successfully, but these errors were encountered: