Attention is currently required from: Adrian Taylor.
Patch set 7:Commit-Queue +1
To view, visit change 3503829. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Adrian Taylor.
1 comment:
Patchset:
With this CL (and its dependencies, and the GN patches from https://bugs.chromium.org/p/gn/issues/detail?id=276) I can build rust_gtest_interop_unittests in component build.
That's through of the use of public_deps in here for anything that should be accessible. (It remains to be seen if Rust symbols are correctly visible across components yet.)
To view, visit change 3503829. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: danakj.
Patch set 10:Code-Review +1
2 comments:
Patchset:
This is fantastic! You seem to have got rid of the biggest ugliest wart on our current gn templates.
File build/rust/rust_target.gni:
Nit - wondering if it's worth an assert to cover the case where people define mutually_dependent_public_deps but not the other?
To view, visit change 3503829. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File build/rust/rust_target.gni:
Nit - wondering if it's worth an assert to cover the case where people define mutually_dependent_pub […]
Done
To view, visit change 3503829. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 12:Commit-Queue +2
Chromium LUCI CQ submitted this change.
10 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: build/rust/rust_target.gni
Insertions: 11, Deletions: 2.
The diff is too large to show. Please review the diff.
```
Reorganize and simplify mixed_target and rust_target interactions.
Previously mixed_target would cause rust_target to cleverly spawn extra
targets within itself, in order for mixed_target to depend on a hidden
target, and for Rust code to depend on a separate inner but public
target (known as foo_rs for a mixed-target foo).
As well, mixed_target would generate the Cxx bindings from the Rust
code and include it into the C++ target as source files, then get
rust_target to avoid generating Cxx bindings of its own.
These complexities are reduced now:
- C++ and Rust targets can each depend on a mixed target. This is
done through improving use of public_deps so that both C++ and
Rust dependents can see the pieces that they need to see through
a mixed_target.
- The Rust unittests within also depend on the mixed target.
- The rust_target is the only place that generates C++ headers
via Cxx.
- Reduce the number of groups indirecting between the mixed target
and the rlib to just one (in order to forward to the correct
toolchain and/or insert dependencies for use of the target from
C++.
- Consistently forward testonly and visibility when a template
generates more than 1 target by caching them into _testonly and
_visibility, since forward_variables_from() can only forward a
given variable once.
- Always put generated C++ bindings into a static library, so that if
multiple C++ targets use a Rust library with C++ bindings, they don't
each get a copy of the object files linked into them. In a mixed
target, those headers can include things from the C++ part of the
mixed target. And just like other such users of those headers, any
public_deps need to be depended on for the Cxx-generated headers.
R=adet...@chromium.org
Bug: 1296156
Change-Id: If2b369dc3b3bb219d42f2c3d6c8ffbd73bb64fbb
Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,android-rust-arm-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3503829
Reviewed-by: Adrian Taylor <adet...@chromium.org>
Commit-Queue: danakj <dan...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#978327}
---
M build/rust/cargo_crate.gni
M build/rust/mixed_target.gni
M build/rust/rust_cxx.gni
M build/rust/rust_executable.gni
M build/rust/rust_shared_library.gni
M build/rust/rust_static_library.gni
M build/rust/rust_target.gni
M build/rust/tests/test_cpp_including_rust/BUILD.gn
M build/rust/tests/test_mixed_shared_library/BUILD.gn
M build/rust/tests/test_mixed_static_library/BUILD.gn
M build/rust/tests/test_rust_exe/BUILD.gn
M build/rust/tests/test_rust_multiple_dep_versions_exe/v1/src/lib.rs
M build/rust/tests/test_rust_multiple_dep_versions_exe/v2/src/lib.rs
M build/rust/tests/test_rust_unittests/BUILD.gn
M build/rust/tests/test_serde_jsonrc/BUILD.gn
15 files changed, 300 insertions(+), 324 deletions(-)