Skip to content

Commit 8b72279

Browse files
committed
Allow build requirements to be used in the rebuild graph
1 parent 5d47212 commit 8b72279

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ __migrator:
160160
- package1
161161
- package2
162162

163+
# The bot only looks at host/run requirements of a recipe to determine which feedstocks
164+
# to migrate to. This option is added to make the bot look at build requirements too.
165+
# This is only needed when doing a migration for a package with a strong run exports.
166+
# i.e. for a compiler.
167+
include_build_requirements: false
168+
163169
# If this key is set to dict, the conda-forge.yml will be modified by the migration
164170
# with the contents of this dict. This can be used to add keys to the conda-forge.yml
165171
# or to change them. You can replace subkeys by using a dot in the key name (e.g., `a.b.c`
@@ -182,7 +188,7 @@ __migrator:
182188
# natural version ordering. Each changed pin can be mapped to a list
183189
# that determines the ordering. The highest (e.g., item with highest list index)
184190
# version is kept for version migrations.
185-
oridering:
191+
ordering:
186192
pin1:
187193
- value1
188194
- value2

conda_forge_tick/make_graph.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
"cxx_compiler_stub",
4646
"fortran_compiler_stub",
4747
"cuda_compiler_stub",
48+
"m2w64_c_compiler_stub",
49+
"m2w64_c_stdlib_stub",
50+
"m2w64_cxx_compiler_stub",
51+
"m2w64_fortran_compiler_stub",
4852
]
4953

5054

conda_forge_tick/make_migrators.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def add_rebuild_migration_yaml(
218218
nominal_pr_limit: int = PR_LIMIT,
219219
max_solver_attempts: int = 3,
220220
force_pr_after_solver_attempts: int = MAX_SOLVER_ATTEMPTS * 2,
221+
include_build_requirements: bool = False,
221222
) -> None:
222223
"""Adds rebuild migrator.
223224
@@ -245,6 +246,8 @@ def add_rebuild_migration_yaml(
245246
The number of PRs per hour, defaults to 5
246247
force_pr_after_solver_attempts : int, optional
247248
The number of solver attempts after which to force a PR, defaults to 100.
249+
include_build_requirements : bool, optional
250+
Check build requirements for package_names, defaults to false.
248251
"""
249252

250253
total_graph = create_rebuild_graph(
@@ -253,6 +256,7 @@ def add_rebuild_migration_yaml(
253256
excluded_feedstocks,
254257
exclude_pinned_pkgs=exclude_pinned_pkgs,
255258
include_noarch=config.get("include_noarch", False),
259+
include_build_requirements=include_build_requirements,
256260
)
257261

258262
# Note at this point the graph is made of all packages that have a
@@ -439,6 +443,9 @@ def migration_factory(
439443
set(loaded_yaml) | {ly.replace("_", "-") for ly in loaded_yaml}
440444
) & all_package_names
441445
exclude_pinned_pkgs = migrator_config.get("exclude_pinned_pkgs", True)
446+
include_build_requirements = migrator_config.get(
447+
"include_build_requirements", False
448+
)
442449

443450
age = time.time() - loaded_yaml.get("migrator_ts", time.time())
444451
age /= 24 * 60 * 60
@@ -480,6 +487,7 @@ def migration_factory(
480487
nominal_pr_limit=_pr_limit,
481488
max_solver_attempts=max_solver_attempts,
482489
force_pr_after_solver_attempts=force_pr_after_solver_attempts,
490+
include_build_requirements=include_build_requirements,
483491
)
484492
if skip_solver_checks:
485493
assert not migrators[-1].check_solvable

conda_forge_tick/migrators/migration_yaml.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ def create_rebuild_graph(
648648
excluded_feedstocks: MutableSet[str] = None,
649649
exclude_pinned_pkgs: bool = True,
650650
include_noarch: bool = False,
651+
include_build_requirements: bool = False,
651652
) -> nx.DiGraph:
652653
total_graph = copy.deepcopy(gx)
653654
excluded_feedstocks = set() if excluded_feedstocks is None else excluded_feedstocks
@@ -669,6 +670,8 @@ def create_rebuild_graph(
669670
host = requirements.get("host", set())
670671
build = requirements.get("build", set())
671672
bh = host or build
673+
if include_build_requirements:
674+
bh = bh | build
672675
only_python = "python" in package_names
673676
inclusion_criteria = bh & set(package_names) and (
674677
include_noarch or not all_noarch(attrs, only_python=only_python)
@@ -678,7 +681,7 @@ def create_rebuild_graph(
678681
all_reqs = requirements.get("run", set())
679682
if inclusion_criteria:
680683
all_reqs = all_reqs | requirements.get("test", set())
681-
all_reqs = all_reqs | (host or build)
684+
all_reqs = all_reqs | bh
682685
rq = get_deps_from_outputs_lut(
683686
all_reqs,
684687
gx.graph["outputs_lut"],

0 commit comments

Comments
 (0)