Add .txt file extension to SUBMODULE_VERSIONS (#4427)
diff --git a/.github/workflows/synchronize_submodules.yml b/.github/workflows/synchronize_submodules.yml
index d6f7de4..c93a918 100644
--- a/.github/workflows/synchronize_submodules.yml
+++ b/.github/workflows/synchronize_submodules.yml
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Edits the HEAD commit to use the submodule state specified in SUBMODULE_VERSIONS
+# Edits the HEAD commit to use the submodule state specified in SUBMODULE_VERSIONS.txt
# WARNING: rewrites history!
name: Synchronize Submodules
@@ -35,7 +35,7 @@
# all the branch history. This takes a whopping 2 seconds. I think
# we'll live.
fetch-depth: 0
- - name: Importing submodules from SUBMODULE_VERSIONS
+ - name: Importing submodules from SUBMODULE_VERSIONS.txt
run: ./scripts/git/submodule_versions.py import
- name: Checking submodule state
run: |
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS.txt
similarity index 100%
rename from SUBMODULE_VERSIONS
rename to SUBMODULE_VERSIONS.txt
diff --git a/docs/developing_iree/repository_management.md b/docs/developing_iree/repository_management.md
index 1cc7030..31d6253 100644
--- a/docs/developing_iree/repository_management.md
+++ b/docs/developing_iree/repository_management.md
@@ -29,20 +29,20 @@
The git submodule state is not accessible to the tooling that moves the IREE
source between GitHub and Google's source repository. We therefore mirror this
-state in a special `SUBMODULE_VERSIONS` file. This file is considered the source
-of truth for the correct submodule state and is what is used by the CI. When
-updating the submodule state from Google's source repository, only this file is
-updated and another
+state in a special `SUBMODULE_VERSIONS.txt` file. This file is considered the
+source of truth for the correct submodule state and is what is used by the CI.
+When updating the submodule state from Google's source repository, only this
+file is updated and another
[GitHub Actions workflow](https://github.com/google/iree/blob/main/.github/workflows/synchronize_submodules.yml)
immediately commits a submodule update on top of that.
Shortcut commands (read below for full documentation):
```shell
-# Update SUBMODULE_VERSIONS from current git submodule pointers
+# Update SUBMODULE_VERSIONS.txt from current git submodule pointers
$ ./scripts/git/submodule_versions.py export
-# Update current git submodule pointers based on SUBMODULE_VERSIONS
+# Update current git submodule pointers based on SUBMODULE_VERSIONS.txt
$ ./scripts/git/submodule_versions.py import
```
@@ -97,7 +97,7 @@
When working on a development branch, feel free to stage changes however makes
sense. However, when sending a PR, note that our integration systems will
-overwrite the submodule version updates from the `SUBMODULE_VERSIONS` file in
+overwrite the submodule version updates from the `SUBMODULE_VERSIONS.txt` file in
the repository root. Here is an example:
```text
@@ -119,7 +119,7 @@
To generate it, run:
```shell
-# Performs a submodule sync+update and stages an updated SUBMODULE_VERSIONS
+# Performs a submodule sync+update and stages an updated SUBMODULE_VERSIONS.txt
# file.
$ ./scripts/git/submodule_versions.py export
```
@@ -128,24 +128,24 @@
```shell
# The check command is intended to eventually be usable as a git hook
-# for verification of consistency between SUBMODULE_VERSIONS and the
+# for verification of consistency between SUBMODULE_VERSIONS.txt and the
# corresponding local git state.
$ ./scripts/git/submodule_versions.py check
```
#### Pulling dependency changes
-If you pull a change to `SUBMODULE_VERSIONS` it is necessary to import it into
+If you pull a change to `SUBMODULE_VERSIONS.txt` it is necessary to import it into
the current git state:
```shell
-# Updates the commit hash of any entries in SUBMODULE_VERSIONS that differ
+# Updates the commit hash of any entries in SUBMODULE_VERSIONS.txt that differ
# and stages the changes.
$ ./scripts/git/submodule_versions.py import
```
This will stage any needed changes to the submodules to bring them up to date
-with the `SUBMODULE_VERSIONS`. If you have local changes, you may get conflicts
+with the `SUBMODULE_VERSIONS.txt`. If you have local changes, you may get conflicts
on the `submodule update` step at the end, and you will need to manually resolve
as usual.
diff --git a/scripts/git/submodule_versions.py b/scripts/git/submodule_versions.py
index d578286..38eb3eb 100755
--- a/scripts/git/submodule_versions.py
+++ b/scripts/git/submodule_versions.py
@@ -17,18 +17,18 @@
# pylint: disable=missing-docstring
"""submodule_versions.
-Synchronizes the tracked SUBMODULE_VERSIONS file with the submodule state
+Synchronizes the tracked SUBMODULE_VERSIONS.txt file with the submodule state
in git.
Typical usage:
--------------
-Exporting current git submodule state to SUBMODULE_VERSIONS:
+Exporting current git submodule state to SUBMODULE_VERSIONS.txt:
Syntax: ./scripts/git/submodule_versions.py export
-Importing versions in SUBMODULE_VERSIONS to git submodule state:
+Importing versions in SUBMODULE_VERSIONS.txt to git submodule state:
Syntax: ./scripts/git/submodule_versions.py import
-Checking whether SUBMODULE_VERSIONS and git state are in sync:
+Checking whether SUBMODULE_VERSIONS.txt and git state are in sync:
Syntax: ./scripts/git/submodule_versions.py check
"""
@@ -39,7 +39,7 @@
import utils
-VERSIONS_FILE = "SUBMODULE_VERSIONS"
+VERSIONS_FILE = "SUBMODULE_VERSIONS.txt"
def get_submodule_versions(repo_dir):
@@ -128,15 +128,12 @@
def check_submodule_versions(repo_dir):
diff_versions = get_diff_versions(repo_dir)
if diff_versions:
- print(
- "Submodule state differs from SUBMODULE_VERSIONS file. Run (and commit) one of:"
- )
- print(
- " ./scripts/git/submodule_versions.py import # Use version in SUBMODULE_VERSIONS ('written')"
- )
- print(
- " ./scripts/git/submodule_versions.py export # Use version in git state ('actual')"
- )
+ print("Submodule state differs from SUBMODULE_VERSIONS.txt file."
+ " Run (and commit) one of:")
+ print(" ./scripts/git/submodule_versions.py import"
+ " # Use version in SUBMODULE_VERSIONS.txt ('written')")
+ print(" ./scripts/git/submodule_versions.py export"
+ " # Use version in git state ('actual')")
for k, (current, written) in diff_versions.items():
print(f"{k} : actual={current} written={written}")
return False
@@ -174,8 +171,9 @@
# but good to only print output about the import if it's actually
# needed.
if not check_submodule_versions(args.repo):
- print("Warning: git submodule state does not match SUBMODULE_VERSIONS. "
- "Using state in SUBMODULE_VERSIONS")
+ print(
+ "Warning: git submodule state does not match SUBMODULE_VERSIONS.txt. "
+ "Using state in SUBMODULE_VERSIONS.txt")
import_versions(args.repo)
parallel_shallow_update_submodules(args.repo)
else:
diff --git a/scripts/git/update_to_llvm_syncpoint.py b/scripts/git/update_to_llvm_syncpoint.py
index ce13689..ccc9d90 100755
--- a/scripts/git/update_to_llvm_syncpoint.py
+++ b/scripts/git/update_to_llvm_syncpoint.py
@@ -185,7 +185,7 @@
args.mlir_hlo_path,
exit_on_failure=args.validate)
- # Export SUBMODULE_VERSIONS.
+ # Export SUBMODULE_VERSIONS.txt.
print() # Add line break.
submodule_versions.export_versions(args.repo)