1 |
commit: 148fc783d6c6d00ea35e56e861cb5bc42d8a49c2 |
2 |
Author: Philip DeMonaco <phil <AT> demona <DOT> co> |
3 |
AuthorDate: Sat Aug 29 16:47:13 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 19 22:33:47 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/cargo-ebuild.git/commit/?id=148fc783 |
7 |
|
8 |
feat: include all features when pulling metadata |
9 |
|
10 |
Optional package dependencies are not included when pulling metadata. In |
11 |
some cases these packages are still required to actually build even when |
12 |
those flags are turned off. |
13 |
|
14 |
This change effectively adds `--all-features` to the call of cargo |
15 |
metadata. |
16 |
|
17 |
I don't know if this is due to a change in behavior from cargo build, |
18 |
however, it seems prudent to include all possible dependencies. |
19 |
|
20 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
21 |
|
22 |
src/lib.rs | 3 +++ |
23 |
1 file changed, 3 insertions(+) |
24 |
|
25 |
diff --git a/src/lib.rs b/src/lib.rs |
26 |
index 637846e..b7616b7 100644 |
27 |
--- a/src/lib.rs |
28 |
+++ b/src/lib.rs |
29 |
@@ -13,6 +13,7 @@ mod metadata; |
30 |
use anyhow::{format_err, Context, Result}; |
31 |
use cargo_lock::Lockfile; |
32 |
use cargo_metadata::MetadataCommand; |
33 |
+use cargo_metadata::CargoOpt; |
34 |
use std::collections::BTreeSet; |
35 |
use std::fs::OpenOptions; |
36 |
use std::io::Write; |
37 |
@@ -56,6 +57,8 @@ fn generate_lockfile(manifest_path: Option<PathBuf>) -> Result<()> { |
38 |
pub fn gen_ebuild_data(manifest_path: Option<PathBuf>) -> Result<EbuildConfig> { |
39 |
let mut cmd = MetadataCommand::new(); |
40 |
|
41 |
+ cmd.features(CargoOpt::AllFeatures); |
42 |
+ |
43 |
if let Some(path) = manifest_path.as_ref() { |
44 |
cmd.manifest_path(path); |
45 |
} |