-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: standardise versioning for binaries
The RFC for the release process stipulated there should be four versioning arguments: * --version * --crate-version * --package-version * --network-version Here, `--crate-version` is the semantic version of the crate, `--package-version` is the release cycle version, e.g., `2024.09.1.1`, and `--network-version` prints the compatible network protocol. The `--version` argument will then print all of this information. The `--package-version` argument does not apply to the nightly release. The approach for printing the version information is to provide our own `version` flag, by using the `disable_version_flag` attribute with `clap`. If you want to use `clap`, all the information needs to be completely static and available at compile time. This is convoluted, especially for things like the network protocol version and the crate version, and it would have led to a lot of repetition. We can avoid the difficulty by providing the information dynamically, and we can use the `sn_build_info` crate to define the version string once. On binaries that used subcommands, for the versioning to work correctly, the subcommand needs to be made optional. The `get_bin_version` helper used by the node manager was updated parse the new versioning information from both stable and nightly releases. Now, the function can handle different `--version` output formats by extracting the version number for stable releases prefixed with a 'v' and the date for nightly releases. Since we are going to introduce a nightly build, this commit also introduces a nightly feature, which will control what versioning information is used. For the nightly, the binaries will be versioned with the date on which they are built. The `--package-version` argument does not apply to the nightly release; it is not necessary if all the binaries have the same version, which is the date.
- Loading branch information
Showing
25 changed files
with
649 additions
and
137 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.