Skip to content

Make -diagnostic-style consistent between CLI and IDE builds #1350

Open
@samdeane

Description

@samdeane

Problem

The build tasks that vscode-swift generates include "-Xswiftc" "-diagnostic-style=llvm" in their arguments.

When the user builds on the command line, they are likely to just do swift build, swift test etc.

My assumption is that the build cache may be invalidated by SPM when the command line arguments change. There is no way to know for certain for any given arguments (other than reading the SPM source code), but it is a safe assumption that it could (and probably should) happen for some of them.

This isn’t ideal as it could cause a certain amount of thrashing for anyone who is used to switching back & forth between building in the IDE and the command line. For packages using macros or other large dependencies with long build times, this is a real annoyance.

Possible Solutions

Initially it would be useful if this was clearly documented, so that users were at least aware of the problem. Do we need to pass the same arguments on the command line to avoid a full rebuild every time?

Preferably, vscode-swift should use the same defaults as the command line, and not specify explicit extra options.

Alternatively, if it needs non-default arguments, it should offer to add them to the Package.swift file, so that a build triggered in any manner ought to produce the same results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions