SERVER-98701 Upgrade to Bazel 7.4.1 (#30750)
GitOrigin-RevId: 86ee484a6d038e6866b619201e531dfaaa5b8d75
This commit is contained in:
parent
73145764d3
commit
37a3863015
@ -1,3 +1,3 @@
|
||||
7.2.1
|
||||
7.4.1
|
||||
# TODO(SERVER-86050): s390x and ppc64le are using custom built Bazel v7.2.1 binaries
|
||||
# Do not update this without updating the custom built binaries until Bazelisk is supported on s390x & ppc64le.
|
||||
|
||||
64
bazel/build_bazel/build_bazel.py
Normal file
64
bazel/build_bazel/build_bazel.py
Normal file
@ -0,0 +1,64 @@
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(prog="Build Bazel", description="Build Bazel from source code")
|
||||
|
||||
parser.add_argument("--version", help="version to build", required=True, type=str)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
download_url = f"https://github.com/bazelbuild/bazel/releases/download/{args.version}/bazel-{args.version}-dist.zip"
|
||||
print("Downloading Bazel source code from", download_url)
|
||||
|
||||
result = requests.get(
|
||||
download_url,
|
||||
timeout=60,
|
||||
)
|
||||
if result.status_code != 200:
|
||||
print(f"Error fetching source zip: {result.status_code}")
|
||||
return 1
|
||||
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
print("Unzipping into", str(temp_dir))
|
||||
|
||||
temp_zip_path = os.path.join(temp_dir, "bazel-dist.zip")
|
||||
with open(temp_zip_path, "wb") as temp_zip_file:
|
||||
temp_zip_file.write(result.content)
|
||||
|
||||
with zipfile.ZipFile(temp_zip_path, "r") as zip_ref:
|
||||
zip_ref.extractall(temp_dir)
|
||||
|
||||
compile_script = os.path.join(temp_dir, "compile.sh")
|
||||
print("Running", str(compile_script))
|
||||
|
||||
os.system("chmod -R 755 " + temp_dir)
|
||||
|
||||
subprocess.run(
|
||||
[compile_script],
|
||||
cwd=temp_dir,
|
||||
check=True,
|
||||
env={
|
||||
**os.environ.copy(),
|
||||
**{
|
||||
"JAVA_HOME": "/usr/lib/jvm/java-21-openjdk",
|
||||
"EXTRA_BAZEL_ARGS": "--tool_java_runtime_version=local_jdk",
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
shutil.copyfile(os.path.join(temp_dir, "output/bazel"), "bazel_binary")
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
0
bazel/build_bazel/build_bazel.sh
Normal file
0
bazel/build_bazel/build_bazel.sh
Normal file
@ -1624,3 +1624,37 @@ tasks:
|
||||
- func: "set up venv"
|
||||
- func: "upload pip requirements"
|
||||
- func: "generate version validation"
|
||||
|
||||
- name: build_bazel_from_source
|
||||
tags: ["assigned_to_jira_team_devprod_build", "auxiliary"]
|
||||
commands:
|
||||
- command: timeout.update
|
||||
params:
|
||||
# 6 hours
|
||||
exec_timeout_secs: 21600
|
||||
- func: "f_expansions_write"
|
||||
- command: manifest.load
|
||||
- func: "git get project and add git tag"
|
||||
- func: "f_expansions_write"
|
||||
- func: "kill processes"
|
||||
- func: "cleanup environment"
|
||||
- func: "set up venv"
|
||||
- func: "upload pip requirements"
|
||||
- command: subprocess.exec
|
||||
params:
|
||||
binary: bash
|
||||
args:
|
||||
- "src/evergreen/run_python_script.sh"
|
||||
- "bazel/build_bazel/build_bazel.py"
|
||||
- "--version=7.4.1"
|
||||
- command: s3.put
|
||||
params:
|
||||
optional: true
|
||||
aws_key: ${aws_key}
|
||||
aws_secret: ${aws_secret}
|
||||
local_file: src/bazel_binary
|
||||
remote_file: ${project}/${build_variant}/${revision}/bazel
|
||||
bucket: mciuploads
|
||||
permissions: public-read
|
||||
content_type: text/plain
|
||||
display_name: bazel
|
||||
|
||||
@ -176,3 +176,25 @@ buildvariants:
|
||||
- name: compile_ninja_TG
|
||||
distros:
|
||||
- rhel8.8-xlarge
|
||||
|
||||
- name: build-bazel-from-source-s390x
|
||||
display_name: "~ Build Bazel from Source s390x"
|
||||
tags: []
|
||||
activate: false
|
||||
run_on:
|
||||
- rhel83-zseries-large
|
||||
expansions:
|
||||
has_packages: false
|
||||
tasks:
|
||||
- name: build_bazel_from_source
|
||||
|
||||
- name: build-bazel-from-source-ppc64le
|
||||
display_name: "~ Build Bazel from Source ppc64le"
|
||||
tags: []
|
||||
activate: false
|
||||
run_on:
|
||||
- rhel81-power8-large
|
||||
expansions:
|
||||
has_packages: false
|
||||
tasks:
|
||||
- name: build_bazel_from_source
|
||||
|
||||
@ -79,8 +79,8 @@ _DISTRO_PATTERN_MAP = {
|
||||
}
|
||||
|
||||
_S3_HASH_MAPPING = {
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazel-binaries/bazel-7.2.1-ppc64le": "4ecc7f1396b8d921c6468b34cc8ed356c4f2dbe8a154c25d681a61ccb5dfc9cb",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazel-binaries/bazel-7.2.1-s390x": "2f5f7fd747620d96e885766a4027347c75c0f455c68219211a00e72fc6413be9",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazel-binaries/bazel-7.4.1-ppc64le": "f8e95c5a840f18bcec9de689bdeb7c3a4409b0580cbeadf0266534c09332b8d8",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazel-binaries/bazel-7.4.1-s390x": "3c48f892520eeeab5a706238c2aaccdb9afd3ed49a3757c23187d4ba089ecb58",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazelisk-binaries/v1.19.0/bazelisk-darwin-amd64": "f2ba5f721a995b54bab68c6b76a340719888aa740310e634771086b6d1528ecd",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazelisk-binaries/v1.19.0/bazelisk-darwin-arm64": "69fa21cd2ccffc2f0970c21aa3615484ba89e3553ecce1233a9d8ad9570d170e",
|
||||
"https://mdb-build-public.s3.amazonaws.com/bazelisk-binaries/v1.19.0/bazelisk-linux-amd64": "d28b588ac0916abd6bf02defb5433f6eddf7cba35ffa808eabb65a44aab226f7",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user