From 2d08c73c28419517207e1346935d7d860cfcd875 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 29 May 2021 17:44:16 -0700 Subject: [PATCH 1/2] Add a note about rustflags compatibility. --- src/doc/src/reference/config.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index af11bb80b71..a4762d378c8 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -349,6 +349,12 @@ Without `--target`, the flags will be passed to all compiler invocations you have args that you do not want to pass to build scripts or proc macros and are building for the host, pass `--target` with the host triple. +> **Caution**: Due to the low-level nature of passing flags directly to the +> compiler, this may cause a conflict with future versions of Cargo which may +> issue the same or similar flags on its own which may interfere with the +> flags you specify. This is an area where Cargo may not always be backwards +> compatible. + ##### `build.rustdocflags` * Type: string or array of strings * Default: none From 4d3772b8827b09eace478489f20514837b17b5b9 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 29 May 2021 18:17:03 -0700 Subject: [PATCH 2/2] Add a note about passing in rustflags that conflict with Cargo. --- src/doc/src/reference/config.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index a4762d378c8..a6fc0b0f1ff 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -349,6 +349,10 @@ Without `--target`, the flags will be passed to all compiler invocations you have args that you do not want to pass to build scripts or proc macros and are building for the host, pass `--target` with the host triple. +It is not recommended to pass in flags that Cargo itself usually manages. For +example, the flags driven by [profiles] are best handled by setting the +appropriate profile setting. + > **Caution**: Due to the low-level nature of passing flags directly to the > compiler, this may cause a conflict with future versions of Cargo which may > issue the same or similar flags on its own which may interfere with the