rules_rust/.bazelignore

8 lines
118 B
Plaintext
Raw Permalink Normal View History

bzlmod
docs
examples
crate_universe/private/bootstrap
test/bzlmod_repo_mapping
test/cc_common_link
Support for `no_std` mode (#1934) Initial support for `no_std` mode. This allows us to 1. Don't pass the whole standard library to compile actions that specify `no_std` 2. Conditionally select `crate_features` and `deps` based on whether `no_std` mode is used. Currently the only supported modes are `off` and `alloc`, with a possibility to expand in the future. The `no_std` support comes with the following caveats: 1. Targets in `exec` mode are still built with `std`; the logic here being that if a device has enough space to run bazel and rustc, std's presence would not be a problem. This also saves some additional transitions on `proc_macro`s (they need `std`), as they are built in `exec` mode. 2. Tests are still built with `std`, as `libtest` depends on `libstd` There is quite an ugly hack to make us be able to `select` on the `no_std` flavor taking `exec` into account; I'm looking forward to the day where Bazel will expose better ways to inspect the cfg. There is also one part I didn't manage to make work - having a `rust_test` that tests the `rust_shared_library` in `cc_common.link` mode; I got a link error for missing `__rg_alloc` & co. symbols, which should be present as we pass `--@rules_rust//rust/settings:experimental_use_global_allocator=True`. Unfortunately I could only spot this error on CI, and could not reproduce locally. I removed the test because the `rust_shared_library` is already tested via a `cc_test`. I will however give another shot at inspecting how my local setup differs from CI. The `rust_binary` source code in `main.rs` was borrowed from https://github.com/jfarrell468/no_std_examples, big thanks to @jfarrell468 for letting me use it. Co-authored-by: Krasimir Georgiev <krasimir@google.com> Co-authored-by: UebelAndre <github@uebelandre.com>
2023-05-03 12:38:47 +00:00
test/no_std
.direnv