For Rust dylibs we generate a file suffix of .dylib.so. rustc seems to
split the output filename for the gcno file at the first '.', so instead
of libfoo.dylib.gcno (which our build system expects), it produces
libfoo.gcno.
This fixes the mismatch so the build system can find the gcno file that
gets produced for Rust dylibs.
Bug: 170983066
Test: CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS=external/rust/crates \
m libandroid_log_sys
Change-Id: Icba48bf10ab06c255bd17053d57feb889b1f9ee5
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.
Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
The usage of the well known type Empty requires a hack in the module
above the grpc implementation, this is now the generated stem_mod.rs
This also adds additional implicit dependencies that are required by
the grpc protobuf generated code. This includes the addition of a
'header_libs' property for library dependencies which export include
paths required by protos.
We also now include both the protos and the grpcio in the library
variant via the mod_stem.rs.
Bug: 172592789
Bug: 171504899
Test: m nothing
Test: Example rust_grpcio module build command includes dependencies,
include paths.
Change-Id: I187a13cd5cdea991828a1020314de16727e4f74e
The OUT_DIR for rustc is incorrectly calculated when Soong's OUT_DIR
is set to an absolute path through OUT_DIR_COMMON_BASE. This breaks
compilation when rustc is unable to find files that have beein included
through the include! macro.
Bug: 172952634
Test: OUT_DIR_COMMON_BASE=/some/abs/path m
Change-Id: Id447630a7774c1dec655f65dd227c144a159e1b1
When using the grpc generator, the plugin expects to also have access to
the protobuf generator. This patch ensures that aprotoc will use the
Soong copy of the protobuf generator, rather than trying to use a
locally installed version from PATH.
Test: m nothing
Change-Id: I26da4d18c97017da7d8cd9515a07a2b7b2575342
In 1.47.0, std::env requires the STD_ENV_ARCH environment variable to be
set to the target architecture [1].
[1] 8e8939b804/library/std/src/env.rs (L866)
Bug: 171280890
Test: cd external/rust; mm
Change-Id: If4ddf4b9bad2a1a7518a358a5fb597170a97c67e
Adds a new SourceProvider type to generate grpcio code from protos.
Since it's so similar to protobuf, it's basically just a different type
of rust_protobuf.
Bug: 171504899
Test: Example module compiles.
Change-Id: I9882f3ac4d4aeaae0191f2b557e9612b5c7a9ac9
The stubs methods are very specific to cc for now, move them out
of LinkableInterface so they are not shared with rust. Instead,
create a cc.Module.library field that contains the libraryInterface
to simplify calling libraryInterface methods on cc modules.
Test: all Soong tests
Test: no change to Soong outputs
Change-Id: I0289d866ce1f7a765631fe3101a62b1b4988ba1c
Add vendor_ramdisk_available and vendor_ramdisk attribute to
various rules. When a vendor_ramdisk variant of a module is
generated, it is installed to $OUT/vendor-ramdisk.
It is similar to a ramdisk image.
Test: m nothing -j
Change-Id: Ib2d16459f3094dbe21c3bdb7c016cb4b2bf62765
If -x c++ is passed through a modules cflags, it will be overridden by a
-x c and -std flag added by the build system if the extension is not
.hpp/.hh and cpp_std is not set. This leads to confusing behavior.
Instead, add a helpful error message to guide developers towards the
correct way to specify when a header is a C++ header and which std
version should be used.
Bug: 171011490
Test: m nothing
Change-Id: I7e7cba504798d47ce1c753ba8699d7475a95095b
The arguments passed to rustfmt have changed from those used in the
previously referenced CL so update the comment to reference a CL using
the new arguments.
Bug: 164111102
Test: None
Change-Id: I962d56ed36422709a1fcd07ca95f1c015daa6339
Rust will be used for a few virtualization related components so allow
it to be used in the directory in which those components will reside.
Test: built a rust binary in the directory
Change-Id: I805d6117201c2144f7ecf21ec38b577c7c21e9c5
Implement stubsVersions on *llndkStubDecorator and *stubDecorator to
handle the special cases in versionSelectorMutator.
Test: m checkbuild
Change-Id: Idc985c52f91450df42c0275b2b2acef3f2ed8868
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly. Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module. Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.
Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
Targets[Android][0] is not always the first, preferred target. Add a new
field to config to provide the correct target and begin to use it.
Test: m nothing
Test: build/soong/scripts/build-ndk-prebuilts.sh
Fixes: 156980228
Change-Id: Ib56f52424ebf47f3eee6ac62b9fd9eca2919d63a
This reverts commit 323dc60712.
Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests
Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
* Upgrade to new protobuf-codegen; use its standard
default output without local change.
* Allow a sourceProvider to have multiple output files.
For a stem.proto file, output stem.rs and mod_stem.rs.
* New protobuf-codegen option gen_mod_rs always generates
output file named "mod.rs". To generate multiple .proto
files into the same output directory, we need to rename
mod.rs to mod_<stem>.rs.
* Instead of using the gen_mod_rs option and renaming mod.rs
to mod_<stem>.rs, we generate the same mod_<stem>.rs
directly with a simple printf command.
Bug: 170256643
Test: atest -c --host --include-subdirs external/crosvm
Change-Id: Ia09e41029099a6de4d35c96dbabd9ba5514c9019
Pulls out all of the per-file rules into their relevant directories
so platform/build/soong:/OWNERS can be included everywhere we need
the list of build system owners.
Test: treehugger
Bug: 170407947
Change-Id: I5a4b2d252bd9b3c280cd9954cf0e65ac21153ede
Move to a builder pattern to increase flexibility when generating the
test configuration. The testRust, testRustCov and testRustError are kept
as main entry points for standard tests. Add documentation.
Test: m nothing
Change-Id: I891bec982ff2d65413f150d2395edf0fb0d68a43
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.
Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
* changes:
Don't create version variations of sdk modules
Create fewer empty version variants
Don't make SplitPerApiLevel imply UseSdk
Remove vendor crt special case
Fix apex_test.go and add it to Android.bp
Don't create empty version variants for binaries, objects, rust
rlibs or rust dylibs.
Test: no change to build.ninja
Change-Id: I62d4d43da476eafdb258a08b5ada758bb2971a1a
UseSdk was returning true when SplitPerApiLevel returned true,
which was causing the platform variant of SplitPerApiLevel
module to compile against the SDK. Check SplitPerApiLevel
separately in the sdkMutator instead.
Test: m checkbuild
Change-Id: I0ae667d48a3b7b96709a6cad8e8ea9701659fc2a
Adds the "static_executable" property to rust_binary modules which
allows for building fully static executables. This only impacts bionic
targets.
Bug: 169434439
Test: rust_binary module with static_executable true builds, runs on
device.
Change-Id: I83c19fddd070859b7e56d248237cfd73e1768519