diff --git a/rust/release_crates/README.md b/rust/release_crates/README.md new file mode 100644 index 000000000000..4ca9a2ae9823 --- /dev/null +++ b/rust/release_crates/README.md @@ -0,0 +1,4 @@ +This directory contains one directory per crate that we release. + +Each directory contains a pkg_tar() which packages up the crate into a tar which +can be pushed to crates.io. \ No newline at end of file diff --git a/rust/release_crates/cargo_test.sh b/rust/release_crates/cargo_test.sh index 19bb4dd7b4fd..933f2d7c502c 100755 --- a/rust/release_crates/cargo_test.sh +++ b/rust/release_crates/cargo_test.sh @@ -1,5 +1,7 @@ #!/bin/bash -# Runs tests that are defined in the protobuf crate using Cargo. +# Runs tests that are defined in the protobuf crate using Cargo. This also +# performs a publish dry-run, which catches some but not all issues that +# would prevent the crates from being published. # This is not a hermetic task because Cargo will fetch the needed # dependencies from crates.io @@ -59,9 +61,15 @@ tar -xvf $EXAMPLE_TAR -C $EXAMPLE_ROOT cd $CRATE_ROOT # Run all tests except doctests CARGO_HOME=$CARGO_HOME cargo test --lib --bins --tests +CARGO_HOME=$CARGO_HOME cargo publish --dry-run cd $CODEGEN_ROOT CARGO_HOME=$CARGO_HOME cargo test --lib --bins --tests +CARGO_HOME=$CARGO_HOME cargo publish --dry-run cd $EXAMPLE_ROOT CARGO_HOME=$CARGO_HOME cargo test +# TODO: Cannot enable this dry-run yet because it checks that the versions of +# its dependencies are published on crates.io, which they are definitely not +# in this case. +# CARGO_HOME=$CARGO_HOME cargo publish --dry-run diff --git a/rust/release_crates/protobuf/BUILD b/rust/release_crates/protobuf/BUILD index 27032c7779ea..bb2cc89b934b 100644 --- a/rust/release_crates/protobuf/BUILD +++ b/rust/release_crates/protobuf/BUILD @@ -29,6 +29,7 @@ genrule( filegroup( name = "srcs", srcs = [ + "README.md", "build.rs", ":gen_cargo_toml", ], diff --git a/rust/release_crates/protobuf/README.md b/rust/release_crates/protobuf/README.md new file mode 100644 index 000000000000..9ef7972aca1e --- /dev/null +++ b/rust/release_crates/protobuf/README.md @@ -0,0 +1 @@ +The runtime of the official Google Rust Protobuf implementation. \ No newline at end of file diff --git a/rust/release_crates/protobuf_codegen/BUILD b/rust/release_crates/protobuf_codegen/BUILD index 581ebf2b5da6..e2ddf85deec0 100644 --- a/rust/release_crates/protobuf_codegen/BUILD +++ b/rust/release_crates/protobuf_codegen/BUILD @@ -29,6 +29,7 @@ genrule( filegroup( name = "srcs", srcs = [ + "README.md", ":gen_cargo_toml", ] + glob(["src/**/*"]), visibility = ["//rust:__subpackages__"], diff --git a/rust/release_crates/protobuf_codegen/README.md b/rust/release_crates/protobuf_codegen/README.md new file mode 100644 index 000000000000..285334dc22d6 --- /dev/null +++ b/rust/release_crates/protobuf_codegen/README.md @@ -0,0 +1,2 @@ +The build time dependency crate for generating code for the Google Rust Protobuf +implementation. \ No newline at end of file diff --git a/rust/release_crates/protobuf_example/README.md b/rust/release_crates/protobuf_example/README.md new file mode 100644 index 000000000000..b48570c12c40 --- /dev/null +++ b/rust/release_crates/protobuf_example/README.md @@ -0,0 +1,2 @@ +An example that demonstrates how to use the `protobuf` and `protobuf_codegen` +crates together. \ No newline at end of file