Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically update WEEK_4 WEEK_12 versions (openxla#2585)
This PR adds `update_version_h_cpp.sh` script The script will: - Automatically calculate `WEEK_4` and `WEEK_12` versions based on Version tag date and current date. - Bump CurrentVersion by increasing patch version by 1 This script should be executed at the beginning of the next development cycle, after performing the git tagging. This script: 1. Updates current version in `stablehlo/dialect/Version.h` ```cpp static Version getCurrentVersion() { return Version(x, y, z); } ``` New version will be (x, y, z + 1) 2. Replaces WEEK_4 and WEEK12 versions in stablehlo/dialect/Version.cpp ``` return Version(a, b, c); // WEEK_4 ANCHOR: DO NOT MODIFY return Version(m, n, p); // WEEK_12 ANCHOR: DO NOT MODIFY ``` - WEEK_4 version - The most recent git tag that was created at least 28 days ago. - WEEK_12 version - The most recent git tag that was created at least 84 days ago. ### Usage Example: ```bash $ build_tools/update_version_h_cpp.sh Next Current Version: 1, 8, 3 WEEK_4 Version: 1, 7, 6 WEEK_12 Version: 1, 5, 1 Saving /local/home/user/workspace/stablehlo/build_tools/../stablehlo/dialect/Version.h... static Version getCurrentVersion() { return Version(1, 8, 3); } Saving /local/home/user/workspace/stablehlo/build_tools/../stablehlo/dialect/Version.cpp... return Version(1, 7, 6); // WEEK_4 ANCHOR: DO NOT MODIFY return Version(1, 5, 1); // WEEK_12 ANCHOR: DO NOT MODIFY Done ``` #### Result: ```bash $ git diff diff --git a/stablehlo/dialect/Version.cpp b/stablehlo/dialect/Version.cpp index b4ea0d21..d107ba57 100644 --- a/stablehlo/dialect/Version.cpp +++ b/stablehlo/dialect/Version.cpp @@ -83,9 +83,9 @@ Version Version::fromCompatibilityRequirement( case CompatibilityRequirement::NONE: return Version::getCurrentVersion(); case CompatibilityRequirement::WEEK_4: - return Version(1, 7, 5); // WEEK_4 ANCHOR: DO NOT MODIFY + return Version(1, 7, 6); // WEEK_4 ANCHOR: DO NOT MODIFY case CompatibilityRequirement::WEEK_12: - return Version(1, 5, 0); // WEEK_12 ANCHOR: DO NOT MODIFY + return Version(1, 5, 1); // WEEK_12 ANCHOR: DO NOT MODIFY case CompatibilityRequirement::MAX: return Version::getMinimumVersion(); } diff --git a/stablehlo/dialect/Version.h b/stablehlo/dialect/Version.h index 2ea74427..a6fea6b3 100644 --- a/stablehlo/dialect/Version.h +++ b/stablehlo/dialect/Version.h @@ -38,7 +38,7 @@ class Version { static FailureOr<Version> fromString(llvm::StringRef versionRef); /// Return a Version representing the current VHLO dialect version. - static Version getCurrentVersion() { return Version(1, 8, 2); } + static Version getCurrentVersion() { return Version(1, 8, 3); } /// Return a Version representing the minimum supported VHLO dialect version. static Version getMinimumVersion() { return Version(0, 9, 0); } ```
- Loading branch information