Commit 1d0f3ed4 authored by Sandro Knauß's avatar Sandro Knauß Committed by Ben Cooksley

Resolve tags to the commit, that was tagged.

Differential Revision: https://phabricator.kde.org/D17745
parent 51b13c44
......@@ -42,6 +42,7 @@ class Library:
if released:
# get the first released version, that is available
candidate = min(released, key=lambda i: HASH2TAG[i['scmRevision']])
logging.info("Found tag %s(%s) to check against.", HASH2TAG[candidate['scmRevision']].version, candidate['scmRevision'])
else:
#TODO: we may want to return None, as the library was never released so far.
......@@ -81,11 +82,14 @@ if not scmRevision:
scmRevision = subprocess.check_output(["git", "log", "--format=%H", "-n 1", "HEAD"]).strip().decode()
# get all tags that are in the current commit
tags = subprocess.check_output(["git", "tag", "--contains", scmRevision]).strip().decode().splitlines()
tags = subprocess.check_output(["git", "tag", "--merged", scmRevision]).strip().decode().splitlines()
# we are not interessed in the commit for annotatated tags itself, we want to know what commit was tagged.
commitedTags = [i+"^{}" for i in tags]
# resolve tags -> git hashes
taghashes = subprocess.check_output(["git", "rev-parse", *tags]).strip().decode().splitlines()
HASH2TAG = {taghashes[pos]:Version(tag) for pos, tag in enumerate(tags)}
tagHashes = subprocess.check_output(["git", "rev-parse", *commitedTags]).strip().decode().splitlines()
HASH2TAG = {tagHashes[pos]:Version(tag) for pos, tag in enumerate(tags)}
# Do we want to check for newer SONAMEs on other buildGroups
keepBuildGroup = False
......@@ -136,6 +140,7 @@ retval = 0
for l in libraries:
library = l.library
libname = library['libname']
logging.info("Do an ABI check for %s", libname)
candidate = l.candidate()
if not candidate:
logging.info("Did not found any older build for %s, nothing to check ABI against.",libname)
......@@ -145,7 +150,7 @@ for l in libraries:
newLibraryPath, _ = ourArchive.retrievePackage(l.packageName)
oldLibraryPath, _ = ourArchive.retrievePackage(candidate['packageName'])
logging.info("Let's do a ABI check %s against %s", library['scmRevision'], candidate['scmRevision'])
logging.info("check %s(old) -> %s(new)", candidate['scmRevision'], library['scmRevision'])
# check ABI and write compat reports
cmd = ["abi-compliance-checker",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment