Skip to content

Commit

Permalink
Fix forward for breakage caused by 3dcb585.
Browse files Browse the repository at this point in the history
The --lock_install_base startup flag must default to false, so that the client can obtain the desired behavior by either explicitly enabling or omitting it (explicitly disabling is problematic).

PiperOrigin-RevId: 704347325
Change-Id: I55b9b324c2c16035356673291c254e6629105d8e
  • Loading branch information
tjgq authored and copybara-github committed Dec 9, 2024
1 parent a5e0712 commit 4176d23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ static vector<string> GetServerExeArgs(const blaze_util::Path &jvm_path,
startup_options.install_base.AsCommandLineArgument());
result.push_back("--install_md5=" + install_md5);
if (startup_options.lock_install_base) {
// This flag is not user-settable. Its sole purpose is to alter the behavior
// for Blaze and Bazel. Do *not* explicitly set it to disabled, because at
// Google we rely on the ability to run the client code against a server
// built before the flag was added.
result.push_back("--lock_install_base");
}
result.push_back("--output_base=" +
Expand Down
3 changes: 2 additions & 1 deletion src/main/cpp/startup_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ class StartupOptions {
blaze_util::Path install_base;

// Whether the install base should be locked before use.
// This is always true for Bazel, but overridden for Blaze at Google.
// Not user-settable, only used for client/server communication.
// Hardcoded to true for Bazel, false for Blaze.
bool lock_install_base;

// Override more finegrained rc file flags and ignore them all.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public String getTypeDescription() {

@Option(
name = "lock_install_base",
defaultValue = "true", // NOTE: only for documentation, value is always passed by the client.
defaultValue = "false", // NOTE: only for documentation, value is always passed by the client.
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
metadataTags = {OptionMetadataTag.HIDDEN},
Expand Down

0 comments on commit 4176d23

Please sign in to comment.