(build_order, python_modules, ctx, project_dir,
ignore_project_setup_py=False
)
| 486 | |
| 487 | |
| 488 | def build_recipes(build_order, python_modules, ctx, project_dir, |
| 489 | ignore_project_setup_py=False |
| 490 | ): |
| 491 | # Put recipes in correct build order |
| 492 | info_notify("Recipe build order is {}".format(build_order)) |
| 493 | if python_modules: |
| 494 | python_modules = sorted(set(python_modules)) |
| 495 | info_notify( |
| 496 | ('The requirements ({}) were not found as recipes, they will be ' |
| 497 | 'installed with pip.').format(', '.join(python_modules))) |
| 498 | |
| 499 | recipes = [Recipe.get_recipe(name, ctx) for name in build_order] |
| 500 | |
| 501 | # download is arch independent |
| 502 | info_main('# Downloading recipes ') |
| 503 | for recipe in recipes: |
| 504 | recipe.download_if_necessary() |
| 505 | |
| 506 | for arch in ctx.archs: |
| 507 | info_main('# Building all recipes for arch {}'.format(arch.arch)) |
| 508 | |
| 509 | info_main('# Unpacking recipes') |
| 510 | for recipe in recipes: |
| 511 | ensure_dir(recipe.get_build_container_dir(arch.arch)) |
| 512 | recipe.prepare_build_dir(arch.arch) |
| 513 | |
| 514 | info_main('# Prebuilding recipes') |
| 515 | # ensure we have `ctx.python_recipe` and `ctx.hostpython` |
| 516 | Recipe.get_recipe("python3", ctx).prebuild_arch(arch) |
| 517 | ctx.hostpython = Recipe.get_recipe("hostpython3", ctx).python_exe |
| 518 | |
| 519 | # 2) prebuild packages |
| 520 | for recipe in recipes: |
| 521 | info_main('Prebuilding {} for {}'.format(recipe.name, arch.arch)) |
| 522 | recipe.prebuild_arch(arch) |
| 523 | recipe.apply_patches(arch) |
| 524 | |
| 525 | # 3) build packages |
| 526 | info_main('# Building recipes') |
| 527 | for recipe in recipes: |
| 528 | info_main('Building {} for {}'.format(recipe.name, arch.arch)) |
| 529 | if recipe.should_build(arch): |
| 530 | recipe.build_arch(arch) |
| 531 | else: |
| 532 | info('{} said it is already built, skipping' |
| 533 | .format(recipe.name)) |
| 534 | recipe.install_libraries(arch) |
| 535 | |
| 536 | # 4) biglink everything |
| 537 | info_main('# Biglinking object files') |
| 538 | if not ctx.python_recipe: |
| 539 | biglink(ctx, arch) |
| 540 | else: |
| 541 | warning( |
| 542 | "Context's python recipe found, " |
| 543 | "skipping biglink (will this work?)" |
| 544 | ) |
| 545 |
no test coverage detected