CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
67 lines
2.5 KiB
Python
Executable File
67 lines
2.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Usage: -i <path/to/input-header.h> -o <path/to/output-header.h> -m LLDB_MAJOR_VERSION -n LLDB_MINOR_VERSION -p LLDB_PATCH_VERSION
|
|
|
|
This script uncomments and populates the versioning information in lldb-defines.h. Note that the LLDB version numbering looks like MAJOR.MINOR.PATCH
|
|
"""
|
|
|
|
import argparse
|
|
import os
|
|
import re
|
|
|
|
LLDB_VERSION_REGEX = re.compile(r"//\s*#define LLDB_VERSION\s*$", re.M)
|
|
LLDB_REVISION_REGEX = re.compile(r"//\s*#define LLDB_REVISION\s*$", re.M)
|
|
LLDB_VERSION_STRING_REGEX = re.compile(r"//\s*#define LLDB_VERSION_STRING\s*$", re.M)
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(
|
|
description="This script uncomments and populates the versioning information in lldb-defines.h. Note that the LLDB version numbering looks like MAJOR.MINOR.PATCH"
|
|
)
|
|
parser.add_argument("-i", "--input_path", help="The filepath for the input header.")
|
|
parser.add_argument(
|
|
"-o", "--output_path", help="The filepath for the output header."
|
|
)
|
|
parser.add_argument("-m", "--major", help="The LLDB version major.")
|
|
parser.add_argument("-n", "--minor", help="The LLDB version minor.")
|
|
parser.add_argument("-p", "--patch", help="The LLDB version patch number.")
|
|
args = parser.parse_args()
|
|
input_path = str(args.input_path)
|
|
output_path = str(args.output_path)
|
|
|
|
# Create the output dir if it doesn't already exist
|
|
if not os.path.exists(os.path.dirname(output_path)):
|
|
os.makedirs(os.path.dirname(output_path))
|
|
|
|
with open(input_path, "r") as input_file:
|
|
lines = input_file.readlines()
|
|
file_buffer = "".join(lines)
|
|
|
|
with open(output_path, "w") as output_file:
|
|
# For the defines in lldb-defines.h that define the major, minor and version string
|
|
# uncomment each define and populate its value using the arguments passed in.
|
|
# e.g. //#define LLDB_VERSION -> #define LLDB_VERSION <LLDB_MAJOR_VERSION>
|
|
file_buffer = re.sub(
|
|
LLDB_VERSION_REGEX,
|
|
r"#define LLDB_VERSION " + args.major,
|
|
file_buffer,
|
|
)
|
|
|
|
file_buffer = re.sub(
|
|
LLDB_REVISION_REGEX,
|
|
r"#define LLDB_REVISION " + args.patch,
|
|
file_buffer,
|
|
)
|
|
file_buffer = re.sub(
|
|
LLDB_VERSION_STRING_REGEX,
|
|
r'#define LLDB_VERSION_STRING "{0}.{1}.{2}"'.format(
|
|
args.major, args.minor, args.patch
|
|
),
|
|
file_buffer,
|
|
)
|
|
output_file.write(file_buffer)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|