Skip to content

Rust Analyzer <-> Maturin interaction #2479

Open
@ion-elgreco

Description

@ion-elgreco

Bug Description

In delta-rs we have a .cargo/config.toml in the root and .carg/config.toml in our python subcrate.

Both of the following rustflags:

[target.aarch64-apple-darwin]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]

Running plain maturin develop will invalidate the incremental compilation.

Only if I manually provide the RUSTFLAGS it works:

RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" maturin develop

Shouldn't maturin use the .cargo/config.toml during maturin develop

Your maturin version (maturin --version)

1.8.2

Your Python version (python -V)

3.11

Your pip version (pip -V)

UV is used

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Create crate with above config
  2. Use VSCode with Rust Analyzer (RA)
  3. Let RA run Cargo check
  4. Now run maturin develop
  5. Change .rs file and save which triggers cargo check
  6. Run maturin develop again (notice it starts from beginning)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions