[PATCH] D56422: gn build: Use "git rev-parse --git-dir" to discover the path to the .git directory.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 8 15:59:07 PST 2019


pcc marked an inline comment as done.
pcc added inline comments.


================
Comment at: llvm/utils/gn/build/write_vcsrevision.py:52
+    if not os.path.isdir(git_dir):
+        print('.git dir not found at "%s"' % git_dir, file=sys.stderr)
+        return 1
----------------
serge-sans-paille wrote:
> For the record, on Python3, `subprocess.check_output` generates bytes and not str. It seems to be ok as an argument to `os.path.isdir`, but it requires an extra `decode()` after the `strip()`
I tried the modified script with Python 3 and it appeared to work as is. However, I did notice a difference in behaviour between Python 2 and 3, which I've sent a fix for in D56459.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56422/new/

https://reviews.llvm.org/D56422





More information about the llvm-commits mailing list