Skip to content

Add a method for a dependency to 'push' an artifact up the dependency tree #5644

Open
@zacps

Description

Motivation: alacritty/alacritty#1374 (comment)

In the case above our binary crate depends on another binary (winpty-agent) which is built by one of it's dependants. At the moment there is no easy way for our crate to access artifacts produced in a dependencies target directory, unless it's a library linked by cargo.

alacritty <- Binary needed here
    winpty
        winpty-sys <- Binary built here

My suggestion is too add an output to the build script called 'publishes' which contains a name of an artifact produced by the build script. Setting this will make cargo copy it into any crates which require it as a dependency. In this scenario winpty-sys AND winpty would set publishes to the name of the binary. It would be copied into winpty's target directory, then into alacritty's target directory.

Metadata

Assignees

No one assigned

    Labels

    A-crate-dependenciesArea: [dependencies] of any kindC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-rfcStatus: Needs an RFC to make progress.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions