Skip to content

fix: abi3 run export handling for pixi-build-python - #5751

Merged
baszalmstra merged 6 commits into
prefix-dev:mainfrom
pavelzw:abi3
Jun 19, 2026
Merged

fix: abi3 run export handling for pixi-build-python#5751
baszalmstra merged 6 commits into
prefix-dev:mainfrom
pavelzw:abi3

Conversation

@pavelzw

@pavelzw pavelzw commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix ABI3 dependency handling in pixi-build-python.

When abi3 = true, pixi was still producing a python_abi X.Y.* *_cpXY run dependency via the weak run export from host: python, even though the recipe was marked build.python.version_independent: true.

Root cause

pixi-build-python was mixing two different models for ABI3 packages:

  • it set build.python.version_independent = true
  • but it also treated ABI3 like a normal CPython extension build by adding python_abi logic / allowing host: python run exports to propagate

That caused regular CPython ABI pins to still appear in the resolved run dependencies.

Changes

  • stop treating abi3 = true as a python_abi host pin
  • for ABI3 builds, add ignore_run_exports.from_package = ["python"] so host: python does not inject the normal python_abi run export
  • extend the stage0/intermediate recipe model to carry and serialize ignore_run_exports
  • update pixi-build-python docs to describe the correct ABI3 behavior
  • update tests to cover the new generated recipe behavior

Result

ABI3 builds now:

  • remain version_independent
  • no longer inherit python's CPython ABI pin
  • rely on the explicit python-abi3 host dependency for ABI3-compatible run exports

Fixes conda/rattler#2197 (comment)

How Has This Been Tested?

i built py-rattler on conda/rattler#2197 using this build backend and got the following run dependencies

 │ │ Resolved run dependencies(py-rattler-0.23.2-h60d57d3_0):
 │ │ ╭──────────────────────┬────────────────────────────────────────╮
 │ │ │ Name                 ┆ Spec                                   │
 │ │ ╞══════════════════════╪════════════════════════════════════════╡
 │ │ │ Run dependencies     ┆                                        │
 │ │ │ _python_abi3_support ┆ 1.* (RE of [host: python-abi3])        │
 │ │ │ cpython              ┆ >=3.10 (RE of [host: python-abi3])     │
 │ │ │ python               ┆ >=3.10                                 │
 │ │ │                      ┆                                        │
 │ │ │ Run constraints      ┆                                        │
 │ │ │ __osx                ┆ >=11.0 (RE of [build: rust_osx-arm64]) │
 │ │ ╰──────────────────────┴────────────────────────────────────────╯

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: codex

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@pavelzw pavelzw changed the title Fix abi3 run export handling for pixi-build-python fix: abi3 run export handling for pixi-build-python Mar 22, 2026
@baszalmstra

Copy link
Copy Markdown
Contributor

Let me check this on Tuesday. I think we still need the lower/upperbound check.

@pavelzw

pavelzw commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator Author

i also still need to look at the code here, this was entirely done by codex apart from my prompt

@baszalmstra

Copy link
Copy Markdown
Contributor

Hey @pavelzw, do you think you have time to take another look at this? I would love to make py-rattler a proper pixi package.

@pavelzw

pavelzw commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Yeah I think I can take a look, latest on the weekend.
There was still one pixi bug iirc

pavelzw added 3 commits June 13, 2026 20:13
# Conflicts:
#	crates/pixi_build_backend/src/specs_conversion.rs
#	crates/pixi_build_python/src/main.rs
#	crates/recipe_stage0/src/marked_yaml.rs
#	crates/recipe_stage0/src/recipe.rs
#	pixi-build-backends/py-pixi-build-backend/src/recipe_stage0/recipe.rs
@pavelzw
pavelzw marked this pull request as ready for review June 13, 2026 21:15
@pavelzw

pavelzw commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

updated the PR @baszalmstra, ready for review from my side. verified by building py-rattler with this version and got the following run dependencies in conda/rattler#2197

 │ │ Resolved run dependencies(py-rattler-0.23.2-h60d57d3_0):
 │ │ ╭──────────────────────┬────────────────────────────────────────╮
 │ │ │ Name                 ┆ Spec                                   │
 │ │ ╞══════════════════════╪════════════════════════════════════════╡
 │ │ │ Run dependencies     ┆                                        │
 │ │ │ _python_abi3_support ┆ 1.* (RE of [host: python-abi3])        │
 │ │ │ cpython              ┆ >=3.10 (RE of [host: python-abi3])     │
 │ │ │ python               ┆ >=3.10                                 │
 │ │ │                      ┆                                        │
 │ │ │ Run constraints      ┆                                        │
 │ │ │ __osx                ┆ >=11.0 (RE of [build: rust_osx-arm64]) │
 │ │ ╰──────────────────────┴────────────────────────────────────────╯

@pavelzw
pavelzw requested a review from baszalmstra June 13, 2026 21:20
@baszalmstra
baszalmstra merged commit ea4566d into prefix-dev:main Jun 19, 2026
41 checks passed
@pavelzw
pavelzw deleted the abi3 branch June 19, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants