[llvm] [AIX] Add git revision to .file string (PR #88164)
Jake Egan via llvm-commits
llvm-commits at lists.llvm.org
Wed May 8 10:22:22 PDT 2024
================
@@ -1,4 +1,23 @@
if not "PowerPC" in config.root.targets:
config.unsupported = True
+import subprocess
+
config.suffixes.add(".py")
+
+def get_revision(repo_path):
+ cmd = ['git', '-C', repo_path, 'rev-parse', 'HEAD']
+ try:
+ return subprocess.run(cmd, stdout=subprocess.PIPE, check=True).stdout.decode()
+ except subprocess.CalledProcessError:
+ print("An error occurred retrieving the git revision.")
+ return None
+
+if config.have_vc_rev:
+ if config.force_vc_rev:
+ git_revision = config.force_vc_rev
+ else:
+ git_revision = get_revision(config.llvm_src_root)
----------------
jakeegan wrote:
Thanks for reporting, I'll look into it
https://github.com/llvm/llvm-project/pull/88164
More information about the llvm-commits
mailing list