commit | 573349d11a0f6c1a0f537351eeb83d720cfca29e | [log] [tgz] |
---|---|---|
author | Devin Jeanpierre <jeanpierreda@google.com> | Thu Apr 20 14:03:42 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Apr 20 14:04:16 2023 -0700 |
tree | 1a886b389decd8cad0138bb10a3b58601c3e7b47 | |
parent | 5311a1ef80314e952e62bad74d0e72a1a256e556 [diff] |
Disable tests that can't run on ARM itself. These tests, by and large, fail because they depend on `clang-format`. Note that `clang-format` is a build-time dependency, and thus we only ever use it from `x86`. So, strictly speaking, these tests _do not need to run on ARM_. Instead, they can run on x86, and where they intersect with ARM, it's only via cross-compilation, and we should forward the appropriate flags to clang/etc. to make it target an arm triple. Maybe this is optional and we can just never run these tests, instead relying exclusively on integration tests to assure us that Crubit works on ARM. I'm not really sure that's a good idea, though. :) It is probably especially important to do this kind of parameterization when we add support for the Windows ABI, which is much trickier than just Itanium-ARM. PiperOrigin-RevId: 525843912
Crubit is an experimental bidirectional bindings generator 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.
Crubit allows for C++ code and Rust code to call each other without manually wrapping the APIs in an FFI-friendly interop layer. For example, a C++ function like this:
bool IsAbsPath(std::string_view path);
... becomes callable from Rust as if it were defined as:
pub fn IsAbsPath(path: std::string_view) -> bool {...}
Crubit automatically generates ABI-compatible bindings for structs (which can be passed both by value and by reference), functions, and methods, for a large variety of types. (Trivial types, nontrivial types, templated types, etc.)
$ 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