[llvm] d9db266 - [PowerPC][test] Catch any exception when retrieving git revision (#92004)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 07:32:35 PDT 2024


Author: Jake Egan
Date: 2024-05-14T10:32:30-04:00
New Revision: d9db2664994ff672f50d7fd0117477935dac04f1

URL: https://github.com/llvm/llvm-project/commit/d9db2664994ff672f50d7fd0117477935dac04f1
DIFF: https://github.com/llvm/llvm-project/commit/d9db2664994ff672f50d7fd0117477935dac04f1.diff

LOG: [PowerPC][test] Catch any exception when retrieving git revision (#92004)

This makes the `vc-rev-enabled` feature unsupported if we fail to
retrieve the git revision for any reason, such as if git is not
installed.

Added: 
    

Modified: 
    llvm/test/CodeGen/PowerPC/lit.local.cfg

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/PowerPC/lit.local.cfg b/llvm/test/CodeGen/PowerPC/lit.local.cfg
index 4cc802afef4a0..e56ce48eff401 100644
--- a/llvm/test/CodeGen/PowerPC/lit.local.cfg
+++ b/llvm/test/CodeGen/PowerPC/lit.local.cfg
@@ -9,8 +9,8 @@ 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.")
+    except Exception as e:
+        print("An error occurred retrieving the git revision:", e)
         return None
 
 if config.have_vc_rev:


        


More information about the llvm-commits mailing list