From f73f761a94d486514f91fb15ad784f826089b91d Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Wed, 17 Feb 2021 16:30:34 +0100
Subject: [PATCH] HLTUtils: fix unit test for clang build

Our clang builds are currently building against the gcc tdaq builds and
there is not 'clang' platform tag in OKS. Simply revert to a (random)
existing tag to make the SW repository generation work. But this will
obviously not be usable in a partition.

Fixes ATR-22849.
---
 HLT/HLTUtils/share/make_hlt_rep.py | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/HLT/HLTUtils/share/make_hlt_rep.py b/HLT/HLTUtils/share/make_hlt_rep.py
index 1d4ece4677e..9dc41a80a2b 100755
--- a/HLT/HLTUtils/share/make_hlt_rep.py
+++ b/HLT/HLTUtils/share/make_hlt_rep.py
@@ -1,13 +1,9 @@
 #!/usr/bin/env python
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 import optparse
 import os
 
-# Make sure getoutput() is in the subprocess module.
-from future import standard_library
-standard_library.install_aliases()
-
 import pm.project
 import pm.common
 
@@ -107,11 +103,19 @@ apps = [
 ]
 
 
+# Workaround for clang build (ATR-22849)
+try:
+    tag = pm.common.tdaqRepository.getObject('Tag',hltOksUtils.platform())
+except RuntimeError:
+    tag = pm.common.tdaqRepository.getObject('Tag')[0]
+    print('Cannot find tag %s in OKS. Using %s instead. Please fix manually.' %
+          (hltOksUtils.platform(), tag.id))
+
 hltRep = dal.SW_Repository('%s-Repository' % prefix,
                            Name=('%s-Repository' % prefix),
                            InstallationPath="%s/InstallArea" % os.environ.get('AtlasArea'),
                            SW_Objects=apps,
-                           Tags=[pm.common.tdaqRepository.getObject('Tag',hltOksUtils.platform())],
+                           Tags=[tag],
                            ISInfoDescriptionFiles=[os.path.join(platform,'share/data/daq/schema/is_trigconf_hlt.schema.xml')],
                            AddProcessEnvironment = swvars
                            )
-- 
GitLab