Skip to content

Add extra output for --verbose and --very-verbose to help diagnose failures #9075

@bnbarham

Description

@bnbarham

We recently had an issue where Windows started failing non-deterministically with just error: fatalError. The details of the cause are in swiftlang/swift#83606 (comment), but part of what made it difficult to diagnose was the lack of output from SwiftPM. Even in --very-verbose, we were only outputting each command. That's useful, but for a parallel build it doesn't help to identify what actually failed.

There's a few levels of detail that would be awesome to have here:

  1. The full command that failed. This seems reasonable to include in --verbose, which today only outputs the started commands (which is useful, but less useful in a parallel build as we still have no idea which command failed).
  2. The full command for started subprocesses where that's available (eg. from swift), probably limited to --very-verbose as it is very spammy. Ideally this would include PID + exit status on completion. This would have been particularly useful in the case above, as it would have very clearly shown that the bug was within the driver (all frontend processes that ran completed successfully, but we never ran the emit-module job).

Note that I haven't checked what swift-build outputs here, so it's possible we already have this after we switch from the native. In the native case (if we care about this at all) we'd want to update LLBuildProgressTracker.swift, in particular commandProcessStarted, commandProcessFinished, and verboseProgressText for the subprocesses (though note that the parsed PID is the pseudo-PID rather than real PID today).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions