ASan globals instrumentation apparently broke the build in the pass.
This is now a customer feature to get this up and running, let's see if
it works.
Bug: 137312732
Test: Build the platform, deploy and run an asan-ified test (maybe
resolv_integration_test?).
Change-Id: Ic4ee0db617c290d8a3fec52db4b90bc4772696b8
When the device does not support non-flattened APEX (i.e.
TARGET_FLATTEN_APEX is set to true), then ignore the prebuilt_apex
modules even when `prefer: true`.
Bug: 136251130
Bug: 136662772
Test: build marlin, and check if /system/apex has flattened APEXes
Merged-In: I9f3dfefc3bd357d6750fbb1e418937d095720b04
(cherry picked from commit 0a573d798f)
Change-Id: I9f3dfefc3bd357d6750fbb1e418937d095720b04
clang-format tries to automatically detect the Cpp standard used,
particularly when determining to put spaces in template definitions:
Cpp03: std::vector<std::pair<bool, bool> >
vs
Cpp11: std::vector<std::pair<bool, bool>>
It doesn't always get this correct as seen in
https://android-review.googlesource.com/c/platform/system/core/+/973463/8
but since we know that all code within Android is C++17, we can safely
assume it should be formatted with the newer standard.
Test: clang-format doesn't break the above change.
Change-Id: I7d1d709690b7bca6da3863cc9a58e53eaec751b0
Bug: 137015854
Test: m
Test: build cf_x86_phone and ensure there is no dangling symlink
/system/lib/arm/libm.so
Change-Id: I0f5efdb9e1f5e4e213ca4ebaa28ace0a130b36a6
Instead of circumventing the limitation of Prebuilt implementation by
picking a source path itself, it now uses the same mechanism as
archMutator and replaces the source path in advance so that Prebuilt
always sees the corrent source path.
Because this requires the Apk field to be a string pointer, the single
source prebuilt implementation is being updated to be reflection-based.
Test: Soong unit tests, m soong_docs, TreeHugger
Change-Id: I2304f15e32d632f74f95f0d9e9bf1f75ff3e2225
For APEXes to share C++ native libraries, we need a new kind of depedency
between APEXes: "providing" APEXes and "using" APEXes. To reflect this
dependency two new properties are added.
provide_cpp_shared_libs: bool
this indicates that the current APEX module provides the native C++ shared
libs to other APEXes.
uses: []string
this indicates that the current APEX module uses the native C++ shared
libraries from APEXes listed.
With these two, "using" APEXes can omit shared libraries in its APEX
bundle and use them from the "providing" APEXes.
Note that without corresponding changes in ld.config.txt, this won't
work.(The linker namespaces should be configured so that user APEX can
access provided libs.)
Bug: 136975105
Test: m nothing (this will trigger soong's test)
Change-Id: Iec6f9f67bcbde01145acc383f862ba21c8197536
strings.Builder avoids copying the final byte array to a string by
using unsafe to point the string to the backing array of the byte
slice.
Test: rule_builder_test.go
Change-Id: I3d9a70fb62f8542650cd9ebc65397297bba12585
Allow running Soong in a headless delve debugger by passing
SOONG_DELVE=<listen addr> in the environment.
Bug: 80165685
Test: SOONG_DELVE=:1234 m nothing
Change-Id: Icfc893c8a8354a9bbc99112d9c83259cb41906d1
When running ninja stream stdout to the status writer. This improves
the ninja -d explain behavior, and will also allow Soong to be put
into the ninja console pool letting it print timely output to the
console.
Bug: 80165685
Test: NINJA_ARGS="-d explain" m
Change-Id: I40f03fc01d837ad91d400eae378007a7ce807705
Add a String() method to android.Module for use in debugging. Store
the name and variations of the module as they are mutated.
Test: TestModuleString
Bug: 136473661
Change-Id: I74e393703dcfc96ed4e21ac4a4419a7858b59216
The wrapper to getenv() appends the effective userid (euid) of the
current process to GCOV_PREFIX. This avoids conflicts and permissions
issues when multiple processes try to create/access the same directories
and files under /data/misc/trace.
Test: Verify that coverage files are written to
/data/misc/trace/<euid>/proc/... instead of /data/misc/trace/proc/...
Change-Id: If58081a12b2b9bc40cfcbf64c99beafe198d07af
Bug: http://b/134177005
Bug: http://b/116873221
Previously, the libprofile-extras dependency was added as a
LateStaticLib and the constructor in this library was included during
linking with the '-uinit_profile_extras' linker flag. This was done
because at the deps() stage, the exact binaries that need coverage are
not known (in fact the coverage-enabled variants are not created yet).
This meant that for a link command, if one of the shared libraries
already exported the constructor, the output of the link command did not
load/link libprofile-extras.
For other reasons, we now want to add more symbols to this library that
need to be linked into all libraries and executables. To accomplish
that, refactor the dependency handling so libprofile-extras can be added
as a 'WholeStaticLib'.
This is done by creating a new dependency type (with a coverageDepTag
dependency tag) to add libprofile-extras as a dependency for all modules
that can potentially link with coverage. During the flags() call, this
dependency is moved as a WholeStaticLib dependency iff coverage is
enabled in this link step.
There are a few NFC changes as well:
- deps() takes a DepsContext parameter.
- flags() has an extra PathDeps parameter and return value.
- add useSdk() helper to cc.Module.
Test: Build with coverage and check that we can generate coverage using
SIGUSR1 and the debug.coverage.flush sysprop.
Change-Id: I7e7d8201956a150febbda5bb1794f8ece016db8b
android_test.go already sets up a global buildDir, no need to create
one in each test.
Test: All soong tests
Change-Id: Ib85cbf78c604ad3cef64aa00b6bd812a81496e9e
The build directory passed in to soong_ui can contain a
symbolic link. soong_ui was not evaluating the build
directory to retrieve the true path, hence failing to
execute the internal soong.
Fixes: b/135995632
Test: Unit test case and executed the scenario in the bug
description.
Change-Id: I5779c6aa3f3183810437dbe2b2d4e40acbafb205
Tests use fakeSmartTerminal, this case must not be affected
by the TERM setting.
Test: TERM=dumb make
Change-Id: Ib926a1c6ba2d8c4117d412fe351d872ccfc1c799
* Adds a Rule interface to hide the rule struct and expose the mutator
functions.
* Makes the neverallow() function public as NeverAllow().
* Adds AddNeverAllowRules func to add more rules.
* Moves the population of the builtin rules to init() function.
Bug: 136159343
Test: m droid
- changed a built in rule to cause build failure to ensure the
rules were still being applied, then reverted the change and
ran 'm droid' again.
Change-Id: Ie3a4456d1f6bc12c5b4931bf698333275347fdf0
Merged-In: Ie3a4456d1f6bc12c5b4931bf698333275347fdf0
From aosp/588578, if vendor app doesn't fill sdk_version, build scirpt overwrites system_current to sdk_version.
But there is no similar enforcement in soong.
So, as make does, sdkVersion() returns "system_current" if it is device-specific or soc-specific module. and sdk_version is not filled.
Test: pass soong test
Bug: 132780927
Change-Id: I69bb3d7bfcf7c27c2db4d0efbe046f9c7879b4bc
When figuring out terminal type, check whether TERM=dumb is set.
Test: m nothing
Test: TERM=dumb m nothing
Test: m nothing | tee log
Change-Id: Ie13ca99eb84b798644d618ad1c8c1fb8ec8bb049