From 523a7fd49df283fd3801739d8c67e9cdef8e3067 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 10 Sep 2024 01:20:41 +0000 Subject: [PATCH] Enable `--all-features` when building source distribution When building sdist, `cargo metadata` command should output all dependencies including optional ones, otherwise the resulting sdist file may not compile when building with optional features activated. Enabling `--all-features` ensure that all optional path dependencies to be packaged into sdist, which should help with #2117. --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index d5d3ef978..8836ef554 100644 --- a/src/main.rs +++ b/src/main.rs @@ -311,6 +311,9 @@ fn pep517(subcommand: Pep517Command) -> Result<()> { out: Some(sdist_directory), cargo: CargoOptions { manifest_path, + // Enable all features to ensure all optional path dependencies are packaged + // into source distribution + all_features: true, ..Default::default() }, ..Default::default() @@ -417,6 +420,9 @@ fn run() -> Result<()> { out, cargo: CargoOptions { manifest_path, + // Enable all features to ensure all optional path dependencies are packaged + // into source distribution + all_features: true, ..Default::default() }, ..Default::default()