Skip to content

rust.test() target fails to link with lib in non-standard path #14622

@leftmostcat

Description

@leftmostcat

Describe the bug
I am building mesa against LLVMSPIRVLib installed in a user prefix, with --pkg-config-path specified in the configuration. A full build of main succeeds. However, adding a rust.test() against an existing static Rust lib requiring LLVMSPIRVLib causes link to fail.

The resulting compile command adds -Clink-arg=${INSTALL_PATH}/libLLVMSPIRVLib.a to the rustc command; it does not add a -L${INSTALL_PATH}. The final cc includes both -l:libLLVMSPIRVLib.a and ${INSTALL_PATH}/libLLVMSPIRVLib.a, and the lack of -L causes it to be unable to find libLLVMSPIRVLib.a.

To Reproduce

Expected behavior
The test should successfully link.

system parameters

  • Fedora 42, native build
  • Python: 3.13.3
  • Meson: 1.8.0
  • Ninja: 1.12.1
  • Rust: 1.86.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions