VndkUseCoreVariant feature is deprecated along with VNDK. This change
removes related code from Soong.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ie182c9e4dc9cf0a4fe9d5fddf5b36754ddb53d18
Focusing on the properties needed to remove soong config modules from
packages/modules/Virtualization.
- prebuilt_etc's src and srcs
- filegroup's srcs and exclude_srcs
- rust's cfgs
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: I6971da744a17955f98104948e6f9614776955782
This adds an option to disable LTO when building a Rust module. This is
mostly intended to speedu p local prototyping, and LTO should not
normally be disabled for production builds.
Bug: 339628497
Test: m blueprint_tests && m rust
Change-Id: I21d5d4513a259a56f101ce8906e2bef7404e4efb
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.
Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.
This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.
This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.
Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests
Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
Refactor transformSrctoCrate and the functions it calls to not rely
on rust.ModuleContext, preparing it to be callable from soong-cc
context to build a Rust staticlib.
This also refactors out common default flags used when building
libraries, again to prepare for building a Rust staticlib from
a soong-cc context.
Bug: 254469782
Test: m blueprint_tests && m
Change-Id: I678f6fee989c61bb15c340b9887e4d1934991907
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().
To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.
Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()
Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
To handle static inline functions, bindgen generates a C file which is
expected to be compiled and linked into dependents on the generated
bindgen source.
This CL adds support for cc modules ingesting this output and for
bindgen to produce it (and link it against the bindgen rust_library
variant as well).
Bug: 290347127
Test: m blueprint_tests
Test: Example module with static inline functions builds locally
Change-Id: I167a8356eb6e0059fc21169fd3bfc6bf4d9c812f
This allows using select statements with it.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
This adds a cfg flag `android_platform` which can be used
to indicate there's some conditional compilation need specific to
AOSP.
Test: New flag is emitted on builds
Change-Id: I833a7d68db2dad7ab2d32a5eb51d764f0d66b849
When switching from an initially found host module to a later found
device module, we passed `cInfo.Deps` through. This actually suppresses
addition of some modules, which was not the intention.
Bug: 336695421
Test: SOONG_GEN_RUST_PROJECT=1 m blueprint_tests
Test: check rust-projects.json manually afterwards for deps
Change-Id: Ib90f9c755e07f88e85a3b3cbd9bc698cce8af038
Shorten the command line for generating rust protobuf sources
by sharding the sources into groups of 50 source files.
Bug: 322564768
Bug: 336323108
Test: builds
Change-Id: Ia8069cdaf49f9a42d14a83139545ba61277418e0
Adds support for bindgen to be able to handle `static inline`
functions. This is done by adding a new boolean field to the `BindgenProperties`
struct, `Handle_static_inline` (default to false).
If this field is true, then the flags to trigger bindgen support of
static inline functions are passed in.
The rust-bindgen documentation list two ways of handling `static inline`
functions, both specified with command line args.
1) --generate-inline-functions
2) --experimental --wrap-static-fns
Option 1 requires some extra effort on the part of the C library developer, in
that they have to expose the function symbols: the docs (linked below) explain
that this is often done by compiling the library with inlining disabled, which
can be detrimental to performance.
Option 2 requires no effort on the part of the C library developer, but it does
require the `--experimental` flag, since this feature is still under development.
This CL goes with option 2.
Relevant docs: https://github.com/rust-lang/rust-bindgen/discussions/2405
This CL also adds a new test: TestBindgenHandleStaticInlining in bindgen_test.go
Test: m blueprint_tests
Change-Id: If28000e3f3ccecc65c4cae1c62d7bf455454239a
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.
Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
As of VNDK deprecation, Device VNDK version should no longer be used
from build. This change removes all references on Device VNDK version
and related logic with it.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ibc290f0b41e8321f80c75c69f810223989af68dc
Existing snapshot code will no longer work from VNDK deprecation, but it
can give confusion to users if we keep code for the snapshot - and it
adds complexity on existing code while it is not in use. This change
removes all snapshot definition except host snapshot and its usage.
Bug: 330100430
Bug: 332986564
Test: AOSP CF build succeeded
Change-Id: Ieb6fa43d5e38315c662ce997bc305b744b367c24
VNDK is deprecated in 24Q2, so soong should be tested with no device and
platform vndk versions. This change removes all VNDK related tests and
VNDK versions from soong-etc, soong-rust and soong-sysprop tests.
Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ie34d23f0facab31078de54682f7cc78d37fcd4be
Static libraries were being appended to the list of header library
dependencies. They should not be. This also makes sure we track them
appropriately in Make.
Test: m blueprint_tests
Change-Id: Ifa664f09fe2102aea57d22cbaaeba71f0c26074d
Modules with special characters wouldn't build correctly because $out
was being double escaped -- once in the build command and once by Soong
itself.
Remove the escape in the build command and just let Soong escape as
necessary.
Bug: 320578837
Test: Module with @ in name builds
Change-Id: Ic2554b9c07f37783287e1ebdeb06ef8b7b66a296
VNDK is deprecated in 24Q2, so soong should be tested with no device and
platform vndk versions. This change removes all VNDK related tests and
VNDK versions from soong-cc and soong-apex tests.
Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: I45e6c13e6c0a6bc9710b120e8d5b167e2051631e
Remove vendor_snapshot_test from cc and rust as they are no longer in
support.
Bug: 330100430
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ia798bc1c87d3f1d73ea5866dc85ff4073f5f9c5b
The cc property include_dirs is neverallowed in certain paths since it
has been deprecated. The property in rust_ffi modules with the same name functionally works the same way as the CC property export_include_dirs.
To reduce confusion, and avoid triggering the neverallow rule, deprecate
include_dirs and create an export_include_dirs property which does the
same thing. This brings rust module properties into better alignment
with cc module property as well, reducing confusion.
Bug: 330736943
Test: New Soong test
Change-Id: Ib2020a22e6747ac690c46dbff84e38744f93ed15
This is equivalent to specifying a dependency name different to the
package name in cargo, which some external crates do.
Bug: 308790322
Test: Built libgrpcio with aliases for protobuf
Change-Id: I2801222051fdd962460cc7f4900cec357f63b974
https://rust-lang.github.io/rust-clippy/master/index.html#/disallowed_names
The current list is extremely short ("foo", "baz", "quux"), and thus
this really just prevents people from temporarily using `foo` to debug
code. In the spirit of improving productivity and reducing frustration,
it's easier to just allow this.
Bug: N/A
Test: TH
Change-Id: I50b65486ed2b58bfd2cf699ee3b43b936d25f2cb
This reverts commit 2766baa922.
Reason for revert: Relanding after fix in I3b190ebc1a1096972d0a1273e490972e04684dd2
Change-Id: Ie34301c506d3469ec3306f433631b0842b66d032