-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[BatchMode] Avoid spurious warnings in sourcekitd and indexing #16067
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
[BatchMode] Avoid spurious warnings in sourcekitd and indexing #16067
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but the last person to touch this logic was @davidungar so probably best to ask him.
Explicitly disable batch mode in createCompilerInvocation, since it uses -force-single-frontend-invocation. Previously we were getting spurious warnings. Also add a test that -disable-batch-mode will allow commands that use -index-file to avoid the same warning, since that is likely what they want to do as well. rdar://39581506
5d8c977
to
8ea2d0d
Compare
(new commit is to fix the commit message; no change to code) |
@swift-ci please smoke test |
Where is the -enable-batch-mode coming from? Would it be reasonable to remove that in addition to annihilating it with an anti-particle? Or is that not under our control in this circumstances? I like leaving the disable-batch-mode in for the day when batch mode becomes the default. |
@@ -13,6 +13,12 @@ | |||
// RUN: %FileCheck -check-prefix CHECK-INDEX %s <%t/stderr_batch_index | |||
// CHECK-INDEX: warning: ignoring '-enable-batch-mode' because '-index-file' was also specified | |||
// | |||
// RUN: %swiftc_driver -disable-batch-mode -index-file %S/../Inputs/empty.swift -### 2>%t/stderr_nobatch_index | %FileCheck %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a comment like the one on line 22, briefly describing the reason for the test? As a newbie, I've found such to help a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll add a follow-up commit explaining what my goal is here. Roughly:
The following test is verifying that -disable-batch-mode
overrides an earlier -enable-batch-mode
and silences the warning about mixing batch mode with -index-file
. Tools that take an existing command line and add -index-file
can add -disable-batch-mode
without having to otherwise interpret the arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've written a few thoughts down for your consideration, but none of them are critical.
A build system or end user. Somewhere outside the compiler in any case.
Do you mean remove it inside |
Explicitly disable batch mode in
createCompilerInvocation
, since it uses-force-single-frontend-invocation
. Previously we were getting spuriouswarnings. Also add a test that
-disable-batch-mode
will allow commandsthat use
-index-file
to avoid the same warning, since that is likelywhat they want to do as well.
rdar://39581506