Bug 2161128

Summary: The feature based dependency does not support format `[dependencies.foo]`
Product: [Fedora] Fedora Reporter: Gris Ge <fge>
Component: rust-packagingAssignee: Rust SIG <rust-sig>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: decathorpe, igor.raits, rust-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-16 20:25:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gris Ge 2023-01-16 03:43:19 UTC
Description of problem:

According to https://bugzilla.redhat.com/show_bug.cgi?id=2159314

The feature based dependency cannot parse dependency in the format of

```
[dependencies.nispor]
version = "1.2.9"
optional = true


[features]
default = ["query_apply"]
query_apply = ["nispor"]
```

The error message indicate the rust packaging tools think the `nispor` is internal feature instead of external dependency.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Gris Ge 2023-01-16 06:32:08 UTC
The workaround I use is :


```

[features]
default = ["query_apply"]
query_apply = ["dep:nispor"]
```

Then manually define `Requires:  (crate(nispor/default) >= 1.2.9 with crate(nispor/default) < 2.0)`

Comment 2 Fabio Valentini 2023-01-16 20:25:32 UTC
The problem is not `[dependencies.foo]`, but `["dep:nispor"]` format. It's not yet supported by our tools, but I'm working on it.

*** This bug has been marked as a duplicate of bug 2152697 ***

Comment 3 Fabio Valentini 2023-02-22 17:50:02 UTC
This should be fixed when generating a spec file with rust2rpm >= 24 and building with cargo-rpm-macros >= 24, can you confirm that?

Comment 4 Gris Ge 2023-12-15 11:21:02 UTC
Sorry for the late response. Yes the `dep:<opt_dep_name` work as expected.

Thank you!