Skip to content

Commit

Permalink
Fix features script check to skip dev packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylavrenov committed Apr 24, 2023
1 parent eb8ba52 commit 16eb026
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions test.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions utils/checks/features
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def list_expected_propagated_features(feature, _package, deps)
default_enabled = dep[:dependency]['uses_default_features']
next false if default_enabled && package_feature_enabled_by(dep[:package], 'default', feature)

# If the package is used as dev dependency - skip it, as we don't need to specify
# the feature.
next false if dep[:dependency]['kind'] == 'dev'

This comment has been minimized.

Copy link
@MOZGIII

MOZGIII Apr 24, 2023

Contributor

But we do usually need to set the features though.

This comment has been minimized.

Copy link
@dmitrylavrenov

dmitrylavrenov Apr 24, 2023

Author Contributor

It's not trivial to me about possible solutions here as cargo metadata read deps for workspace in a little bit different way as I got. As I already mentioned here - rust-lang/cargo#7754

This comment has been minimized.

Copy link
@MOZGIII

MOZGIII Apr 24, 2023

Contributor

rust-lang/cargo#7754 is a different issue: when you have a crate that is also a declaration of the workspace, then metadata will resolve as for workspace. We don't have a crate in the root of our workspace, so it's fine that things are resolving this way.


true
end
deps_with_feature.map do |name, _dep|
Expand Down

0 comments on commit 16eb026

Please sign in to comment.