-
Notifications
You must be signed in to change notification settings - Fork 127
Lift dependencies to workspace and move api-client to its own package #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| # Check build of stand-alone features. | ||
| cargo check --no-default-features -p substrate-api-client, | ||
| cargo check --no-default-features -p substrate-api-client --features sync-api, | ||
| cargo check --no-default-features -p substrate-api-client --features jsonrpsee-client, | ||
| cargo check --no-default-features -p substrate-api-client --features tungstenite-client, | ||
| cargo check --no-default-features -p substrate-api-client --features ws-client, | ||
| cargo check --no-default-features -p substrate-api-client --features staking-xt, | ||
| cargo check --no-default-features -p substrate-api-client --features contracts-xt, | ||
| cargo check --no-default-features -p substrate-api-client --features std, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I moved the substreate-api-client to its own pure package crate the default behaviour changed to executed these checks for the whole workspace. I put this change now to preserve the current behaviour as some CI checks actually fail. I decided that it is better to fix this in a follow up issue as there are also some clippy warnings #849.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also stumbled upon this a while ago. I did not investigate the root cause exactly then, but we should fix the clippy issues 👍
| cargo clippy -p substrate-api-client -- -D warnings, | ||
| cargo clippy -p substrate-api-client --no-default-features -- -D warnings, | ||
| cargo clippy -p substrate-api-client --all-features --examples -- -D warnings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clippy is not happy for the whole workspace yet. 😭 #849
|
Do you have any idea about the license check? I added the necessary license to accepted, but it still fails. I can locally reproduce this, but I don't really know what to do. |
Try it by accepting only the GPL3.0-or-later, maybe this works. Cargo about is not very robust.. |
|
It complains that this does not exist... Shall we merge and create an issue? |
Can you add the following accepted License? "GPL-3.0 WITH Classpath-exception-2.0" This should work. |
|
Thanks, worked! |
haerdib
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I like this change. But let's wait with merging until @Niederb has approved of it aswell. I'm not sure if he's currently working on something.
| use sp_core::Bytes; | ||
| use sp_version::RuntimeVersion; | ||
|
|
||
| pub const KSM_V14_METADATA_PATH: &str = "./../ksm_metadata_v14.bin"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
| "Zlib", | ||
| "GPL-3.0" | ||
| "GPL-3.0", | ||
| "GPL-3.0 WITH Classpath-exception-2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Niederb You're more of an expert here: Is this an acceptable license for our keystore, or do we need to update our keystore license?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. The exception makes it more liberal, so it should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the Classpath-exception makes it more liberal, so this is fine 👍
Niederb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this change 👍 Less redundancies in the definition of the dependencies and versions
|
|
||
| # local deps | ||
| substrate-api-client = { path = "../..", version = "1.17", features = ["staking-xt", "contracts-xt"] } | ||
| substrate-api-client = { workspace = true, features = ["std", "jsonrpsee-client", "staking-xt", "contracts-xt"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More out of curiosity: Are the additional features "std", "jsonrpsee-client" neccessary? They are declared as default in the api-client/Cargo.toml no?
| ac-compose-macros = { default-features = false, path = "compose-macros", version = "1.17" } | ||
| ac-node-api = { default-features = false, path = "node-api", version = "1.17" } | ||
| ac-primitives = { default-features = false, path = "primitives", version = "1.17" } | ||
| substrate-api-client = { default-features = false, path = "api-client", version = "1.17" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Niederb regarding your #848 (comment). Yes the features are necessary, as we disable the default features here when we define the api-client as a workspace dependency.
We could also do it the other way around as we need the default-features except for the no-std tests, but I decided to be consistent with the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Makes sense then 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also explicitly put default-features = true in the async example to overwrite the workspace dependency setting. Not sure what is better though.
|
Cool thanks for the reviews. You can merge the PR at your convenience then. |
The biggest motivation for this check is that encointer needs to depend on crates-io versions of the polkadot-sdk, and it is just so much easier for us to patch upstream if all the deps are defined in the workspace root only. Additionally, this gives you also small benefits like
Follow-ups:
substrate-api-clientinstead of all the crates because the root toml was both, a package toml and a workspace toml. As this also implies fixing of some clippy warnings, I thought it is better to move this to a follow-up issue Properly run all CI tests for all crates instead of just the substrate-api-client #849.