Skip to content

"Leakage" of feature flags from test projects #853

Description

@Niederb

We have a systematic problem that feature flags we have configured in our tests-projects (testing/async, testing/sync, examples/sync, examples/async) "leak" into the workspace builds. This is due to the fact that cargo creates a dependency-trees for the whole workspace and enables all the features needed by any of the workspace members.

If I look at the dependency with tree that I create with this command

  • cargo tree --workspace -p substrate-api-client --no-default-features -f "{p} {f}" > api-client-deps.txt

I see that some features are active that I would not expect (std, sync-api):

ac-compose-macros v1.17.0 (/home/tniederberger/repos/substrate-api-client/compose-macros) std,sync-api
├── ac-primitives v1.17.0 (/home/tniederberger/repos/substrate-api-client/primitives) contracts-xt,frame-system,pallet-assets,pallet-balances,pallet-contracts,pallet-staking,staking-xt,std
│ ├── frame-system v28.0.0 (https://github.com/paritytech/polkadot-sdk.git?branch=master#6565c424) default,std

This is because our internal projects for testing enable some of the features for substrate-api-client which are then activated for the whole workspace. For example in examples/sync/Cargo.toml:
substrate-api-client = { workspace = true, features = ["tungstenite-client", "ws-client"] }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions