[llvm] [AIX] Add git revision to .file string (PR #88164)
David Tenty via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 12:58:16 PDT 2024
================
@@ -1,4 +1,22 @@
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('ascii')
+ except subprocess.CalledProcessError:
+ print("An error occured retrieving the git revision")
+ raise
----------------
daltenty wrote:
nit: do you really want to just propagate this exception? Seems like it might be better to just disable the test if we can't run `git`, rather than abort `lit` (my gut feel is this will break some weird buildbot config somewhere)
https://github.com/llvm/llvm-project/pull/88164
More information about the llvm-commits
mailing list