diff --git a/scripts/cargo-chill.sh b/scripts/cargo-chill.sh new file mode 100755 index 0000000000..5ffa2953e4 --- /dev/null +++ b/scripts/cargo-chill.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euo pipefail + +# This is a trivial wrapper around cargo which just forwards its arguments +# to cargo, and then sleeps for a few seconds, to allow for exteral services +# to update their indices. +# https://internals.rust-lang.org/t/changes-to-how-crates-io-handles-index-updates/9608 + +cargo "$@" +sleep 10 diff --git a/scripts/cranelift-version.sh b/scripts/cranelift-version.sh index 126be7a002..db34f24b8b 100755 --- a/scripts/cranelift-version.sh +++ b/scripts/cranelift-version.sh @@ -5,7 +5,7 @@ set -euo pipefail # dependencies versions. To use, bump the version number below, run the # script. -topdir=$(dirname "$0") +topdir=$(dirname "$0")/.. cd "$topdir" # All the cranelift-* crates have the same version number diff --git a/scripts/format-all.sh b/scripts/format-all.sh index 64c967ad24..3d2c4ab467 100755 --- a/scripts/format-all.sh +++ b/scripts/format-all.sh @@ -3,7 +3,7 @@ set -euo pipefail # Format all sources using rustfmt. -topdir=$(dirname "$0") +topdir=$(dirname "$0")/.. cd "$topdir" # Make sure we can find rustfmt. diff --git a/scripts/publish-all.sh b/scripts/publish-all.sh index 38794effd7..edda971931 100755 --- a/scripts/publish-all.sh +++ b/scripts/publish-all.sh @@ -5,29 +5,19 @@ set -euo pipefail # Wasmtime to crates.io. To use, bump the version number below, run the # script, and then run the commands that the script prints. -topdir=$(dirname "$0") +topdir=$(dirname "$0")/.. cd "$topdir" # All the wasmtime-* crates have the same version number version="0.2.0" -# Update all of the Cargo.toml files. -# -# The main Cargo.toml in the top-level directory is the wasmtime crate which we don't publish. +# Update the version numbers of the crates to $version. echo "Updating crate versions to $version" -for crate in . wasmtime-*; do - # Update the version number of this crate to $version. - sed -i.bk -e "s/^version = .*/version = \"$version\"/" \ - "$crate/Cargo.toml" - - # Update the required version number of any wasmtime* dependencies. - sed -i.bk -e "/^wasmtime/s/version = \"[^\"]*\"/version = \"$version\"/" \ - "$crate/Cargo.toml" -done +find -name Cargo.toml -exec sed -i.bk -e "s/^version = .*/version = \"$version\"/" {} \; # Update our local Cargo.lock (not checked in). cargo update -./scripts/test-all.sh +scripts/test-all.sh # Commands needed to publish. # @@ -37,25 +27,4 @@ echo git commit -a -m "\"Bump version to $version"\" echo git tag v$version echo git push echo git push origin v$version -for crate in \ - wasmtime-environ \ - wasmtime-debug \ - wasmtime-runtime \ - wasmtime-jit \ - wasmtime-wast \ - wasmtime-wasi \ - wasmtime-wasi-c \ - wasmtime-interface-types \ - wasmtime-obj \ - wasmtime-py \ - wasmtime-rust \ - wasmtime-cli \ - wasi-common \ - wasmtime -do - echo cargo publish --manifest-path "$crate/Cargo.toml" - - # Sleep for a few seconds to allow the server to update the index. - # https://internals.rust-lang.org/t/changes-to-how-crates-io-handles-index-updates/9608 - echo sleep 10 -done +echo "find -name Cargo.toml -exec scripts/cargo-chill.sh publish --manifest-path {} \\;" diff --git a/scripts/test-all.sh b/scripts/test-all.sh index 80bac319fc..12ec730704 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -13,7 +13,7 @@ set -euo pipefail # All tests run by this script should be passing at all times. # Repository top-level directory. -topdir=$(dirname "$0") +topdir=$(dirname "$0")/.. cd "$topdir" function banner {