Skip to content

"can't find crate" when building Rust proc macro with remote execution #1206

@cbarrete

Description

@cbarrete

When building some proc macros with remote execution, rustc fails with the following error:

error[E0463]: can't find crate for `pyo3_macros_backend`
 --> third_party/pyo3-macros-0.26.0.crate/src/lib.rs:7:5
  |
7 | use pyo3_macros_backend::{
  |     ^^^^^^^^^^^^^^^^^^^ can't find crate

Note that this is not an issue with most proc macros, nor with local builds.
It seems like the .rlib for a dependency of the proc macro is not made available to it, presumably due to a bug in how dependencies are managed, or how the target/exec platforms are transitioned.

I have created a minimal repro at https://github.com/cbarrete/pyo3_repro. It should "work" out of the box on non-exotic Linux systems.

This may or may not be related to #1198.

I have tried messing with the BUCK file generated by Reindeer, but that made no difference, so I doubt that Reindeer is at fault here. I can file an issue for it if necessary though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions