Way for dependencies to read configuration from dependents/access dependent's manifest directory #9977
Labels
A-build-scripts
Area: build.rs scripts
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-propose-close
Status: A team member has nominated this for closing, pending further input from the team
Problem
I was working on a project and I needed a way for my crate to be able to be customized based on a configuration file from the dependent, via
build.rs
. The configuration would be to add extra fields to structs, as they will be present in actual builds due to a custom build system (which also reads from those config files and adds the fields). This is for the sake of IDEs properly error reporting.Proposed Solution
The build script is given an environment variable such as
CARGO_DEPENDENT
, which contains the dependent crates' manifests' paths separated by commas.Notes
If this isn't practical, is there any other way to achieve the specific use case I'm trying to do here?
The text was updated successfully, but these errors were encountered: