Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.
Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063
Unbundled builds cause AlwaysUsePrebuiltSdks() to return true which
causes java_sdk_library_import modules to be preferred instead of their
corresponding java_sdk_library module. That causes the
platform-bootclasspath module to depend on prebuilt versions of modules
like framework-statsd which currently do not specify
permitted_packages and so cause a failure.
This is a temporary hack to prevent an unbundled build from checking
for permitted_packages. It can be removed once the prebuilts have been
updated to include the permitted_packages.
Bug: 193095050
Bug: 193889859
Test: m TARGET_BUILD_APPS=Calendar apps_only
- before the change it failed in Soong.
- after the change it started failing, later in Make, so the
Soong problem has been worked around.
- I reverted all the recent changes to permitted_packages and
ran this and it still failed so that failure is unrelated to
these changes.
Change-Id: I213d35437d76d61cf616d1f16dae213b311c6c8e
A Java module may depend on a stub library. In that case an additional
dependency on the implementation library is created, and it is used to
add the implementation library to class loader context. We should not
attempt to add the stubs library as well (previously the attempt to add
it happend after the implemention was added to CLC, to the attempt was
unsuccessful).
Raise an error if someone tries to add the same library with different
build/instal paths.
Also, rename local variable `implicitSdkLib` to `sdkLib` to better
reflect its meaning.
Bug: 193425964
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
$ adb wait-for-device && \
adb root && \
adb logcat | \
grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C1
# empty output, no errors
Change-Id: I01c1bdd23f9d118d891d0b806e7e3b4d78896a34
libtest does not need to be linked for every module type, so remove it
from the stdlibs list. Instead, link it only when building benchmarks or
tests.
Bug: 193782599
Test: cd external/rust/crates/; mma
Test: Rust tests still run correctly.
Change-Id: I536be8754da0987e09340744d9ebf668b8e734d0
soong config variable modules allow specifying a non-existent property,
which results in an unhelpful error message when the module type is then
used.
Bug: 171232169
Test: go test soong tests
Change-Id: I6174c0d35a28952157ee925f51d615e2ee735f8a
Changes:
- Cut off "prebuilt_" prefix from `dep`, not `libName`, because `dep` is
used to replace library name in `usesLibraryProperties`, and these
properties are specified without "prebuilt_" prefix.
- Do not remove "prebuilt_" prefix on the return value of
`ProvidesUsesLib()`: this boils down to `provides_uses_lib` property
which is specified without the prefix.
Bug: 193425964
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
$ adb wait-for-device && \
adb root && \
adb logcat | \
grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C1
# empty output, no errors
Change-Id: I6cb65040027023d12ca0bc132d60c2c245174c40
Previously, the java_import and java_sdk_library_import modules did not
make their permitted_packages available to the rule that generates the
updatable-bcp-packages.txt file. This change corrects that.
Bug: 193763688
Test: m nothing
- Added unit tests, which all failed and then fixed the tests.
Change-Id: If0706e4551a331b48d383123088e63924dded48b
Previously, permitted_packages were not copied to the sdk snapshot.
This change corrects that.
Bug: 193763688
Test: m nothing
- Added unit tests, which all failed and then fixed the tests.
Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
The actual behavior of the method is slightly different from its text
right now. Update the text to describe the actual behavior.
Bug: 193228441
Test: m nothing (change is noop)
Change-Id: I755829af6aa1b3f95ac71f33d75751b94e71b54b
This is needed when some source libraries get replaced with prebuilt
variants: CLC should contain one entry for a library (the prebuilt one
or the source one, whichever of them is preferred). Because the prebuilt
module name starts with "prebuilt_" prefix, previously Soong considered
such libraries as two different ones libraries and added both to CLC.
Bug: 193425964
Test: mark "prebuilt_android.net.ipsec.ike" as preferred and `m nothing`
(before this CL it would fail the build, now it builds fine).
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
$ adb wait-for-device && \
adb root && \
adb logcat | \
grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
# empty output, no errors
Change-Id: Icc42533d9915060d7fffda12aa93b9d18dc4f83d
There is no need to check as `TrimPrefix` does nothing if the prefix
doesn't match (see https://pkg.go.dev/strings#TrimPrefix).
Bug: 193425964
Test: m nothing
Change-Id: Ieb82e72a471800e29eb6bb54308041a9ab4173e5
Rename the ninja variables that have an extraneous Clang in the name,
since there are no longer any non-Clang variables.
Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I081d5e1d423a66d55faece6cb1d265cd5e504d5f
Squash the contents of some clang-specific ninja variables into
the main ninja variables.
Bug: 68947919
Test: no change to command lines used to build mmma bionic
Change-Id: I29bf144b03307a7893376e68d82f12f5c40e8e95
Remove cflags that are not handled by clang from the global defaults,
and remove calls to ClangFilterUnknownCflags.
Squash lists of clang-specific default flags into the main default
flags lists.
Rename Toolchain.Clang*flags to Toolchain.*flags.
Rename Go variables with Clang in the name that have no non-Clang
equivalent.
Remove unused ninja variables.
Bug: 68947919
Test: no change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_crosshatch-userdebug
Change-Id: Id287945315d53e5eaef197adbbb4f1302f2e3680
Bug: 188179858
Test: compare dexpreopt_config.zip files from
1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
2. m dexpreopt_config_zip
(note that m clean should run between steps)
Change-Id: I36a6e8b10b9922cc5522accaf90af1aa05049a86
Previously, a module reference in a path property would be parsed into
two parts, the module name and the optional output tag, which defaults
to an empty string if not specified. The output tag would be stored in
a sourceOrOutputDependencyTag which would then be used, along with the
module name to add a dependency on the module.
Later, when the paths were processed the same module reference would be
parsed into the same two parts again and the module name used to find a
matching Module by comparing it against the name returned by either
Module.Name(), ctx.OtherModuleName() or ModuleBase.BaseModuleName().
Once the module had been found then if it supported OutputFilesProducer
then the tag would be passed to its OutputFiles(tag) method. Otherwise,
it would fall back to treating it as SourceFilesProducer.
The problem with that is the module name retrieved from the module in
some way (either directly or through a context name) could be different
to that originally supplied when adding the dependency. e.g.
1. If the original dependency was added onto a source module but there
existed a suitable and preferred prebuilt module then the dependency
onto the source module would have been replaced by the prebuilt
module which has a different name.
2. If the path property included a fully qualified name that included
a qualifying path then it would not match the name retrieved from
the module which would not include the qualifying path.
This change circumvents that whole issue by adding the module name that
was originally used to add the dependency into the DependencyTag. Now
the DependencyTag uniquely identifies the original module/outputTag
pair parsed from the module reference. The pathDepsMutator guarantees
that they are unique as it dedups them before adding the dependencies.
It is possible that calling ExtractSource(s)Deps() would add some
duplicate but if they did they would be identical, i.e. the same
sourceOrOutputDependencyTag would be used to add a dependency onto the
exact same module. In that case it would not matter which of the
dependencies was found as it would still return the same module.
Bug: 193228441
Test: m nothing
Change-Id: I661514a2984818e5c26577411cede53eb57bcd02
Allows the builder of an sdk snapshot to specify a Soong config
variable that can be used to control whether the snapshot's prebuilts
are used or not.
Bug: 193523070
Test: m nothing
Change-Id: Ib09500ba61befc1202dff61dc06847c730ba9253
Currently within metrics we cannot distinguish between Bazel-involved
configurations:
Bazel as Ninja vs Ninja as Ninja builds
Bazel mixed builds vs non-mixed builds
Add these to the build configuration in order to distinguish between and
track them independently.
Test: go soong tests
Test: USE_BAZEL_ANALYSIS=1 m nothing and verify out/soong_metrics
Bug: 193672397
Change-Id: I94ce56c1a98a76d929598d9fe3070df16ffa1376
A simple way to provide fine grained control over the use of a prebuilt
or source module via a Soong config variable.
Bug: 193523070
Test: m nothing
Change-Id: I47ae8ac04fa29156d2e87efd9e60ab995f50ea6d
Use a note added to linker.s to place the linker in the linker script,
which will work musl, which doesn't have .note.android.ident, while
continuing to work for linux bionic.
Test: m checkbuild
Change-Id: I9cd4ad7c8e8fcb4d725746106d5beaa699a77807
This fixes a bug which was a misunderstanding of soong properties:
Soong's cflags pertain only to C and C++ language, whereas bazel's copts
pertain to all three languages. This change ensures that asflags are
added as specifically asflags, and the 'copts' for the static library
macro pertains only to C and C++ languages.
This requires a somewhat hacky workaround for asflags, however: Since
assembly sources also need includepath-related flags, this duplicates
these flags between copts and asflags. To reduce verbosity of
bp2build-generated targets, this also ensures that asflags are omitted
in cases where there are no assembly sources.
Test: Mixed build droid CI
Change-Id: Ic0babed1f90d6dc82e5788638681ce5b995043f8