Skip to content
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

using `polkadot-sdk umbrella crate as git dependency doesn't compile #7800

Open
niklasad1 opened this issue Mar 4, 2025 · 2 comments
Open
Labels
D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder.

Comments

@niklasad1
Copy link
Member

niklasad1 commented Mar 4, 2025

Hey hey.

I'm trying to use the polkadot-sdk umbrella crate as git dependency but it doesn't compile because it can't find mermaid docs. This occurs on ubuntu but doesn't happen on my macbook

Cargo.toml looks like:

polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", features = ["frame-election-provider-support", "frame-support", "sp-npos-elections", "sp-core", "sp-runtime", "pallet-election-provider-multi-phase"], tag = "ah-next-v0.1.0-beta" }

Compiling doesn't work:

➜ polkadot-staking-miner (na-feature-gated-exp-miner) ✗ cargo build --release
   Compiling sp-debug-derive v14.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-std v14.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-io v30.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-crypto-hashing v0.1.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-runtime-interface-proc-macro v17.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling substrate-bip39 v0.4.7 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-panic-handler v13.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-api-proc-macro v15.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling frame-support-procedural-tools-derive v11.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-tracing v16.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-wasm-interface v20.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling binary-merkle-tree v13.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-version-proc-macro v13.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-arithmetic v23.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-metadata-ir v0.6.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling frame-election-provider-solution-type v13.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling polkadot-staking-miner v1.7.0 (/home/niklasad1/Github/polkadot-staking-miner)
   Compiling sp-crypto-hashing-proc-macro v0.1.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-storage v19.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling frame-support-procedural-tools v10.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling frame-support-procedural v23.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-externalities v0.25.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-weights v27.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-runtime-interface v24.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-core v28.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-trie v29.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-keystore v0.34.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-state-machine v0.35.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-application-crypto v30.0.0 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
   Compiling sp-runtime v31.0.1 (https://github.com/paritytech/polkadot-sdk?tag=ah-next-v0.1.0-beta#cefcca4b)
error: couldn't read `/home/niklasad1/.cargo/git/checkouts/polkadot-sdk-dee0edd6eefa0594/cefcca4/substrate/primitives/runtime/src/generic/../../docs/mermaid/extrinsics.mmd`: Not a directory (os error 20)
   --> /home/niklasad1/.cargo/git/checkouts/polkadot-sdk-dee0edd6eefa0594/cefcca4/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs:214:54
    |
214 | #[cfg_attr(all(feature = "std", not(windows)), doc = simple_mermaid::mermaid!("../../docs/mermaid/extrinsics.mmd"))]
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `include_str` which comes from the expansion of the macro `simple_mermaid::mermaid` (in Nightly builds, run with -Z macro-backtrace for more info)
help: there is a file with the same name in a different directory
    |
214 | #[cfg_attr(all(feature = "std", not(windows)), doc = simple_mermaid::mermaid!("../../../../../docs/mermaid/extrinsics.mmd"))]
    |                                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@niklasad1 niklasad1 added the D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. label Mar 4, 2025
@ggwpez
Copy link
Member

ggwpez commented Mar 4, 2025

Hm, I assume that we have to include that file into the crates-io release. There is an extra section in the toml file for that.
Maybe if we include it into the umbrella crate then it will work?

PS: How does your cargo.toml look like? What features are enabled? Or maybe share the branch if possible, so that we can try a fix.

@niklasad1
Copy link
Member Author

niklasad1 commented Mar 4, 2025

polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", features = ["frame-election-provider-support", "frame-support", "sp-npos-elections", "sp-core", "sp-runtime", "pallet-election-provider-multi-phase"], tag = "ah-next-v0.1.0-beta" }

@niklasad1 niklasad1 changed the title using polkadot-sdk umbrella crate doesn't compile using `polkadot-sdk umbrella crate as git dependency doesn't compile Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder.
Projects
None yet
Development

No branches or pull requests

2 participants