aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/startup_options.h
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-08-14 21:09:07 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-08-16 11:04:41 +0200
commit1cbe62a09b37f2db76e11ebb18fb46616076ef87 (patch)
treef02a66fc345507f3eb3ab3bbe404fdcb161cbabc /src/main/cpp/startup_options.h
parentfc6412ca67a9d98c1b6b0c8b237c119e543bc266 (diff)
Send Bazel startup options to server.
Send the startup options tagged with their origin so that the server has correct information about the command line as the client received it. Removes the unconditional stderr printing of all bazelrc startup options in the bazel client. Instead, the startup options are sent to the server and the same informational printing is gated on the --announce_rc option. This avoids unconditional log spam to stderr early in startup. If the server is unreachable or there are errors parsing startup options, the message is still printed to stderr. Fixes https://github.com/bazelbuild/bazel/issues/2530. RELNOTES: --announce_rc now controls whether bazelrc startup options are printed to stderr. PiperOrigin-RevId: 165211007
Diffstat (limited to 'src/main/cpp/startup_options.h')
-rw-r--r--src/main/cpp/startup_options.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/cpp/startup_options.h b/src/main/cpp/startup_options.h
index 81cfe787ac..9ddc98d48c 100644
--- a/src/main/cpp/startup_options.h
+++ b/src/main/cpp/startup_options.h
@@ -61,7 +61,8 @@ class UnaryStartupFlag : public StartupFlag {
const std::string name_;
};
-// A startup flag parsed from a bazelrc file.
+// A startup flag tagged with its origin, either an rc file or the empty
+// string for the ones specified in the command line.
// For instance, RcStartupFlag("somepath/.bazelrc", "--foo") is used to
// represent that the line "startup --foo" was found when parsing
// "somepath/.bazelrc".
@@ -267,6 +268,10 @@ class StartupOptions {
// Value of the java.util.logging.FileHandler.formatter Java property.
std::string java_logging_formatter;
+ // The startup options as received from the user and rc files, tagged with
+ // their origin. This is populated by ProcessArgs.
+ std::vector<RcStartupFlag> original_startup_options_;
+
protected:
// Constructor for subclasses only so that site-specific extensions of this
// class can override the product name. The product_name must be the