Skip to content

Fix dep of artifact dep same deactivated target - #1

Draft
elchukc wants to merge 17 commits into
masterfrom
fix_dep_of_artifact_dep_same_deactivated_target
Draft

Fix dep of artifact dep same deactivated target#1
elchukc wants to merge 17 commits into
masterfrom
fix_dep_of_artifact_dep_same_deactivated_target

Conversation

@elchukc

@elchukc elchukc commented Oct 19, 2024

Copy link
Copy Markdown
Owner

What does this PR try to resolve?

Fixes cargo tree -Z bindeps panic in 10593 (comment).

  • a dependency of an artifact dependency is platform specified
  • artifact dep itself is { target = } with the same platform as its own dependency
  • the platform is not activated.

Essentially, no entry found for key happens because artifact deps for deactivated platforms are not properly filtered out when adding a package to the graph. Adding --target all to cargo tree -Z bindeps makes this bug go away.

As I understand, expected behaviour is to treat artifact deps like any other dep and only include ones targeting the host platform unless specified in --target <triple>.

i.e. if bar is the artifact dep, we expect cargo tree -Z bindeps to output:

foo v0.1.0 ([ROOT]/foo)

While cargo tree -Z bindeps --target all outputs:

foo v0.1.0 ([ROOT]/foo)
└── bar v0.1.0 ([ROOT]/foo/bar)
    └── baz v0.1.0 ([ROOT]/foo/baz)

How should we test and review this PR?

Test case changed in this PR is sufficient.

Additional information

This bugfix is separate from implementing the design changes in issue this [comment], which is still WIP.

@elchukc
elchukc force-pushed the fix_dep_of_artifact_dep_same_deactivated_target branch from 266b04c to 5d044a6 Compare October 21, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants