From cb501a184a35a76a004bfdfcab481772e68f83fd Mon Sep 17 00:00:00 2001 From: Ian Kronquist Date: Fri, 9 Jul 2021 15:02:56 -0700 Subject: [PATCH 1/3] Document cargo limitation w/ workspaces & configs This behavior is described in this bug: https://github.com/rust-lang/cargo/issues/2930 I think we should document limitations of the tool which exist at present if they do not bind our hands in the future. If this bug is fixed, this note should be removed. --- src/doc/src/reference/config.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index a6fc0b0f1ff..c30ff8ddb4e 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -35,6 +35,16 @@ home directory is the lowest priority. Arrays will be joined together. > and is the preferred form. If both files exist, Cargo will use the file > without the extension. + +> **Note:** At present, when being invoked from a workspace, Cargo does not read +> config files from crates within the workspace. i.e. if a workspace has two +> crates in it, named `/projects/foo/bar/baz/mylib` and +> `/projects/foo/bar/baz/mybin`, and there are Cargo configs at +> `/projects/foo/bar/baz/mylib/.cargo/config.toml` +> and `/projects/foo/bar/baz/mybin/.cargo/config.toml`, Cargo does not read +> those configuration files if it is invoked from the workspace root +> (`/projects/foo/bar/baz/`). + ### Configuration format Configuration files are written in the [TOML format][toml] (like the From 4e180e69d0b4a8030ca1c5c760ce4da77673baf5 Mon Sep 17 00:00:00 2001 From: Ian Kronquist Date: Mon, 12 Jul 2021 19:09:51 -0700 Subject: [PATCH 2/3] Update config.md --- src/doc/src/reference/config.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index c30ff8ddb4e..d159b55a0af 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -30,20 +30,20 @@ together. Numbers, strings, and booleans will use the value in the deeper config directory taking precedence over ancestor directories, where the home directory is the lowest priority. Arrays will be joined together. +At present, when being invoked from a workspace, Cargo does not read config +files from crates within the workspace. i.e. if a workspace has two crates in +it, named `/projects/foo/bar/baz/mylib` and `/projects/foo/bar/baz/mybin`, and +there are Cargo configs at `/projects/foo/bar/baz/mylib/.cargo/config.toml` +and `/projects/foo/bar/baz/mybin/.cargo/config.toml`, Cargo does not read +those configuration files if it is invoked from the workspace root +(`/projects/foo/bar/baz/`). + > **Note:** Cargo also reads config files without the `.toml` extension, such as > `.cargo/config`. Support for the `.toml` extension was added in version 1.39 > and is the preferred form. If both files exist, Cargo will use the file > without the extension. -> **Note:** At present, when being invoked from a workspace, Cargo does not read -> config files from crates within the workspace. i.e. if a workspace has two -> crates in it, named `/projects/foo/bar/baz/mylib` and -> `/projects/foo/bar/baz/mybin`, and there are Cargo configs at -> `/projects/foo/bar/baz/mylib/.cargo/config.toml` -> and `/projects/foo/bar/baz/mybin/.cargo/config.toml`, Cargo does not read -> those configuration files if it is invoked from the workspace root -> (`/projects/foo/bar/baz/`). ### Configuration format From d0546523ddf671e98237cad0f1c8d2f28cb031c9 Mon Sep 17 00:00:00 2001 From: Ian Kronquist Date: Wed, 14 Jul 2021 16:59:50 -0700 Subject: [PATCH 3/3] Remove extra whitespace --- src/doc/src/reference/config.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index d159b55a0af..063129d8890 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -43,8 +43,6 @@ those configuration files if it is invoked from the workspace root > and is the preferred form. If both files exist, Cargo will use the file > without the extension. - - ### Configuration format Configuration files are written in the [TOML format][toml] (like the