Skip to content

Support for generated sources, when building out of tree with non-cargo build systems #78913

Closed
@dcbaker

Description

@dcbaker

For build systems other than cargo, it is generally considered best practice to build out of tree (ie, generated files go into a directory that is not tracked by version control). With rustc this works great, except when you need to generate rust sources. In that case a build system (meson in this case, but cmake and gnu autotools would be affected too) will place the generated .rs file in the build tree, while the hard written sources are in the source tree. As far as I can find there is no way to tell rustc about this and get it to compile successfully, without resorting to ugly hacks like "copy all of the files from the source tree to the build tree." While this can work, it's rather ugly and error prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions