diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2019-01-09 04:05:07 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-01-09 04:05:07 +0000 |
| commit | 634a143d48d87ebb3f99b5ddde8f3343d46beb8c (patch) | |
| tree | f488bfc639498ea1b9aae29144d3633ac37d5055 /llvm/utils/gn/build/write_vcsrevision.py | |
| parent | 9479f6d72e7d148aa1783bf229416e55791b09e9 (diff) | |
| download | bcm5719-llvm-634a143d48d87ebb3f99b5ddde8f3343d46beb8c.tar.gz bcm5719-llvm-634a143d48d87ebb3f99b5ddde8f3343d46beb8c.zip | |
gn build: Fix a Python2ism in write_vcsrevision.py.
Convert the output of "git rev-parse --short HEAD" to a string before
substituting it into the output file. Without this the output file
will look like this on Python 3:
#define LLVM_REVISION "git-b'6a4895a025f'"
Differential Revision: https://reviews.llvm.org/D56459
llvm-svn: 350686
Diffstat (limited to 'llvm/utils/gn/build/write_vcsrevision.py')
| -rwxr-xr-x | llvm/utils/gn/build/write_vcsrevision.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/gn/build/write_vcsrevision.py b/llvm/utils/gn/build/write_vcsrevision.py index ed7c05f1d0e..b9b3755526c 100755 --- a/llvm/utils/gn/build/write_vcsrevision.py +++ b/llvm/utils/gn/build/write_vcsrevision.py @@ -52,9 +52,9 @@ def main(): git = which('git.bat') use_shell = True rev = subprocess.check_output([git, 'rev-parse', '--short', 'HEAD'], - cwd=git_dir, shell=use_shell) + cwd=git_dir, shell=use_shell).decode().strip() # FIXME: add pizzas such as the svn revision read off a git note? - vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev.strip() + vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev # If the output already exists and is identical to what we'd write, # return to not perturb the existing file's timestamp. |

