<table><tr><td style="">knauss added a comment.
</td></tr></table><br /><div><div><p><a href="https://phabricator.kde.org/p/bcooksley/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@bcooksley</a> for akonadi-search we need some special settings for the abi-create step. Where we should store such settings?</p>
<p>This is a more general solution, that we can also modify the settings for other platforms etc.</p>
<p><tt style="background: #ebebeb; font-size: 13px;">ci-tooling/local-metadata/abi-complience-checker.yaml</tt>:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">gcc_options:
- "-std=c++11"
- "-fPIC"
skip_include_paths:
- /usr/lib/python3.6/site-packages/utils/fake_libc_include
- /usr/include/clang/AST
- /usr/lib64/clang/6.0.1/include
add_include_paths:
- /usr/lib64/qt5/mkspecs/linux-g++
# "SUSEQt5.10": # platform specific
# gcc_options:
# - "-DSUSE5.10"
#"kde/*": # special settings for all repos in kde (fnmatch)
# gcc_options:
# - "-DKDE"
#"kde/pim/*": # special settings for all repos in kde/pim
# gcc_options:
# - "-DKDEPIM"
# "SUSEQt5.10": # for one specific platform
# gcc_options:
# - "-DKDEPIMSUSEQT5.10"
"kde/pim/akonadi-search": # for one repo
"SUSEQt5.10": # for one specific platform
gcc_options:
- "-std=c++11"
- "-fPIC"
- "-DQT_NO_KEYWORDS"</pre></div>
<p>and the Python code to handle this:<br />
rules are:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">anthing overwrites defauls (outer level)</li>
<li class="remarkup-list-item">most matching path overwrites less matching path</li>
<li class="remarkup-list-item">platform specific overwrites non platform stuff</li>
</ul>
<p>general -> specific<br />
default -> "basepath/*" -> "basepath/* - platform" -> "basepath/repo" -> "basepath/* - platform"</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">import yaml, fnmatch, copy
metadata = yaml.load(open('local-metadata/abi-complience-checker.yaml'))
def getSettings(path, platform):
entries = []
for key in metadata:
if fnmatch.fnmatch(path, key):
entries.append(key)
# sorting all entries - the entries at the end overwrites the former settings
# len is efficient, but would fail if we have single letter repo names
entries.sort(key=len)
entries.insert(0, platform) # add platform settings at the start
d = copy.copy(metadata) # load default settings
for entry in entries:
try:
content = metadata[entry]
d.update(content)
d.update(content[platform]) # try to load platform specific settings
except KeyError:
pass
return d
getSettings("kde/pim/akonadi-search", "SUSEQt5.10")</pre></div></div></div><br /><div><strong>TASK DETAIL</strong><div><a href="https://phabricator.kde.org/T3689">https://phabricator.kde.org/T3689</a></div></div><br /><div><strong>To: </strong>knauss<br /><strong>Cc: </strong>dfaure, kde-frameworks-devel, bcooksley, sysadmin, scarlettclark, aacid, knauss, alexeymin, kaning, blazquez<br /></div>