Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Move node-template Cargo.toml dependencies to workspace (#14058)
Browse files Browse the repository at this point in the history
* Move node-template Cargo.toml dependencies to workspace

* review

* Update Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
kalaninja and ggwpez authored May 16, 2023
1 parent 2af3ba8 commit dd478bc
Show file tree
Hide file tree
Showing 4 changed files with 275 additions and 137 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 9 additions & 16 deletions docs/node-template-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,26 @@ by running the following command.
delete files/directories that are removed from the source. So you need to manually check and
remove them in the destination.

3. There are actually three packages in the Node Template, `node-template` (the node),
`node-template-runtime` (the runtime), and `pallet-template`, and each has its own `Cargo.toml`.
Inside these three files, dependencies are listed in expanded form and linked to a certain git
commit in Substrate remote repository, such as:
3. There is a `Cargo.toml` file in the root directory. Inside, dependencies are listed form and
linked to a certain git commit in Substrate remote repository, such as:

```toml
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = 'c1fe59d060600a10eebb4ace277af1fee20bad17'
version = '3.0.0'
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", rev = "de80d0107336a9c7a2efdc0199015e4d67fcbdb5", default-features = false }
```

We will update each of them to the shortened form and link them to the Rust
[crate registry](https://crates.io/). After confirming the versioned package is published in
the crate, the above will become:
We will update each of them to link to the Rust [crate registry](https://crates.io/).
After confirming the versioned package is published in the crate, the above will become:

```toml
[dev-dependencies]
sp-core = { version = '3.0.0', default-features = false }
[workspace.dependencies]
sp-core = { version = "7.0.0", default-features = false }
```

P.S: This step can be automated if we update `node-template-release` package in
`scripts/ci/node-template-release`.

4. Once the three `Cargo.toml`s are updated, compile and confirm that the Node Template builds. Then
commit the changes to a new branch in [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template), and make a PR.
4. Once the `Cargo.toml` is updated, compile and confirm that the Node Template builds. Then commit
the changes to a new branch in [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template), and make a PR.

> Note that there is a chance the code in Substrate Node Template works with the linked Substrate git
commit but not with published packages due to the latest (as yet) unpublished features. In this case,
Expand Down
3 changes: 2 additions & 1 deletion scripts/ci/node-template-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ git2 = "0.16"
glob = "0.3"
tar = "0.4"
tempfile = "3"
toml = "0.7"
toml_edit = "0.19"
itertools = "0.10"
Loading

0 comments on commit dd478bc

Please sign in to comment.