Skip to content
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

Cargo run should use the cargo config specified for the package #9354

Closed
Andy-Python-Programmer opened this issue Apr 13, 2021 · 1 comment
Closed
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@Andy-Python-Programmer
Copy link
Contributor

Currently if we run:

$ cargo run --package example_kernel

And we have example_kernel as a workspace member in cargo.toml and there is a cargo config file in example_kernel/.cargo/config.toml with the following:

[unstable]
build-std = ["core", "compiler_builtins", "alloc"]
build-std-features = ["compiler-builtins-mem"]

[build]
target = "x86_64-aero_os.json"

[profile.dev]
panic = "abort" # Disable stack unwinding on panic

[profile.release]
panic = "abort" # Disable stack unwinding on panic

It will use the standard configs not the one defined in example_kernel/.cargo/

I would like cargo to use that config file not the standard configs as we are in a package. I cannot define a config file in the root as I only want for example the kernel package to be no std and have alloc while the bootloader without alloc and the builder to include std.

@Andy-Python-Programmer Andy-Python-Programmer added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Apr 13, 2021
@ehuss
Copy link
Contributor

ehuss commented Apr 13, 2021

Thanks for the report! Yea, this can be confusing, since cargo always uses the current working directory to find configuration files. This is mostly the same as issue #2930, so I'm going to close in favor of that. Unfortunately it is not so simple to change the behavior since it could break existing workflows, so the path forward is not exactly clear.

@ehuss ehuss closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants