Skip to content

Conversation

@DariuszDepta
Copy link
Member

@DariuszDepta DariuszDepta commented Aug 21, 2025

The current development sources of the Rust crates are kept on the main branch. This applies to both single-crate and multi-crate repositories like cosmwasm repository. That's why on the main branch (which serves as the development branch), all dependencies between the developed crates should be defined using relative paths, as shown below (example taken from cosmwasm-std crate):

[dependencies]
cosmwasm-core = { path = "../core" }
cosmwasm-derive = { path = "../derive" }
cw-schema = { path = "../cw-schema" }

This convention is practical because:

  • all dependencies remain up to date, regardless of which crate is changed during development,
  • cargo prevents publishing a crate that has a path dependency,
  • code coverage can be measured across all crates, regardless of their position in the dependency tree.

The versions of crates under development on the main branch should use the planned release version number with a -dev suffix. If such a crate is accidentally published, the suffix makes it easy to identify and immediately yank on crates.io.

Changes to the source code on the main branch must be made through pull requests based on separate branches.

When the code on the main branch is ready for release, create a separate branch named release/ followed by the major and minor version numbers from the version triple (e.g., release/3.0). If such a branch already exists and the current change is only a bug fix, use the existing branch instead.

The released version of creates must not contain -dev suffix.

On the release branch, all dependencies between crates should be changed to version numbers, like this:

[dependencies]
cosmwasm-core = { version = "3.0.2" }
cosmwasm-derive = { version = "3.0.2" }
cw-schema = { version = "3.0.2" }

Then all crates can be published to crates.io in the correct order, as determined by the dependency tree (from leaves to root).

This convention is convenient, because now:

  • all dependencies are fixed to released version,
  • cargo allows publishing all crates,
  • code coverage can be measured independently for each crate.

@DariuszDepta DariuszDepta added this to the 3.0.2 milestone Aug 21, 2025
@DariuszDepta DariuszDepta requested a review from pinosu August 21, 2025 16:56
@DariuszDepta DariuszDepta self-assigned this Aug 21, 2025
@DariuszDepta DariuszDepta added the maintenance Maintenance label Aug 21, 2025
Copy link

@pinosu pinosu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!!
LGTM 👍

@DariuszDepta DariuszDepta merged commit 1c55673 into main Aug 22, 2025
@DariuszDepta DariuszDepta deleted the local-dependencies branch August 22, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants