commit | 89230f3595abdfca1e3f7e5621a1d6cc974a79c0 | [log] [tgz] |
---|---|---|
author | Devin Jeanpierre <jeanpierreda@google.com> | Wed Mar 15 12:27:02 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Mar 15 12:27:38 2023 -0700 |
tree | baf507adb197a1cfad4ef187d7497b3b1a470bf6 | |
parent | 95b7c2f3e060746a4bb7d5a3845a2dc86f19f56b [diff] |
Handle colon-less and relative bazel labels in `ir.rs`. This has been bugging me for a while now -- not because I'd predict it to be a real issue, but just because it feels weird to rely on a specific formatting of bazel labels. This has bitten me in the past with e.g. unknown commit. I restrained myself until now, but it's still kind of bothering me that we crash on `//foo` syntax. I took the most expedient option of fixing it the simplest way I know how. The alternative would have been to make the field private, and validate the input at parsing time (e.g. defining `TryFrom` instead of `From`, and validating that the label meets basic validity checks. I chose not to because it's a lot more work than to accept invalid labels without crashing. This probably won't actually affect anything, but if we ever find ourselves forwarding bazel labels along using non-canonicalized form of `//foo:bar`, we will DTRT. Hopefully that doesn't hide any problems. PiperOrigin-RevId: 516897644
Extremely experimental interop tooling for C++ and Rust.
Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.
$ apt install clang lld bazel $ git clone git@github.com:google/crubit.git $ cd crubit $ bazel build --linkopt=-fuse-ld=/usr/bin/ld.lld //rs_bindings_from_cc:rs_bindings_from_cc_impl
$ git clone https://github.com/llvm/llvm-project $ cd llvm-project $ CC=clang CXX=clang++ cmake -S llvm -B build -DLLVM_ENABLE_PROJECTS='clang' -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install $ cmake --build build -j $ # wait... $ cmake --install build $ cd ../crubit $ LLVM_INSTALL_PATH=../llvm-project/install bazel build //rs_bindings_from_cc:rs_bindings_from_cc_impl