Skip to content

Commit

Permalink
Enable --all-features when building source distribution (#2215)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
messense committed Sep 10, 2024
1 parent e87bf6f commit 2260d59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 2260d59

Please sign in to comment.