Describe the bug
Trying to build from a tarball of a tagged release, rather than from a git clone, fails when it tries to use git commands inside scripts/build/extend_version_file.py to populate build/CodeChecker/config/version.json.
Follow the instructions in the "boostrapping" section of README AFTERgit clone
Observe error similar to the following:
[INFO] - Extending version file '/rpmbuilddir/BUILDROOT/codechecker-6.9.1-201917252134.x86_64/config/analyzer_version.json'.
fatal: Not a git repository (or any of the parent directories): .git
[ERROR] - Failed to get last commit hash.
Traceback (most recent call last):
File "./scripts/build/extend_version_file.py", line 41, in extend_version_file
git_hash = run_cmd(git_hash_cmd, repository_root)
File "./scripts/build/extend_version_file.py", line 28, in run_cmd
cwd=cwd)
File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128
fatal: Not a git repository (or any of the parent directories): .git
[ERROR] - Failed to get last commit describe.
Traceback (most recent call last):
File "./scripts/build/extend_version_file.py", line 61, in extend_version_file
git_describe = run_cmd(git_describe_cmd, repository_root)
File "./scripts/build/extend_version_file.py", line 28, in run_cmd
cwd=cwd)
File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['git', 'describe', '--always', '--tags', '--abbrev=0']' returned non-zero exit status 128
Traceback (most recent call last):
File "./scripts/build/extend_version_file.py", line 139, in <module>
extend_version_file(args['repository'], version_file)
File "./scripts/build/extend_version_file.py", line 86, in extend_version_file
version_json_data['git_describe'] = {'tag': git_tag,
UnboundLocalError: local variable 'git_tag' referenced before assignment
make[1]: *** [package] Error 1
Expected behavior
At minimum substitute a bogus made-up value for version. Ideally I would be able to hard-code this version as part of the build.
Desktop (please complete the following information)
OS: Centos 7
Additional context
This is part of an effort to package codechecker as an installable RPM.
Describe the bug Trying to build from a tarball of a tagged release, rather than from a git clone, fails when it tries to use git commands inside
scripts/build/extend_version_file.py
to populatebuild/CodeChecker/config/version.json
.CodeChecker version v6.9.1
To Reproduce Steps to reproduce the behavior
https://github.com/Ericsson/codechecker/tarball/$(VERSION_TAG)
git clone
Observe error similar to the following:
Expected behavior At minimum substitute a bogus made-up value for version. Ideally I would be able to hard-code this version as part of the build.
Desktop (please complete the following information)
Additional context This is part of an effort to package codechecker as an installable RPM.