This updates docs to be built using
[mdbook](https://rust-lang.github.io/mdBook/) for improved readability
and search-ability. Note that the raw markdown from stardoc is still
committed to the repo and can be easily viewed at any commit to ensure
users are able to get the correct docs for their current version of
rules_rust.
Previously the bzlmod symbols were not documented at all, and in places
they are different from the WORKSPACE versions.
This at least hosts both.
Fixes #2696
`integrity` is preferred because it works for both `http_archive`
(legacy) and `archive_override` (bzlmod). `sha256` only works for
`http_archive`. Context: https://github.com/bazelbuild/bazel/pull/20156
I confirmed that `xxd` and `base64` commands are available in the GitHub
ubuntu-20.04 runner:
![Screenshot from 2024-01-02
17-24-23](https://github.com/bazelbuild/rules_rust/assets/1940490/a30e58c4-fd78-4c37-969d-1938b2dc2215)
and that this produces an integrity string that checks out with what
Bazel wants. See
17f46ec7a5
for a successful use of `integrity` with `http_archive`:
```starlark
# WORKSPACE.bazel
http_archive(
name = "rules_rust",
integrity = "sha256-p2HVTknbBvhjRo5rukoTJSsb1Jno9wbaZeJ5s7y8XFI=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.36.2/rules_rust-v0.36.2.tar.gz"],
)
```
and https://github.com/dtolnay/cxx/pull/1294 for a successful use of
`integrity` with `archive_override`.
```starlark
# MODULE.bazel
archive_override(
module_name = "rules_rust",
integrity = "sha256-p2HVTknbBvhjRo5rukoTJSsb1Jno9wbaZeJ5s7y8XFI=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.36.2/rules_rust-v0.36.2.tar.gz"],
)
```
`sha256` does not work in `archive_override`.
```console
ERROR: Traceback (most recent call last):
File "/git/cxx/MODULE.bazel", line 5, column 17, in <toplevel>
archive_override(
Error in archive_override: archive_override() got unexpected keyword argument 'sha256'
ERROR: Error computing the main repository mapping: error executing MODULE.bazel file for <root>
```
This PR converts the core `rust_wasm_bindgen` rule into a standalone
rule that users can user to write custom interfaces into any
rules/targets they desire while also supporting interfaces for existing
Javascript rule sets. Users loading the root `@rules_rust//wasm_bindgen`
symbols will be using the core Rust rules, where users loading symbols
from the new sub directories `rules_nodejs` and `rules_js` will have
variants that offer better integrations.
Right now our release tars are ~40MB and contain about 125MB of compiled
rust output which shouldn't be used - the release actually instructs
Bazel to download the compiled executables from elsewhere.
We need to work out how users should consume these binaries, but for now
this reliably fails so let's stop doing it.
Instead, `cat` out what the the contents of the generated file _would_
be, for easy copy and paste by people working on the rules.
This github action should not run on forks. This prevents each job from being kicked off in cases where users open a PR from their fork if they make changes on their `main` branch.
* Added bootstrap script for crate_universe and github action for auto-releasing new binaries
* Addressed PR feedback
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
* Updated local dev documentation
* Add announce_rc to crate_universe.bazelrc
* Addressed buildifier defect
* Addressed additional user feedback
* Apply suggestions from code review
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
* Fixed missing extension for windows.
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>