Skip to content
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

Allow native.bazel_version to be overridden for dev builds #24669

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public class BlazeVersionInfo {
/** Key for the release timestamp is seconds. */
public static final String BUILD_TIMESTAMP = "Build timestamp as int";

// If the current version is a development version, this environment variable can be used to
// override the version string (e.g. to deal with version-based feature detection during a
// bisect).
public static final String BAZEL_DEV_VERSION_OVERRIDE_ENV_VAR = "BAZEL_DEV_VERSION_OVERRIDE";

private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();

private static BlazeVersionInfo instance = null;
Expand Down Expand Up @@ -126,7 +131,14 @@ public String getReleaseName() {
*/
public String getVersion() {
String buildLabel = buildData.get(BUILD_LABEL);
return buildLabel != null ? buildLabel : "";
if (buildLabel != null) {
return buildLabel;
}
String override = System.getenv(BAZEL_DEV_VERSION_OVERRIDE_ENV_VAR);
fmeum marked this conversation as resolved.
Show resolved Hide resolved
if (override != null) {
return override;
}
return "";
}

/**
Expand Down