-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make -diagnostic-style consistent between CLI and IDE builds #1350
Comments
Possibly, this issue should just be called "Make swift-vscode use default build arguments` -- if that is a feasible solution. |
The |
For the record: changing this setting does not alter the behaviour of any task that has been written into Having the plugin write tasks into Much of this is probably the fault of VSCode's architecture, but it results in a non-optimal UX for the extension. It makes me wonder whether the extension-generated task should invoke an intermediate process which injects the extra settings, rather than them being explicitly written into the task. |
See also this slack thread for context. |
Ya unfortunately the writing to tasks.json happens through built-in vscode mechanisms, not anything the extension does. As I mentioned on Slack, I'd set |
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.The text was updated successfully, but these errors were encountered: