Skip to content

Commit a7709f6

Browse files
authored
Merge pull request #836 from iangelak/808-remove-build_ext_parallel
fix: Remove build_ext_parallel feature
2 parents b15ad7b + df5b5f2 commit a7709f6

2 files changed

Lines changed: 11 additions & 20 deletions

File tree

src/fromager/packagesettings.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class BuildOptions(pydantic.BaseModel):
242242
243243
::
244244
245-
build_ext_parallel: False
245+
build_ext_parallel: False # DEPRECATED: ignored, will be removed
246246
cpu_cores_per_job: 1
247247
memory_per_job_gb: 1.0
248248
"""
@@ -252,8 +252,10 @@ class BuildOptions(pydantic.BaseModel):
252252
build_ext_parallel: bool = False
253253
"""Configure `build_ext[parallel]` in `DIST_EXTRA_CONFIG`
254254
255-
This enables parallel builds of setuptools extensions. Incompatible
256-
with some packages, e.g. numba 0.60.0.
255+
.. deprecated:: 0.72.0
256+
This option is deprecated and will be removed in a future release.
257+
The parallel build feature for extensions is unsafe due to race conditions.
258+
This option is now ignored and will emit a warning if set to True.
257259
"""
258260

259261
cpu_cores_per_job: int = Field(default=1, ge=1)

src/fromager/wheels.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import shutil
88
import sys
99
import tempfile
10-
import textwrap
1110
import typing
1211
import zipfile
1312

@@ -302,23 +301,13 @@ def build_wheel(
302301
build_env=build_env,
303302
)
304303

305-
if (
306-
pbi.build_ext_parallel
307-
and "DIST_EXTRA_CONFIG" not in extra_environ
308-
and "MAX_JOBS" in extra_environ
309-
):
310-
# configure setuptools to use parallel builds
311-
# https://setuptools.pypa.io/en/latest/deprecated/distutils/configfile.html
312-
dist_extra_cfg = build_env.path / "dist-extra.cfg"
313-
dist_extra_cfg.write_text(
314-
textwrap.dedent(
315-
f"""
316-
[build_ext]
317-
parallel = {extra_environ["MAX_JOBS"]}
318-
"""
319-
)
304+
if pbi.build_ext_parallel:
305+
logger.warning(
306+
"%s: build_ext_parallel is deprecated and will be removed in a "
307+
"future release. The parallel build feature for extensions is unsafe and "
308+
"can cause build failures or miscompiled wheels. This option is now ignored.",
309+
req.name,
320310
)
321-
extra_environ["DIST_EXTRA_CONFIG"] = str(dist_extra_cfg)
322311

323312
overrides.find_and_invoke(
324313
req.name,

0 commit comments

Comments
 (0)