Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support to run build for recipes with linux-aarch64 additional-platforms #923

Merged
merged 5 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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