From 3e248353468a9aa0efa844d39eecf24e1dbdc3f3 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 2 Oct 2025 08:56:05 +0100 Subject: [PATCH] ci: add --cfg for cargo doc to disable compile_error!() Some crates, such as vhost, use compile_error!() to indicate that mutually exclusive feature have been specified. This leads to problems when running cargo doc --all-features, which will inevitably trigger these conditions and then lead to documentation not building (for this reason, the vhost documentation currently fails to build on docs.rs for example). Add a custom cfg that gets passed via RUSTFLAGS in the cargo doc CI step on whose absense these compile_error!() macros can be gated, so that they dont cause issues when building documentation in CI A custom cfg is needed because cargo doc does not pass `--cfg doc` down to dependencies. See also rust-vmm/vhost#326 Signed-off-by: Patrick Roy --- .buildkite/test_description.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/test_description.json b/.buildkite/test_description.json index 7af19fa..9fdcdf3 100644 --- a/.buildkite/test_description.json +++ b/.buildkite/test_description.json @@ -29,7 +29,7 @@ }, { "test_name": "doc", - "command": "RUSTDOCFLAGS=\"-D warnings\" cargo doc --workspace --all-features --no-deps" + "command": "RUSTDOCFLAGS=\"-D warnings\" RUSTFLAGS=\"--cfg RUTSDOC_disable_feature_compat_errors\" cargo doc --workspace --all-features --no-deps" }, { "test_name": "unittests-gnu",