openSUSE-Rust / obs-service-cargo

OBS Source Service and utilities for Rust software packaging
Mozilla Public License 2.0
19 stars 9 forks source link

where `.cargo/config.toml` should be located #95

Closed stackup-dev closed 2 months ago

stackup-dev commented 2 months ago

Based on my observation obs-service-cargo will generate .cargo/config.toml at the root of the project directory. This comes with some caveats that we have to do that --manifest-path=<path-to-Cargo.toml> as an additional flag on the specfile. This is not ideal.

So based on https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure, I should

  1. If it's a workspace configuration, use the workspace Cargo.toml's location as the location for the .cargo/config.toml
  2. Otherwise, we should put .cargo/config.toml for each location of the Cargo.toml for each crate found or used.