Skip to content
Snippets Groups Projects
Commit e426392f authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

account for build_only deps

parent 298c7c03
No related branches found
No related tags found
1 merge request!63Conda package based CI
...@@ -15,6 +15,11 @@ RUN_EXPORTS = [ ...@@ -15,6 +15,11 @@ RUN_EXPORTS = [
' - libblitz\n', ' - libblitz\n',
] ]
BUILD_ONLY_DEPS = [
' - pkg-config {{ pkg_config }}\n',
' - cmake {{ cmake }}\n',
]
def extract_requirements_text(path): def extract_requirements_text(path):
text = "" text = ""
...@@ -111,21 +116,23 @@ def migrate(template_recipe_path, old_recipe_path, build_variant_path, ...@@ -111,21 +116,23 @@ def migrate(template_recipe_path, old_recipe_path, build_variant_path,
"- {{ compiler('c') }}\n", "- {{ compiler('c') }}\n",
"- {{ compiler('cxx') }}\n", "- {{ compiler('cxx') }}\n",
] ]
requires_compilers = 'toolchain' in host_text or build_text
for line in already_build: for line in already_build:
host_text = host_text.replace(line, '') host_text = host_text.replace(line, '')
host_text = host_text.strip() host_text = host_text.strip()
if host_text: if host_text:
host_text = ' ' + host_text + '\n' host_text = ' ' + host_text + '\n'
host_text = add_variant(host_text, star=False) host_text = add_variant(host_text, star=False)
# normalize build_text
build_text = build_text.rstrip()
if build_text:
build_text = ' build:\n' + build_text + '\n'
# remove BUILD_ONLY_DEPS from host and put it in build_text
for p in BUILD_ONLY_DEPS:
if p in host_text:
host_text = host_text.replace(p, '')
build_text += p
final_recipe = final_recipe.replace(' <HOST_DEPS>\n', host_text) final_recipe = final_recipe.replace(' <HOST_DEPS>\n', host_text)
if requires_compilers: final_recipe = final_recipe.replace(' <BUILD_DEPS>\n', build_text)
final_recipe = final_recipe.replace(' <BUILD_DEPS>\n', ''' build:
- {{ compiler('c')}}
- {{ compiler('cxx')}}
''')
else:
final_recipe = final_recipe.replace(' <BUILD_DEPS>\n', '')
run_text = requirements_text[i2 + 5:] run_text = requirements_text[i2 + 5:]
for line in already_build[:2] + RUN_EXPORTS: for line in already_build[:2] + RUN_EXPORTS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment