Fix markdown syntax for the Rust programming language.
The link was using a link definition without link.
Since all other links use inline style, this commit also follows this style.
The current documentation was difficult to maintain and not in sync with the inline one.
These changes adjust the setting so we can generate the documentation in markdown format and it will continue to be served on Github pages, this time with an easy way to sync it.
Hopefully this will make it clear that the 2018 edition needs to be
explicitly specified. This caught me by surprise initially, and seems
to have popped up in a few other areas.
See google/cargo-raze#165
See also #335 for discussion on edition defaults from this PR.
* Add support for WebAssembly.
* Add a comment explaining that the npm deps are for the wasm example.
* Use transitions for web assembly.
* Upgrade WASM bindgen and make compatible with Typescript.
* Remove unnecessary setting.
* Re-run cargo-raze.
* Add nodejs rules for the examples workspace.
* Fix link_env missing.
* Bazel 1.0 compatibility.
* Exclude matrix_dylib_test on RBE due to https://github.com/bazelbuild/bazel/issues/9987.
* Ignore the wasm test because rust-lld isn't available on RBE.
* Use extra target triples.
* Remove extra newline.
* Update setup instructions
- The commit hash was not compatible with recent versions of Bazel
- Update the dependency on skylib
- Add the load statement for `http_archive`, for easier copy-pasting
- Add an example of use (users shouldn't have to guess the load label)
- Update the version requirement (0.25.0 can't build the code)
* Remove example
* Also add the dependencies in /examples/WORKSPACE
This allow to runs the tests in examples as a remote repository
and as a local repository.
* Add a dummy Cargo craze to use cargo raze on it.
With this craze, and cargo raze, we can simply use raze generated repositories
to add the necessary dependencies.
* Add generated files for the raze package of protobuf
* Add rust_(proto|grpc)_library
Those library add protobuf / gRPC support to Rust language in Bazel
using the native proto_library. It generates one crate per proto_library
which is efficient for incrementality but can lead to naming collisions.
We expose a bit of rust_library internal to re-use it in rust_proto_library
and create a new provider "rust_libs" that will declare a group of rust libraries.
* Add a gRPC client/server example
And a test with it.
* Add documentation for the rust_(proto|grpc)_library
* Use the new runfiles library in the test rather than a custom algorithm
* Add the missing dependencies to examples/WORKSPACE
This new dependency is quite unfortunate, it make using rules_rust
more complex since it needs to import a bzl file from skylib to be
able to use rules_rust, that adds 10 lines in the WORKSPACE without
much improvement. I guess this cannot be better until recursive
workspace are a thing.
* Generates cargo raze files compatible with macOS and Linux
Also to keep the same lockfile, check in the Cargo.lock and have
a lever to not re-run cargo generate-lockfile.
* Compile all proto stubs in one library
This a workaround a bug in Bazel that prevent the toolchain from being
loaded with the target transition (see
https://github.com/bazelbuild/bazel/pull/5650).
This is not ideal because it recompiles several time the same
proto if you depends on it from several dependency path
and can lead to seeing two compilation of the same proto
as different type. This is also terrible for incremental build
and contrary to the (protobuf blog
entry)[https://blog.bazel.build/2017/02/27/protocol-buffers.html].
* Force set the lazy_static implementation configuration.
The lazy_static crates now set a configuration from the build.rs, ideally we would be
able to handle that but that is not the case with the current cargo raze method.
* Final touch: documenting and simplifying toolchain creation
- Documents how to create your custom toolchain when you need to import
your own crates (or to use a different protobuf/grpc stubs compiler).
- Add extra_aliased_targets to simply the cargo-raze generation
- Use skylark http_archive to import protobuf.
- Regenerate crates with google/cargo-raze#77 so that we don't need to
have custom rewriting policy. Hence, deleted the wrapper around
cargo raze, an update to the build file should simply be
`cargo genrate-lockfiles && cargo raze` now.
* Fix nits suggested by @mfarrugi
* Remove usage of CrateInfos
This was a leftover from compiling the crates in the proto aspect.
* Use python for the optional_output_wrapper
Also move the optional_output_wrapper from the toolchain to the library
itself.
For some reason the runfiles where not shipped to the actions with the
old way which wasn't important for Bash that did not had any runfiles
but it is important for python.
* fix: README format
* Second pass of nits from @mfarrugi
* fix: add back the list of grpc stubs to create if not created
* Split rustc.bzl out of toolchain.bzl
* Use .format instead of %, but not in command builders.
* Make rust_bench_test not a test which required renaming it; rename it to rust_benchmark (breaking change..)
* Reuse helper method.
* Add default cargo environment variable to the execution
Some existing rust code depends on those environment variables being
defined at compile-time using the env!() macro.
This inject the environment variables listed at https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates.
and make "version" an attribute of all rust_* rules.
* Revert incorrect auto-formatting.
* Remove CARGO_DIR & al.
* Fix the example for test in the README
The method is called "greet" not "greeting"
* Actually fix the test...
... by creating a separate greeting method.
* add out_dir_tar common argument, for use with OUT_DIR
* Fix failing test, add missing doc
* Enhance the examples, and fix the test for real this time
* Add another note about out_dir_tar (regd single file)
Removes the hard coded rust_lib output, and declares the output file within the rust_library_impl. This lets us vary the file extension based on the toolchain -- OSX produces .dylib where linux would produce .so, for example.
* Add rust_bench_test rule to run benchmark tests
* Add rust_doc_test rule to run Rust documentation tests.
* Enable rust_test and rust_bench_test to depend directly on a rust_library target.
* Rename rust_docs rule to rust_doc for consistency.
RELNOTES: [rust] Add rust_bench_test and rust_doc_test rules and improve usability of rust_test tule.
--
MOS_MIGRATED_REVID=104648497
Todo:
* Implement rust_bench_test for running benchmarks
* Enable rust_test to depend solely on a rust_library (since many projects
intermix #[test] methods in lib source).
* Improve error checking and handling and prevent rust_binary from directly
depending on cc_library.
* Implement rust_doc for generating rustdoc.
--
MOS_MIGRATED_REVID=96297772