Skip to content

feat: support maturin alternate src layout#920

Merged
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
tiran:maturin-alt-src
Feb 25, 2026
Merged

feat: support maturin alternate src layout#920
mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
tiran:maturin-alt-src

Conversation

@tiran
Copy link
Copy Markdown
Collaborator

@tiran tiran commented Feb 24, 2026

Implement support for maturin's alternate src layout for vendored Rust crates. The alt src layout has Cargo.toml and .cargo directory in a rust directory. The alt src layout is used by pendulum package.

See: https://www.maturin.rs/project_layout.html#alternate-python-source-directory-src-layout

@tiran tiran requested a review from a team as a code owner February 24, 2026 07:18
@tiran
Copy link
Copy Markdown
Collaborator Author

tiran commented Feb 24, 2026

PR is blocked by #921

Implement support for maturin's alternate src layout for vendored Rust
crates. The alt src layout has `Cargo.toml` and `.cargo` directory in a
`rust` directory. The alt src layout is used by `pendulum` package.

See: https://www.maturin.rs/project_layout.html#alternate-python-source-directory-src-layout

Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
Copy link
Copy Markdown
Collaborator Author

tiran commented Feb 25, 2026

With the fix, I'm able to build pendulum:

$ pip install git+https://github.com/tiran/fromager.git@maturin-alt-src
$ fromager bootstrap pendulum
...
13:42:44 INFO pendulum: downloading source for pendulum
13:42:44 INFO pendulum: saved /opt/app-root/src/sdists-repo/downloads/pendulum-3.2.0.tar.gz
13:42:44 INFO pendulum: preparing source for pendulum from /opt/app-root/src/sdists-repo/downloads/pendulum-3.2.0.tar.gz
13:42:44 INFO pendulum: Use maturin's alternative src layout and alt rust root dir /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0/rust
13:42:44 INFO pendulum: updating vendored rust dependencies in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0/rust
13:42:46 INFO pendulum: prepared source for pendulum at /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0
13:42:46 INFO pendulum: created build environment in /opt/app-root/src/work-dir/pendulum-3.2.0/build-3.12.9
...
13:44:06 INFO pendulum: getting build backend dependencies for pendulum in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0
13:44:06 INFO pendulum: getting build sdist dependencies for pendulum in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0
13:44:06 INFO pendulum: looking for build sdist dependencies in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0
13:44:06 INFO pendulum: building cpu-ubi9 source distribution for pendulum in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0
13:44:08 INFO pendulum: built source distribution /opt/app-root/src/sdists-repo/builds/pendulum-3.2.0.tar.gz
13:44:08 INFO pendulum: starting build of toplevel dependency pendulum (3.2.0) for cpu-ubi9
13:44:08 INFO pendulum: building cpu-ubi9 wheel for pendulum in /opt/app-root/src/work-dir/pendulum-3.2.0/pendulum-3.2.0 writing to /opt/app-root/src/wheels-repo/build

13:44:27 INFO pendulum: Requires libraries: libc.so.6, libgcc_s.so.1
13:44:27 INFO pendulum: added extra metadata and build tag (0, ''), wheel renamed from pendulum-3.2.0-cp312-cp312-linux_x86_64.whl to pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl
13:44:27 INFO pendulum: adding pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl to local wheel server
13:44:27 INFO pendulum: built wheel for version 3.2.0: /opt/app-root/src/wheels-repo/downloads/pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl
13:44:27 INFO pendulum: starting post_bootstrap hooks for pendulum==3.2.0, sdist: /opt/app-root/src/sdists-repo/builds/pendulum-3.2.0.tar.gz, wheel_filename: /opt/app-root/src/wheels-repo/downloa
ds/pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl
13:44:27 INFO pendulum: pendulum: sdist filename 'pendulum-3.2.0.tar.gz' has expected name 'pendulum' and version 3.2.0
13:44:27 INFO pendulum: pendulum: wheel filename 'pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl' has expected name 'pendulum' and version 3.2.0
13:44:27 INFO pendulum: getting installation dependencies from /opt/app-root/src/wheels-repo/downloads/pendulum-3.2.0-0-cp312-cp312-linux_x86_64.whl
13:44:27 INFO pendulum: adding ('pendulum', '3.2.0') to build order

Copy link
Copy Markdown
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@mergify mergify Bot merged commit f4a13d0 into python-wheel-build:main Feb 25, 2026
47 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.

4 participants