Age | Commit message (Collapse) | Author |
|
Because dylibs don't export symbols of whole-archive staticlibs, we
simulate this by propagating those static libs through to dependent
modules. Similarly, we must do the same for rlibs from cc_* modules used
to generate MTO staticlibs.
Bug: 395915782
Test: New soong tests
Test: m rust
Change-Id: I83d6a08234af04af5039764f5a80f659b24aa132
|
|
|
|
If a cc_library_static has a whole_static dependency against a
rust_ffi_static module, we need to ensure that rust_* dependents of the
cc_library_static don't just throw away the rlibs the cc_library_static
module is intending to include whole (and does so by propagating them
down to dependents to be included in the generated Rust staticlib).
This reuses the plumbing we have in cc to generate a Rust staticlib
from the propagated dependencies.
Bug: 395915782
Test: m rust
Change-Id: I413c8d2476e0b2a1c623581fdbfb5734a62ae455
|
|
"bcp_dependency_through_apex" into main
* changes:
Convert android.TransitionMutator to TransitionInfo
Pass libraryToApex and apexNameToFragment mappings into CreateClasspathElements
Convert apex transition tag to dependency on apex
Add extra dependency from apex to bootclasspath fragments to modules
Move prebuilt mutators earlier
|
|
|
|
Move the prebuilt mutators from postdeps to predeps mutators. This
ensures that the decisions on whether the source or prebuilt will
be used can be made earlier, which simplifies the apex and dexpreopt
code, allowing it to directly depend on the correct module.
This requires some mutators that previously ran before the prebuilt
mutator and now run after the prebuilt mutator be aware of prebuilts.
In particular, the cc.linkageTransitionMutator and
rust.libraryTransitionMutator now have to manually disable prebuilts
when they don't produce a static or shared variant that the source
module produces, and some mutators have to ignore PrebuiltDepTag
dependencies when propagating transitions.
The apexTransitionMutator also needs to temporarily use an interface
on the dependency tag to correctly resolve some dependencies that
exist before the apex variation is created onto the correct variation.
This will shortly be replaced with depending on the apex itself instead,
and then walking the dependencies of the apex to find the necessary
module.
Bug: 372543712
Test: go test ./...
Change-Id: If125ea981be87673bae3bd0a7e3b2c16c337e8f7
|
|
|
|
Rename the Rust flag and export info providers to make it more clear
when workign with the Rust exporter vs the cc exporter.
Also renames a test for additional clarity.
Test: m blueprint_tests
Change-Id: I652b55ef000a2cd00f47b1dbfe86713c33ae9d63
|
|
A dylib link is a final link, so we should not propagate staticlibs
through them. Most of the time this made no difference, but this
was breaking edge cases on coverage builds.
This CL breaks apart linkObjects so we can more finely tune which
dependencies we propagate and which we should not.
rlibs should only propagate non-whole static librares, while rlibs and
dylibs propagate whole static libs.
Bug: 377932175
Test: m
Test: New Soong tests
Change-Id: Ib2ae3dcb7d775a57bd4b1715ec528f48cc0ca026
|
|
Stubs don't have code by definition, so we shouldn't be producing
coverage variants for them.
Bug: 393556022
Test: m <cov stubs> # inidicates target no longer exists
Change-Id: I82a2848075259b9f115b19c46019ada3d29bad41
|
|
This leads to idendical results as before, with the exception of
the "required" field in module-info.json. Make has more complicated
logic to fill out the required field than soong, and it leads to
make-specific names such as ones suffixed with :32 and don't make sense
in soong. I'm don't think there are critical users of that field though,
so I'll try removing it.
Everything else should be identical to the make-generated information
though.
Bug: 389720048
Test: diff'd module-info.json before and after this cl in soong+make mode
Change-Id: I74aefe578287f07474c15e5f92a0c2780a679047
|
|
We don't need to pass crt objects to generate stubs, and doing so
results in missing symbol errors at link time.
Bug: 203478530
Test: m <rust stubs_library>
Change-Id: Id400ae2db2530f84cea3b0a5cda4d9841d7a6985
|
|
This adds stubs support for rust_ffi and rust_ffi_shared modules. Usage
should match current cc usage. The stubs generator leveraged is the cc
stubs generator.
Bug: 203478530
Test: m blueprint_tests
Change-Id: I043b9714a357cd5fe17c183ccdf86900f5172e0e
|
|
This CL largely handles this refactoring in preparation for Rust stubs
support.
Rust modules need to be able to communicate stubs information to cc, and
certain bits of cc needs to be exported so rust can reuse them.
A new VersionedLinkableInterface is added to capture most of the
stubs-related interface definitions.
Bug: 203478530
Test: m blueprint_tests
Change-Id: I380225402fa85a3c39e7b18deb657054b3a52fbe
|
|
`rustc` added an unstable feature that makes `--extern` do what we
originally wanted - it links the provided library, *even* if the source
code does not reference it.
The primary use case for this is that it makes it possible for us to
build dylibs out of `#![no_std]` crates without modifying the source,
because we can pass in `--extern force:path/to/libstd.dylib.so`.
Bug: 168927099
Test: m, TH
Change-Id: Ibc3b75012d54b73e40ae609784cdc74e02e8f008
|
|
|
|
|
|
rust_ffi_static and rust_ffi_rlibs both alias to rust_library_rlib now.
We need to think about whether we need these aliases at all.
There are no users of rust_ffi_rlibs at the moment as developers are
continuing to declare rust_ffi_static modules. Let's remove this alias
in the meantime at least to simplify things.
Bug: 350633786
Bug: 383552450
Test: m blueprint_tests && m rust
Change-Id: I6be895ddbffc5ac6303f2edc9ab20f7c20cd1591
|
|
With the new transition mutators, the distinctions between rust_ffi_rlib
and rust_library_rlib are not necessary. This CL removes the remaining
distinctions to allow an unusual use case where a rust_library and a
rust_ffi_rlib would otherwise be created from the same source. This
would allow defining a single rust_library_rlib that works for both rust
modules and cc modules.
One key change is that rust_ffi_rlibs only produced an rlib-std variant
previously, and now produce dylib-std variants as well.This surfaced an
issue where a libstd linkage mismatch would cause rustc to throw a
consufing missing crate error. We instead add logic to catch this in
Soong and provide a more useful error message.
Bug: 383552450
Test: m rust
Test: m blueprint_tests
Change-Id: I611ca46934059735d06229952cfd8e0ab7050486
|
|
This allows Rust modules to define a version_script for shared library
variants.
This requires using a wrapper for the linker (clang++) to intercept
the flags which rustc emits.
This also adds the ability to export additional symbols in addition
to those exported by rustc by default, e.g. whole_static_library
symbols.
Bug: 314309643
Test: New Soong tests pass.
Test: m
Test: m <simple version script module>
Test: m <simple extra symbols module>
Change-Id: I93c9552e5e1181df4663d194c4df4b7053553dd4
|
|
As part of removing some of the complexity in Soong around using
stub vs. implementations for shared library dependencies a syntax
will be added to Soong to allow explicitly selecting stubs vs.
implementation. To avoid incorrect use, add a verification pass
on apexes that ensure that all transitive implementation libraries
used to link native libraries or binaries in the apex are
themselves in the apex.
Bug: 372543712
Test: TestApexVerifyNativeImplementationLibs
Flag: EXEMPT host only
Change-Id: I4aeaca00a359ce97e8f9efd2d8bffb8f9d2dc0df
|
|
Update all references to depset to use blueprint/depset, and to use
DepSet instead of *DepSet.
Bug: 375276086
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I59a7836d0975366ddc336225fb770ac7e6e0c8ea
|
|
This is a temporary measure until stubs are properly supported by rust_ffi targets.
Bug: 361441210
Bug: 362509506
Change-Id: Ieabd4e3abf442de660f39ec6c5776f5832b25e14
Test: manual
|
|
Replace rust.LibraryMutator and rust.LibstdMutator with
TransitionMutators.
Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: Ia24a582119d39889279d7b93bac9259685153619
|
|
Rust modules no longer have static variants after
I2925f67f6dc9329dae3dcccafb8560900ac8a6fc, remove the VariantIsStatic
field.
Bug: 254469782
Test: m
Test: m blueprint_tests
Change-Id: Ic63412a27c3a09dec43c4a9064a3e1f4181147db
|
|
Alias the rlib variant to "link: static". This allows declaring
rust_ffi_rlib modules in static_libs. This effectively removes any
distinction between rust_ffi_static and rust_ffi_rlib. Removing the
functionality for building Rust staticlib modules will be cleaned up in
a follow-on CL.
This should have the effect of changing the default linkage for all rust
modules in static_libs from linking individual staticlibs to building a
single staticlib that includes all rust_ffi rlib dependencies.
This removes the static_rlibs property, as we're now handling
the choice dynamically. This also makes rlibs only propagate through
cc_library_static modules if the rlib is included in
whole_static_lib. This both mirrors the expected behavior of
cc libraries and helps control which version of a crate ends up in the
final link (e.g. libdoh_ffi vs libdoh_ffi_for_test).
Bug: 254469782
Test: m
Test: m blueprint_tests
Change-Id: I2925f67f6dc9329dae3dcccafb8560900ac8a6fc
|
|
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
|
|
* changes:
rust: made-to-order rust staticlibs
rust: refactored transformSrctoCrate
|
|
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
|
|
This allows using select statements with it.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
|
|
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
|
|
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
|
|
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.
Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
|
|
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.
Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
|
|
This makes it possible to call crateRootPath in situations where a
ModuleContext is unavailable.
Test: m nothing
Bug: 309943184
Change-Id: Iee20b0606954a18ca516cdac40917d0016f94a05
|
|
Test: m nothing
Bug: 309943184
Change-Id: I45028945357c394301d93ca7995a4f9adf281931
|
|
Test: go test
Change-Id: Ibf0bb2687073f8650da4ca27c1f57e68a93025d4
|
|
Bug: b/290790800
Test: b build //external/rust/crates/... --config=android
Change-Id: Id06dc94f8bff519c09de7a0de0f1999cf310f599
|
|
This reverts commit e7c71c344d462cac998b37d551bd78baa892082d.
The intermediates created by the separated rust compile steps are very
large, on the order of 60GB. This is more than CI can support for now,
revert the split into compile and link phases. This comes at the expense
of incremental build time, especially when modifying C/C++ sources that
are dependencies of rust modules.
Bug: 293349612
Test: builds
Change-Id: I81169e7d0727330c8de5e7688dcdc87fe7b8d3b5
|
|
9c64274b275a00d7753bbe1a15945652521b2044
Change-Id: I1c4dad76842cebf18cd82e04e435910f09038d07
|
|
60375c4adf0753d0e2519ebf1b908d424dd2d466
Change-Id: I356e936139592893a47d4c6b9e747f24470b11f9
|
|
Revert submission 2629131-sandbox-rust-inputs
Reason for revert: Fail on android build.
Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs
Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
|
|
"revert-2746976-revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT-KMAGKVIXAT", "sandbox-rust-inputs" into main
* changes:
support sandboxed rust rules
conditionally escape rule builder command
Revert^2 "allow Ninja variables in RuleBuilder API"
Revert^2 "add crate_root property to rust modules"
Revert^2 "add rust_toolchain_rustc_prebuilt module type"
|
|
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.
Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
|
|
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.
Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
|
|
5162ff14fc91db500e008a18840c3dfd4edc695a
Change-Id: I9a76df938639676ee4aa7bdd2b2902e0e6df08d5
|
|
Revert submission 2605644-rulebuilder-ninja-vars
Reason for revert: b/299568218
Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars
Change-Id: I17645fcff117909c09a016157235805f0974340b
|
|
The crate_root property will be used to specify the entry point for a
rustc compilation. This will allow the srcs property to be used to
collect all src inputs to rustc rather than just the entry point.
Bug: 286077158
Test: m libnum_traits
Change-Id: I1a167182305dcc11cc927d562ceed622153111d3
|
|
Since this is a one-off just for building libprotobuf that will be removed when we handle cargo output more generically (b/297364081), I didn't write a unit test for this CL.
Test: b build //external/rust/crates/protobuf:libprotobuf
Bug: 295925256
Change-Id: I00cf44d54be27a09c184a96c13b250a2e54e2d10
|