[llvm] [AIX] Add git revision to .file string (PR #88164)

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 13:15:11 PDT 2024


================
@@ -1,4 +1,18 @@
 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']
+  return subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('ascii')
+
+if config.have_vc_rev:
+  config.available_features.add("vc-rev-enabled")
----------------
daltenty wrote:

I'd suggest setting this at the end, after we see if `get_revision` encountered any errors. That way if we can't compute the revision, the feature remains unavailable

https://github.com/llvm/llvm-project/pull/88164


More information about the llvm-commits mailing list