Changeset View
Changeset View
Standalone View
Standalone View
helpers/create-abi-dump.py
Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 183 | def createABIDump(self, runtimeEnvironment=None) -> None: | |||
---|---|---|---|---|---|
246 | with open("{version}.xml".format(version=version),"w") as f: # replace with f-String in python 3.6 | 246 | with open("{version}.xml".format(version=version),"w") as f: # replace with f-String in python 3.6 | ||
247 | f.write(xml) | 247 | f.write(xml) | ||
248 | 248 | | |||
249 | # acc is compatible for C/C++ as Qt using C++11 and -fPic we need to set the gcc settings explitly | 249 | # acc is compatible for C/C++ as Qt using C++11 and -fPic we need to set the gcc settings explitly | ||
250 | subprocess.check_call(["abi-compliance-checker", "-gcc-options", "-std=c++11 -fPIC", "-l", self.name, "--dump", f.name], env=runtimeEnvironment) | 250 | subprocess.check_call(["abi-compliance-checker", "-gcc-options", "-std=c++11 -fPIC", "-l", self.name, "--dump", f.name], env=runtimeEnvironment) | ||
251 | 251 | | |||
252 | # Parse the command line arguments we've been given | 252 | # Parse the command line arguments we've been given | ||
253 | parser = argparse.ArgumentParser(description='Utility to create abi checker tarballs.') | 253 | parser = argparse.ArgumentParser(description='Utility to create abi checker tarballs.') | ||
254 | parser.add_argument('--project', type=str, required=True) | ||||
255 | parser.add_argument('--branchGroup', type=str, required=True) | ||||
254 | parser.add_argument('--buildLog', type=str, required=True) | 256 | parser.add_argument('--buildLog', type=str, required=True) | ||
255 | parser.add_argument('--environment', type=str, required=True) | 257 | parser.add_argument('--environment', type=str, required=True) | ||
256 | parser.add_argument('--usingInstall', type=str, required=True) | 258 | parser.add_argument('--usingInstall', type=str, required=True) | ||
257 | arguments = parser.parse_args() | 259 | arguments = parser.parse_args() | ||
258 | 260 | | |||
259 | # Make sure we have an environment ready for executing commands | 261 | # Make sure we have an environment ready for executing commands | ||
260 | buildEnvironment = EnvironmentHandler.generateFor( installPrefix=arguments.usingInstall ) | 262 | buildEnvironment = EnvironmentHandler.generateFor( installPrefix=arguments.usingInstall ) | ||
261 | 263 | | |||
Show All 18 Lines | |||||
280 | # GIT_COMMIT is set by Jenkins Git plugin, so we can rely on that for most of our builds | 282 | # GIT_COMMIT is set by Jenkins Git plugin, so we can rely on that for most of our builds | ||
281 | scmRevision = '' | 283 | scmRevision = '' | ||
282 | if os.getenv('GIT_COMMIT') != '': | 284 | if os.getenv('GIT_COMMIT') != '': | ||
283 | scmRevision = os.getenv('GIT_COMMIT') | 285 | scmRevision = os.getenv('GIT_COMMIT') | ||
284 | 286 | | |||
285 | if not scmRevision: | 287 | if not scmRevision: | ||
286 | scmRevision = subprocess.check_output(["git", "log", "--format=%H", "-n 1", "HEAD"]).strip().decode() | 288 | scmRevision = subprocess.check_output(["git", "log", "--format=%H", "-n 1", "HEAD"]).strip().decode() | ||
287 | 289 | | |||
288 | # Now we generate the ABI dumps for every library we have found | 290 | # Now we generate the ABI dumps for every library we have found | ||
bcooksley: This won't work in a Jenkins context, because it checks out the explicit revision it has… | |||||
Well the branch information is now only needed for cases, we see a newer SONAME. E.g. you have a stable build for 18.08 with SONAME 5 and on master there is SONAME 6 and we want to supress the error, that we found a newer SONAME. knauss: Well the branch information is now only needed for cases, we see a newer SONAME. E.g. you have… | |||||
branchGroup should be perfectly fine to use for that, as a given branch group usually only moves forward in version number (5.2 to 5.3 for stable for instance) or on the same branch (master stays as master) bcooksley: branchGroup should be perfectly fine to use for that, as a given branch group usually only… | |||||
289 | for library in foundLibraries: | 291 | for library in foundLibraries: | ||
290 | # Create the ABI Dump for this library | 292 | # Create the ABI Dump for this library | ||
291 | library.createABIDump( runtimeEnvironment=buildEnvironment ) | 293 | library.createABIDump( runtimeEnvironment=buildEnvironment ) | ||
292 | 294 | | |||
293 | # Determine where the ABI Dump archive is located | 295 | # Determine where the ABI Dump archive is located | ||
294 | # This location is controlled by abi-compliance-checker, but follows a predictable pattern | 296 | # This location is controlled by abi-compliance-checker, but follows a predictable pattern | ||
295 | fileName = "abi_dumps/{name}/{version}/ABI.dump".format(name=library.name,version=library.version) | 297 | fileName = "abi_dumps/{name}/{version}/ABI.dump".format(name=library.name,version=library.version) | ||
296 | 298 | | |||
297 | extraMetadata = { | 299 | extraMetadata = { | ||
298 | "SONAME": max([t['SONAME'] for t in library.targets.values()]), # use max because there may be more than one lib inside | 300 | "SONAME": max([t['SONAME'] for t in library.targets.values()]), # use max because there may be more than one lib inside | ||
299 | "version": library.version, | 301 | "version": library.version, | ||
300 | "libname": library.name, | 302 | "libname": library.name, | ||
301 | "targets": list(library.targets), | 303 | "targets": list(library.targets), | ||
304 | "project": arguments.project, | ||||
305 | "branchGroup": arguments.branchGroup, | ||||
302 | } | 306 | } | ||
303 | packageName = "{name}_{scmRevision}".format(name=library.name, scmRevision=scmRevision) | 307 | packageName = "{name}_{scmRevision}".format(name=library.name, scmRevision=scmRevision) | ||
304 | ourArchive.storePackage(packageName, fileName, scmRevision, extraMetadata) | 308 | ourArchive.storePackage(packageName, fileName, scmRevision, extraMetadata) |
This won't work in a Jenkins context, because it checks out the explicit revision it has determined needs to be built.
The branch itself isn't checked out.
I'd suggest making use of the --branchGroup parameter which is used by the other CI tools (and should be more reliable, because even if we've moved from 6.0 to 6.1 as the library version, if the SONAME hasn't changed, we still need to keep ABI compatibility)