Commit Graph

42 Commits

Author SHA1 Message Date
Marcel Hlopko 31dbabd931
Remove deleted pipeline from README (#934) 2021-09-10 10:07:14 +02:00
UebelAndre 7e7246f6c4
Update README community section (#810)
* Removed link to google group in prep for github discussions

* Attempt to address feedback
2021-06-29 12:56:19 -07:00
Régis Décamps 116b4e2790
Add Missing link definition in README.md (#597)
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.
2021-02-21 17:05:24 +00:00
Marcel Hlopko 4fbf3cf1d7
Add mailing list and chat pointers to the README (#568)
* Add mailing list and chat pointers to the README
* Update README.md

Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
2021-02-01 15:10:13 +01:00
Marcel Hlopko baa28dbbd4
Update README.md to reflect master->main branch rename (#563) 2021-01-28 15:24:36 -08:00
Damien Martin-Guillerez a37e0f43d9
Make stardoc our documentation tool (#359)
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.
2020-06-30 12:05:23 +02:00
David Freese 43a18e9c64
Add edition to rust_repositories, and update README (#334)
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.
2020-06-11 13:47:38 -07:00
Louis Taylor 31892465c4
Allow specifying rust versions (#307) 2020-04-20 16:57:10 -04:00
Marcel Hlopko 1920386592
Add badge for incompatible flag pipeline (#259)
https://buildkite.com/bazel/rules-rust-plus-bazelisk-migrate
2019-11-01 09:58:13 +01:00
John Edmonds 7cde1e46e9 Add support for wasm-bindgen. (#240)
* 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.
2019-10-31 10:34:25 -07:00
Laurent Le Brun 29acd8fe69 Update setup instructions (#254)
* 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
2019-10-08 09:57:41 +02:00
Marco Farrugia 5894d35bb7
Fix setup snippet in the README (#167) (#184) 2019-01-10 00:28:33 -05:00
Marco Farrugia 84aa676711
Get stardoc working and update docs. #140 (#174) 2018-12-19 20:21:18 -05:00
Damien Martin-Guillerez e008ebe9a5 Protobuf support (#92)
* 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
2018-11-13 10:27:19 -08:00
Marco Farrugia f8ad07217c
Look for ${crate_name}.rs as a crate_root by default. (#137) 2018-10-20 23:34:09 +00:00
Marco Farrugia d33bf1d2d9
Separate api / impls, split out rustdoc.bzl (#123)
* Separate out rustdoc.bzl, split rust.bzl api / implementation.
* Remove unused 'allow_cc_deps' vars
* Remove redundant docstrings and comments.
2018-08-27 21:36:20 -04:00
Marco Farrugia 9aeeda951c
Easy cleanup steps of #117 (#121)
* 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.
2018-08-20 23:23:16 -04:00
Damien Martin-Guillerez 48be119560 Add default cargo environment variable to the execution (#89)
* 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.
2018-05-30 08:58:03 -07:00
Damien Martin-Guillerez 9404966336 Fix the example for test in the README (#88)
* 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.
2018-05-27 08:45:06 -07:00
Alex McArther a3239d3289
Update readme for 0.0.6 (#81) 2018-03-28 14:50:50 -07:00
Alex McArther ee61ddff0b
Make badge use master status (part II) (#76)
The last iteration of this fix only fixed the path to the status page -- we also need to fix the SVG url.
2018-03-12 16:44:53 -07:00
Alex McArther df95c3e3cd
Add out_dir_tar common argument for all rust_* rules (#48)
* 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)
2018-03-07 20:48:26 -08:00
Alex McArther d20f528428
Fix the Build Status badge to point at master
... not the last run build

cc @buchgr
2018-02-28 20:42:19 -08:00
Alex McArther c9ef636ea2
Support crate_type file extensions more fully (#38)
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.
2018-02-26 13:10:38 -08:00
Jakob Buchgraber 1e46709152
add new bazel ci configuration (#73) 2018-02-23 15:45:37 +01:00
Marco Farrugia 85c9aad4a9 Update README to address bazel version (#60) 2018-02-13 13:10:05 -08:00
katre 3ad4922995 Update documentation with the right load() for rust_repositories. (#57) 2018-01-26 14:11:58 -08:00
Justine Tunney 0f4e196a5a Recommend redundant URLs for installation (#42)
See go/bazel-downloader for more information. This feature was made
possible by ed7ced0018
2017-03-30 03:56:12 -07:00
David Z. Chen 976f1dabbb Update documentation for 0.0.5 release. (#32) 2017-02-16 14:35:46 -08:00
David Z. Chen af51375192 Update documentation for 0.0.4 release. (#30) 2017-02-16 13:56:59 -08:00
David Z. Chen a99a4a9e44 Update to Rust 1.11. Bump version for rules_rust in README to 0.0.3. (#22) 2016-09-04 01:00:48 -07:00
MAYAH 7edec12e9c Update tag to 0.0.2 in README (#15)
tag = 0.0.1 does not work for the latest bazel (version 0.3.0)
2016-06-30 12:07:17 -07:00
Alex Gaynor eb5dc027c9 Added a missing param in a signature (#5) 2016-05-09 10:03:42 +02:00
Kristina Chodorow 5c4faadf4c Move rust rules to their own repository 2016-03-04 15:11:40 -05:00
Damien Martin-Guillerez 0e43cb1a34 Update documentation of skylark rules: correct load statements
Fixes #864.

--
MOS_MIGRATED_REVID=114208872
2016-02-10 10:22:21 +00:00
David Chen 171e6db435 [rust] Use load() to add external repositories.
--
MOS_MIGRATED_REVID=109195094
2015-12-02 22:25:52 +00:00
David Chen ed85646e37 Tweak styling of Skylark rule READMEs to be consistent when viewed on
external site.

--
MOS_MIGRATED_REVID=106135529
2015-10-23 14:56:56 +00:00
David Chen eb5d9b8685 [rust] Add rust_bench_test and rust_doc_test rules and improve usability of rust_test rule.
* 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
2015-10-05 15:16:40 +00:00
David Chen 19fcbbb1fd Add rust_docs rule
Additional updates to Rust rules:
* Consolidate BUILD files for Rust distribution.
* Prevent rust_binary from depending directly on cc_library.
* Update Rust version to 1.3.0

RELNOTES: [rust] Add rust_docs rule for generating rustdoc.

--
MOS_MIGRATED_REVID=103827592
2015-09-24 14:22:00 +00:00
David Chen a827976e5e Update Rust rules to use Rust 1.2.0. Rename features attribute to
crate_features to fix conflict with new default features attribute.

--
MOS_MIGRATED_REVID=101454678
2015-08-26 07:35:02 +00:00
David Chen 648d83a62a Add tools dependencies for Rust rules.
TESTED=manual

--
MOS_MIGRATED_REVID=99161344
2015-07-27 12:58:38 +00:00
David Chen 0e7cec2712 Add initial Rust rules to Bazel.
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
2015-06-18 15:57:13 +00:00