From d2d9a06142bda448d533666cbc14f9508d15de06 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Thu, 14 Feb 2019 06:19:52 +0100
Subject: [PATCH] [build] Make base_build() accept bootstrap module as input
 parameter so it can be reused

---
 bob/devtools/build.py      | 8 +++++---
 bob/devtools/scripts/ci.py | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bob/devtools/build.py b/bob/devtools/build.py
index 3cf77542..709529a4 100644
--- a/bob/devtools/build.py
+++ b/bob/devtools/build.py
@@ -462,7 +462,7 @@ def git_clean_build(runner, verbose):
       ['--exclude=%s' % k for k in exclude_from_cleanup])
 
 
-def base_build(server, intranet, recipe_dir, conda_build_config,
+def base_build(bootstrap, server, intranet, recipe_dir, conda_build_config,
     python_version, condarc_options):
   '''Builds a non-beat/bob software dependence that does not exist on defaults
 
@@ -475,6 +475,8 @@ def base_build(server, intranet, recipe_dir, conda_build_config,
 
   Args:
 
+    bootstrap: Module that should be pre-loaded so this function can be used
+      in a pre-bdt build
     server: The base address of the server containing our conda channels
     intranet: Boolean indicating if we should add "private"/"public" prefixes
       on the returned paths
@@ -604,8 +606,8 @@ if __name__ == '__main__':
     if not os.path.exists(os.path.join(recipe, 'meta.yaml')):
       # ignore - not a conda package
       continue
-    base_build(server, not args.internet, recipe, conda_build_config,
-        args.python_version, condarc_options)
+    base_build(bootstrap, server, not args.internet, recipe,
+        conda_build_config, args.python_version, condarc_options)
 
   # notice this condarc typically will only contain the defaults channel - we
   # need to boost this up with more channels to get it right for this package's
diff --git a/bob/devtools/scripts/ci.py b/bob/devtools/scripts/ci.py
index 2fb24dbb..23128785 100644
--- a/bob/devtools/scripts/ci.py
+++ b/bob/devtools/scripts/ci.py
@@ -343,11 +343,13 @@ def base_build(order, dry_run):
       line = line.partition('#')[0].strip()
       if line: recipes.append(line)
 
+  from .. import bootstrap
+
   for recipe in recipes:
     if not os.path.exists(os.path.join(recipe, 'meta.yaml')):
       # ignore - not a conda package
       continue
-    _build(SERVER, True, recipe, CONDA_BUILD_CONFIG,
+    _build(bootstrap, SERVER, True, recipe, CONDA_BUILD_CONFIG,
         os.environ['PYTHON_VERSION'], condarc_options)
 
 
-- 
GitLab