-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Cargo should support configuration in non-hidden files. #8244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Adding @ppannuto from the Tock project. |
It's not just Putting critical build configuration in files that standard tools will not find makes discovery very challenging for new and even experienced users. Particularly in embedded systems contexts, non-trivial compiler customization is often necessary, and it's important that how targets are configured be easily visible. From our experiences with TinyOS, using any hidden files to drive configuration is a non-starter for Tock. |
I agree. The |
Generally, when I see projects do this, they use a
Config files are environment configuation, distinct from project configuration, see #12738 |
We talked about this in today's @rust-lang/cargo meeting. We're sympathetic to the desire to have Cargo configuration visible. However, this would be a massive amount of churn in the community (affecting more tools than just Cargo), as well as inconsistency with As a result, we don't want to do a migration for this. In general, we would like to migrate many items that currently require As a workaround, we would suggest creating a symlink instead (e.g. from |
Describe the problem you are trying to solve
Currently, cargo searches for configuration files by looking for a directory named
.cargo
, which is a hidden directory. This means that a typicalls
invocation does not reveal the existence of a config file. This makes it difficult to debug problems caused by cargo config files, particularly for contributors who are new to a project.Describe the solution you'd like
I would like Cargo to search for a config file in a non-hidden location, such as
cargo/config
. This way projects that want to use Cargo configs and make that config visible can do so.Alternative idea in case searching in a new location is considered a breaking change: We could add a field to
Cargo.toml
pointing to the Cargo config to use when invoked from within a particular crate or workspace.Notes
The Tock project uses Makefiles to pass flags to rustc and the linker rather than using a cargo config because they do not want to have any configs in hidden files.
The text was updated successfully, but these errors were encountered: