Skip to content

Commit

Permalink
feat: add support to run build for recipes with additional-platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Yikun committed Oct 9, 2023
1 parent e8e60a3 commit c0cd9c2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bioconda_utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from . import upload
from . import lint
from . import graph
from . import recipe as _recipe

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -355,7 +356,21 @@ def build_recipes(recipe_folder: str, config_path: str, recipes: List[str],
skipped_recipes = []
failed_uploads = []

def skip_additional_platform():
recipe_obj = _recipe.Recipe.from_file(recipe_folder, recipe)
native_platform = utils.RepoData().native_platform()
# On linux-aarch64 env, only build recipe with linux-aarch64 additional_platforms
if native_platform == "linux-aarch64":
if "linux-aarch64" not in recipe_obj.extra_additional_platforms:
logger.info("BUILD SKIP: skipping %s for %s platform", recipe, native_platform)
return True
return False

for recipe, name in recipes:
# If not force, skip recipes that are not for this platform
if not force and skip_additional_platform():
continue

if name in skip_dependent:
logger.info('BUILD SKIP: skipping %s because it depends on %s '
'which had a failed build.',
Expand Down
7 changes: 7 additions & 0 deletions bioconda_utils/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ def maintainers(self):
return utils.ensure_list(self.meta['extra']['recipe-maintainers'])
return []

@property
def extra_additional_platforms(self) -> list:
"""The extra additional-platforms list"""
if 'extra' in self.meta and 'additional-platforms' in self.meta['extra']:
return list(self.meta["extra"]["additional-platforms"])
return []

@property
def name(self) -> str:
"""The name of the toplevel package built by this recipe"""
Expand Down

0 comments on commit c0cd9c2

Please sign in to comment.