Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Why is there .cargo/config.toml file? #129

@dsabala

Description

@dsabala

Hi

Coming from C language, CMake build-system and PyInvoke project CLI support I am really impressed by how Rust treats build-system issues. However I cant understand why we use .cargo/config.toml files so extensively in the first place?

According to the Cargo documentation, the .cargo/config.toml file is a kind of hierarchical Cargo configuration. How can we define e.g. the target target.thumbv7m-none-eabi in such a file?

Why cant we move all content from .cargo/config.toml to manifest file Cargo.toml ?

Edit:

I guess this choice is made to keep Cargo.toml file more platform-generic?
I think that it could be explained inside this .cargo/config.toml file

Edit 2:

Rust and Cargo are still evolving, it looks like .cargo/config.toml file was there before introduction of Cargo.toml file and now there are ongoing works to move some configuration to Cargo.toml file

rust-lang/cargo#12738

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions