From ad6f7d716e715b82383f918d517a9ca31650cdb7 Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Wed, 3 Apr 2024 19:43:53 +0530 Subject: [PATCH 1/6] chore(ci): edit build info to resolve release issue --- sn_build_info/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sn_build_info/src/lib.rs b/sn_build_info/src/lib.rs index 82e690eb5a..038826d6cf 100644 --- a/sn_build_info/src/lib.rs +++ b/sn_build_info/src/lib.rs @@ -22,7 +22,7 @@ pub const fn git_describe() -> &'static str { env!("VERGEN_GIT_DESCRIBE") } -/// Current git branch. +/// The current git branch. pub const fn git_branch() -> &'static str { env!("VERGEN_GIT_BRANCH") } From ed9a1963f923ac2e99e9f99d7959bd23a5f95558 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Wed, 3 Apr 2024 16:42:06 +0100 Subject: [PATCH 2/6] chore: output the date in the version This change exists just to generate a new version number. We can remove it if necessary. --- sn_build_info/build.rs | 1 + sn_build_info/src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sn_build_info/build.rs b/sn_build_info/build.rs index 8ef6278521..392c55da4e 100644 --- a/sn_build_info/build.rs +++ b/sn_build_info/build.rs @@ -9,6 +9,7 @@ use vergen::EmitBuilder; fn main() -> Result<(), Box> { EmitBuilder::builder() + .build_date() // Emit the short SHA-1 hash of the current commit .git_sha(true) // Emit the current branch name diff --git a/sn_build_info/src/lib.rs b/sn_build_info/src/lib.rs index 038826d6cf..6b858254ac 100644 --- a/sn_build_info/src/lib.rs +++ b/sn_build_info/src/lib.rs @@ -13,7 +13,9 @@ pub const fn git_info() -> &'static str { " / ", env!("VERGEN_GIT_BRANCH"), " / ", - env!("VERGEN_GIT_DESCRIBE") + env!("VERGEN_GIT_DESCRIBE"), + " / ", + env!("VERGEN_BUILD_DATE") ) } From ca1675654f2425c3d8e80f42a5cf66f5d5517aee Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Wed, 3 Apr 2024 17:00:58 +0100 Subject: [PATCH 3/6] chore: clarifications to version bumping script There was an issue with the script always applying 0 for the pre-release identifier. We got into a situation where it actually needed to be incremented by 1, because there was already a crate published at the 0 version. Added some text output to help clarify what the script is doing. Also tidied the style by consistently applying Bash syntax (as opposed to POSIX compatible) and a tab size of 2. --- resources/scripts/bump_version.sh | 70 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/resources/scripts/bump_version.sh b/resources/scripts/bump_version.sh index 6503d3a263..748f2f3019 100755 --- a/resources/scripts/bump_version.sh +++ b/resources/scripts/bump_version.sh @@ -2,28 +2,26 @@ set -e - # Suffix to append to the version. Passed as an argument to this script. SUFFIX="$1" # Ensure cargo set-version is installed if ! cargo set-version --help > /dev/null 2>&1; then - echo "cargo set-version command not found." - echo "Please install cargo-edit with the command: cargo install cargo-edit --features vendored-openssl" - exit 1 + echo "cargo set-version command not found." + echo "Please install cargo-edit with the command: cargo install cargo-edit --features vendored-openssl" + exit 1 fi # Ensure the suffix is either alpha or beta -if [ -n "$SUFFIX" ]; then - if [[ "$SUFFIX" != "alpha" ]] && [[ "$SUFFIX" != "beta" ]]; then - echo "Invalid suffix. Suffix must be either 'alpha' or 'beta'." - exit 1 - fi +if [[ -n "$SUFFIX" ]]; then + if [[ "$SUFFIX" != "alpha" ]] && [[ "$SUFFIX" != "beta" ]]; then + echo "Invalid suffix. Suffix must be either 'alpha' or 'beta'." + exit 1 + fi fi release-plz update 2>&1 | tee bump_version_output - crates_bumped=() while IFS= read -r line; do name=$(echo "$line" | awk -F"\`" '{print $2}') @@ -37,38 +35,40 @@ if [[ $len -eq 0 ]]; then exit 0 fi -# remove any performed changes if we're applying a suffix -if [ -n "$SUFFIX" ]; then - git checkout -- . +if [[ -n "$SUFFIX" ]]; then + echo "We are releasing to the $SUFFIX channel" + echo "Versions with $SUFFIX are not supported by release-plz" + echo "Reverting changes by release-plz" + git checkout -- . fi commit_message="chore(release): " for crate in "${crates_bumped[@]}"; do - # Extract the crate name and version in a cross-platform way - crate_name=$(echo "$crate" | sed -E 's/-v.*$//') - version=$(echo "$crate" | sed -E 's/^.*-v(.*)$/\1/') - new_version=$version - echo "the crate is: $crate_name" - # if we're changing the release channel... - if [ -n "$SUFFIX" ]; then - #if we're already in a realse channel, reapplying the suffix will reset things. - if [[ "$version" == *"-alpha."* || "$version" == *"-beta."* ]]; then - #remove any existing channel + version - base_version=$(echo "$version" | sed -E 's/(-alpha\.[0-9]+|-beta\.[0-9]+)$//') - new_version="${base_version}-${SUFFIX}.0" - else - new_version="${version}-${SUFFIX}.0" - fi + # Extract the crate name and version in a cross-platform way + crate_name=$(echo "$crate" | sed -E 's/-v.*$//') + version=$(echo "$crate" | sed -E 's/^.*-v(.*)$/\1/') + new_version=$version + + echo "----------------------------------------------------------" + echo "Processing $crate_name" + echo "----------------------------------------------------------" + if [[ -n "$SUFFIX" ]]; then + # if we're already in a release channel, reapplying the suffix will reset things. + if [[ "$version" == *"-alpha."* || "$version" == *"-beta."* ]]; then + base_version=$(echo "$version" | sed -E 's/(-alpha\.[0-9]+|-beta\.[0-9]+)$//') + pre_release_identifier=$(echo "$version" | sed -E 's/.*-(alpha|beta)\.([0-9]+)$/\2/') + new_version="${base_version}-${SUFFIX}.$pre_release_identifier" else - # For main release, strip any alpha or beta suffix from the version - new_version=$(echo "$version" | sed -E 's/(-alpha\.[0-9]+|-beta\.[0-9]+)$//') + new_version="${version}-${SUFFIX}.0" fi + else + # For main release, strip any alpha or beta suffix from the version + new_version=$(echo "$version" | sed -E 's/(-alpha\.[0-9]+|-beta\.[0-9]+)$//') + fi - # set the version - crate=$new_version - cargo set-version -p $crate_name $new_version - # update the commit msg - commit_message="${commit_message}${crate_name}-v$new_version/" + echo "Using set-version to apply $new_version to $crate_name" + cargo set-version -p $crate_name $new_version + commit_message="${commit_message}${crate_name}-v$new_version/" # append crate to commit message done commit_message=${commit_message%/} # strip off trailing '/' character From b806a7bcc971351d2c9a117ade960e1800c81241 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Wed, 3 Apr 2024 19:07:36 +0100 Subject: [PATCH 4/6] docs: clarify client::new description Just removed a few words to try and effect another change in `sn_client`, to get a new version. This crate has already been published and references an older version of `sn_protocol`, which is causing a problem because `sn_cli` is referencing a newer version of it. --- Cargo.lock | 145 +++++++++++++++++++++---------------------- sn_client/src/api.rs | 2 +- 2 files changed, 73 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7e77508a4..8540c35f25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,7 +339,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -350,7 +350,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -519,9 +519,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitcoin" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd00f3c09b5f21fb357abe32d29946eb8bb7a0862bae62c0b5e4a692acbbe73c" +checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae" dependencies = [ "base64 0.21.7", "bech32", @@ -834,9 +834,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", @@ -918,7 +918,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] @@ -930,7 +930,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1211,7 +1211,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1233,7 +1233,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", "synstructure 0.13.1", ] @@ -1258,7 +1258,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1269,7 +1269,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1309,9 +1309,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -1428,7 +1428,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1519,7 +1519,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1789,7 +1789,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1908,7 +1908,7 @@ dependencies = [ "bstr", "log", "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -1965,9 +1965,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -2995,7 +2995,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -3105,13 +3105,12 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -3189,9 +3188,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -3235,9 +3234,9 @@ dependencies = [ [[package]] name = "minreq" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3371dfc7b772c540da1380123674a8e20583aca99907087d990ca58cf44203" +checksum = "00a000cf8bbbfb123a9bdc66b61c2885a4bb038df4f2629884caafabeb76b0f9" dependencies = [ "log", "once_cell", @@ -3308,7 +3307,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -3444,9 +3443,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", "futures", @@ -3880,9 +3879,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -3891,9 +3890,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -3901,22 +3900,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] name = "pest_meta" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -3952,14 +3951,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3985,9 +3984,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "plist" @@ -4205,7 +4204,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -4222,7 +4221,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -4506,9 +4505,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -4524,7 +4523,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -4544,7 +4543,7 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -4555,9 +4554,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -5022,7 +5021,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -5732,9 +5731,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -5755,7 +5754,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -5800,9 +5799,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -5835,7 +5834,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -5937,7 +5936,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -6055,9 +6054,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -6090,7 +6089,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -6312,7 +6311,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -6755,7 +6754,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -6789,7 +6788,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7139,9 +7138,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xmltree" @@ -7223,7 +7222,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -7243,7 +7242,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -7287,9 +7286,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/sn_client/src/api.rs b/sn_client/src/api.rs index 35ded6f5ad..9fb21d5f63 100644 --- a/sn_client/src/api.rs +++ b/sn_client/src/api.rs @@ -64,7 +64,7 @@ impl Client { /// Instantiate a new client. /// - /// Optionally specify the maximum time the client will wait for a connection to the network before timing out. + /// Optionally specify the maximum time the client will wait for a connection before timing out. /// Defaults to 180 seconds. /// /// # Arguments From e70d6d28b20c6e1d2ee1a805e58e51d0af6b80f6 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Wed, 3 Apr 2024 23:22:06 +0100 Subject: [PATCH 5/6] docs: clarify client documentation Again, these changes are just to effect a release. A change to the release workflow also removes testing the environment variable and re-exporting it. On the last build I ran, it appears to have worked as expected, where previously it didn't. Doesn't really make any sense. --- sn_client/src/api.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sn_client/src/api.rs b/sn_client/src/api.rs index 9fb21d5f63..7fad35d576 100644 --- a/sn_client/src/api.rs +++ b/sn_client/src/api.rs @@ -57,14 +57,15 @@ const CONNECTION_TIMEOUT: Duration = Duration::from_secs(30); const INACTIVITY_TIMEOUT: Duration = Duration::from_secs(30); impl Client { - /// A quick client that only takes some peers to connect to + /// A quick client with a random secret key and some peers. pub async fn quick_start(peers: Option>) -> Result { Self::new(SecretKey::random(), peers, None, None).await } /// Instantiate a new client. /// - /// Optionally specify the maximum time the client will wait for a connection before timing out. + /// Optionally specify the duration for the connection timeout. + /// /// Defaults to 180 seconds. /// /// # Arguments From 868a0a1445ef022fe9a916e4322b0c546a70af73 Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Thu, 4 Apr 2024 10:39:53 +0900 Subject: [PATCH 6/6] fix(protocol): evaluate NETWORK_VERSION_MODE at compile time --- sn_peers_acquisition/src/lib.rs | 2 +- sn_protocol/src/version.rs | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sn_peers_acquisition/src/lib.rs b/sn_peers_acquisition/src/lib.rs index 26e192a18c..e1698ea374 100644 --- a/sn_peers_acquisition/src/lib.rs +++ b/sn_peers_acquisition/src/lib.rs @@ -25,7 +25,7 @@ lazy_static! { // URL containing the multi-addresses of the bootstrap nodes. pub static ref NETWORK_CONTACTS_URL: String = { let version = get_network_version(); - let version_prefix = if !version.is_empty() { format!("{version}-") } else { version }; + let version_prefix = if !version.is_empty() { format!("{version}-") } else { version.to_string() }; format!("https://sn-testnet.s3.eu-west-2.amazonaws.com/{version_prefix}network-contacts") }; } diff --git a/sn_protocol/src/version.rs b/sn_protocol/src/version.rs index abc959cdca..3c5074c1cc 100644 --- a/sn_protocol/src/version.rs +++ b/sn_protocol/src/version.rs @@ -8,10 +8,6 @@ use lazy_static::lazy_static; -/// Set this env variable to provide custom network versioning. If it is set to 'restricted', then the git branch name -/// is used as the version string. Else we directly use the passed in string as the version. -const NETWORK_VERSION_MODE_ENV_VARIABLE: &str = "NETWORK_VERSION_MODE"; - lazy_static! { /// The node version used during Identify Behaviour. pub static ref IDENTIFY_NODE_VERSION_STR: String = @@ -53,16 +49,18 @@ lazy_static! { /// If the network version mode env variable is set to `restricted`, then the git branch is used as the version. /// Else any non empty string is used as the version string. /// If the env variable is empty or not set, then we do not apply any network versioning. -pub fn get_network_version() -> String { - match std::env::var(NETWORK_VERSION_MODE_ENV_VARIABLE) { - Ok(value) if !value.is_empty() => { +pub fn get_network_version() -> &'static str { + // Set this env variable to provide custom network versioning. If it is set to 'restricted', then the git branch name + // is used as the version string. Else we directly use the passed in string as the version. + match option_env!("NETWORK_VERSION_MODE") { + Some(value) => { if value == "restricted" { - sn_build_info::git_branch().to_string() + sn_build_info::git_branch() } else { value } } - _ => "".to_string(), + _ => "", } } @@ -70,7 +68,7 @@ pub fn get_network_version() -> String { fn write_network_version_with_slash() -> String { let version = get_network_version(); if version.is_empty() { - version + version.to_string() } else { format!("/{version}") }