Skip to content

docs: Add crosscompiling example#5793

Merged
ruben-arts merged 6 commits intoprefix-dev:mainfrom
toprinse:add_crosscompiling_example
Apr 17, 2026
Merged

docs: Add crosscompiling example#5793
ruben-arts merged 6 commits intoprefix-dev:mainfrom
toprinse:add_crosscompiling_example

Conversation

@toprinse
Copy link
Copy Markdown
Contributor

Description

Following a discussion on Discord about cross-compiling with nanobind, we identified a working solution based on the pixi-build-rattler-build backend. This issue proposes adding a dedicated example to the documentation to help others facing the same challenge.

Cross-compiling Python extensions with nanobind can be non-trivial, especially when targeting platforms different from the build environment. The approach we explored leverages the pixi-build-rattler-build backend to handle dependencies and build configuration in a reproducible way.

Including a minimal, well-documented example would:

  • Provide a clear reference for setting up cross-compilation with nanobind
  • Reduce friction for users encountering similar issues
  • Complement the existing documentation with a practical use case

You can find in this PR the example, that as been tested locally and fully woking.

Copy link
Copy Markdown
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the write up! I would like to ask @wolfv to review the content more.

Comment thread docs/build/cross_compilation.md Outdated
Comment on lines +295 to +296
unzip -q output/YOUR_PACKAGE.conda -d tmp && \
tar --use-compress-program=unzstd -xf tmp/info-*.tar.zst -C tmp && \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you know you could do this part with rattler-build package extract?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know that this was possible ! I will give it a try and update the documentation

Copy link
Copy Markdown
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the review delay. Nice work, thanks!

@ruben-arts ruben-arts merged commit e286034 into prefix-dev:main Apr 17, 2026
41 checks passed
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