Skip to content

Vendoring Rust code does not use build_dir #954

@tiran

Description

@tiran

The prepare_new_source function calls vendor_rust with sdist_root_dir as project root directory:

def prepare_new_source(
ctx: context.WorkContext,
req: Requirement,
source_root_dir: pathlib.Path,
version: Version,
) -> None:
"""Default steps for new sources
- patch sources
- apply project overrides from settings
- vendor Rust dependencies
:func:`~default_prepare_source` runs this function when the sources are new.
"""
patch_source(ctx, source_root_dir, req, version)
pyproject.apply_project_override(
ctx=ctx,
req=req,
sdist_root_dir=source_root_dir,
)
vendor_rust.vendor_rust(req, source_root_dir)

This breaks packages that use the build_dir option for an alternative location for pyproject.toml. prepare_new_source should vendor Rust code with pbi.build_dir(sdist_root_dir) instead.

The package primp with build_dir crates/primp-python is affected by the bug, https://github.com/deedy5/primp/tree/v1.1.2/crates/primp-python

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingimportantImportant task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions