Skip cibuildwheel for dev-requirement wheels with C extensions#47090
Open
l0lawrence wants to merge 1 commit into
Open
Skip cibuildwheel for dev-requirement wheels with C extensions#47090l0lawrence wants to merge 1 commit into
l0lawrence wants to merge 1 commit into
Conversation
`cibuildwheel` downloads its own CPython from nuget.org which is not reachable from internal 1ES pool agents (egress returns RFC-5737 sinkhole IPs). For dev-requirement builds the wheel only needs to install into the current venv, so opt out of cibuildwheel and let `setup.py bdist_wheel` run with the invoking Python. Release builds (`build_packages`) keep the default behavior so they continue to produce the abi3 wheel via cibuildwheel on agents that can reach nuget.org. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Azure SDK Python tooling used in CI to avoid using cibuildwheel when building wheels for dev-requirements that include C extensions (notably azure-storage-extensions), addressing failures on internal Windows agents that cannot reach api.nuget.org.
Changes:
- Added a
use_cibuildwheelflag toci_tools.build.create_package(defaulting toTrueto preserve release behavior). - Updated dev-requirements wheel building (
build_whl_for_req) to callcreate_package(..., use_cibuildwheel=False)so C-extension wheels are built with the invoking Python instead ofcibuildwheel.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/tools/azure-sdk-tools/ci_tools/scenario/generation.py | Disables cibuildwheel when building dev-requirements wheels so builds work on restricted internal agents. |
| eng/tools/azure-sdk-tools/ci_tools/build.py | Introduces use_cibuildwheel and gates the cibuildwheel path for extension-module wheels behind this flag. |
Comment on lines
+354
to
+357
| # Python versions; it downloads its own CPython from nuget.org which is not | ||
| # reachable from all CI agents. For dev-requirements builds the wheel only needs | ||
| # to install into the current venv, so opt out of ``cibuildwheel`` here and let | ||
| # ``setup.py bdist_wheel`` run with the invoking Python. |
Comment on lines
+231
to
+235
| When ``use_cibuildwheel`` is False, packages with C extension modules are built with the | ||
| invoking Python via ``setup.py bdist_wheel`` instead of ``cibuildwheel``. This is the | ||
| appropriate choice when the wheel is only consumed by the current venv (e.g. dev-requirement | ||
| installs in CI), since ``cibuildwheel`` otherwise downloads a fresh CPython from nuget.org | ||
| which is not reachable from all CI agents. |
Member
Author
|
/azp run python - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The internal storage SDK pipeline fails on every PR that touches a package whose
dev_requirements.txtincludesazure-storage-extensions(e.g.azure-storage-queue,azure-storage-blob,azure-storage-file-datalake).The failure occurs in
dispatch_checks.py→replace_dev_reqs→build_whl_for_req→create_package. Becauseazure-storage-extensionsdefines acrc64C extension module,create_packageroutes the wheel build throughcibuildwheel. On Windows,cibuildwheeldownloads its own CPython fromapi.nuget.orgvia NuGet, but the internal 1ES pool agents block outbound toapi.nuget.org(DNS returns RFC-5737 sinkhole192.0.2.9and the firewall denies the connection):Fix
cibuildwheelis designed for producing release artifacts that span multiple Python versions and ABIs. For dev-requirement builds, the wheel only needs to install into the current test venv with the current Python — so the cibuildwheel-driven download of an isolated CPython is unnecessary.This PR adds a
use_cibuildwheelparameter tocreate_package(defaulting toTrueso release builds keep using cibuildwheel) and hasbuild_whl_for_req(the dev-requirements path) passuse_cibuildwheel=False. When the flag is off and the package hasext_modules, the build falls through tosetup.py bdist_wheelwith the invoking Python, which works fine in-venv and needs no nuget.org access.Impact
build_packages): unchanged — still produces the abi3 wheel forazure-storage-extensionsvia cibuildwheel on the public-CI agent that can reach nuget.org.build_whl_for_req): now build the local ext-module package with the invoking Python — no nuget download, works on the internal 1ES pool.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com