Skip to content

Conversation

@clangenb
Copy link
Collaborator

@clangenb clangenb commented May 1, 2025

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

  • ensuring that we use the same crate version throughout the whole workspace
  • update deps at one place only

Follow-ups:

@clangenb clangenb requested review from Niederb and haerdib and removed request for haerdib May 1, 2025 08:38
@clangenb clangenb added F5-refactor Does not change any functionality of the code E1-breaksnothing Q3-substantial F9-dependencies Pull requests that update a dependency file dependencies Pull requests that update a dependency file labels May 1, 2025
@haerdib haerdib removed Q3-substantial dependencies Pull requests that update a dependency file labels May 1, 2025
Comment on lines +60 to +68
# 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,
Copy link
Collaborator Author

@clangenb clangenb May 1, 2025

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.

Copy link
Contributor

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 👍

Comment on lines +84 to +86
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,
Copy link
Collaborator Author

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

@clangenb
Copy link
Collaborator Author

clangenb commented May 1, 2025

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.

@haerdib
Copy link
Contributor

haerdib commented May 1, 2025

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..

@clangenb
Copy link
Collaborator Author

clangenb commented May 1, 2025

It complains that this does not exist... Shall we merge and create an issue?

@haerdib
Copy link
Contributor

haerdib commented May 1, 2025

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.

@clangenb
Copy link
Collaborator Author

clangenb commented May 1, 2025

Thanks, worked!

Copy link
Contributor

@haerdib haerdib left a 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";
Copy link
Contributor

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"
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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 👍

Copy link
Contributor

@Niederb Niederb left a 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"] }
Copy link
Contributor

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" }
Copy link
Collaborator Author

@clangenb clangenb May 6, 2025

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.

Copy link
Contributor

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 👍

Copy link
Collaborator Author

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.

@clangenb
Copy link
Collaborator Author

clangenb commented May 6, 2025

Cool thanks for the reviews. You can merge the PR at your convenience then.

@Niederb Niederb merged commit 4b3d52e into master May 6, 2025
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

E1-breaksnothing F5-refactor Does not change any functionality of the code F9-dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants