Commit graph

136 commits

Author SHA1 Message Date
Martin Stjernholm
68b0c7a6e5 Include runtime-module-host-exports in the SDK build.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 152255951
Change-Id: I87a154a31409c83ccdd4637210f6163dfa2d7738
2020-06-11 15:48:13 +01:00
Paul Duffin
63d8febd35 Ensure package check is run for java_library in APEX
Package checks were not being run for java libraries that were in an
APEX and not on the platform. This change fixes that and updates the
script to report all failing classes to make it easier to update the
list of packages.

Test: m java
Bug: 157633658
Change-Id: I28044e08d3a40e9f3464bb2158ef6a28d57264d1
2020-05-28 15:06:35 +01:00
Martin Stjernholm
6ee5f754fe Include runtime-module-sdk in the SDK build.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 152255951
Change-Id: I39f9024205a198ef8ce19e2c70e3b9dced54add1
2020-05-14 17:54:20 +01:00
Martin Stjernholm
691503ea0b Reduce the number of Soong invocations, and various other minor script fixes.
-  We can pass all targets at once to build-aml-prebuilts.sh.
-  Less noise from build-mainline-modules.sh.
-  Default to the same out directory in both build scripts.
-  Addressed post-submit comments on https://r.android.com/1170907.
-  Various minor cleanups.

Test: build/soong/scripts/build-mainline-modules.sh
Change-Id: Id21ef80c2334462836e217032fc5bf63b7cd04e1
2020-05-06 22:51:15 +01:00
Nicolas Geoffray
7cad0f860b Use FORCE_BUILD_LLVM_COMPONENTS.
And remove the allow missing dependencies flag.

Test: build-mainline-modules.sh
Change-Id: I6ba8892ef66eeb42c7bd3abc989a80ad4b6a1cf9
2020-04-28 15:54:59 +01:00
Nicolas Geoffray
71233e4732 Add linux_bionic cross compilation for mainline SDKs.
ART requires linux bionic prebuilts.

Bug: 142935992
Test: build-mainline-modules.sh
Change-Id: If0f97e58d2afccbc3f5d0b2e7dabac51330cc5c7
2020-04-25 16:25:21 +01:00
Nicolas Geoffray
0a2e297206 Add conscrypt-module-host-exports to the list.
Test: build-mainline-modules.sh
Change-Id: I9ca14cc37a69b1172f52412297977dd03c6ca1a0
2020-04-23 09:35:45 +01:00
Nicolas Geoffray
11a8d879b6 Merge "Support secondary arch for host module exports." 2020-04-02 08:12:45 +00:00
Nicolas Geoffray
32e89ddb60 Merge "Update owners of build-aml-prebuilts.sh." 2020-03-31 09:08:35 +00:00
Nicolas Geoffray
90934f7177 Update owners of build-aml-prebuilts.sh.
Test: N/A
Change-Id: Ie5be75f90be00db5adeaa40662e26a92c66d1b05
2020-03-30 14:23:13 +01:00
Nicolas Geoffray
abdc8c5501 Support secondary arch for host module exports.
Bug: 142935992
Test: build-aml-prebuilts.sh generate x86 prebuilts

Change-Id: Iec4d8aa59a3ad55583c788f8ec40dd0637e7af33
2020-03-27 14:57:37 +00:00
Bob Badour
0d3d8e40c1 More fix for -e
Not sure whether sort, tr or xargs returning non-zero status, but
one of them sometimes does.

Test: manually

Change-Id: I8f2b862de9d6e22dd90068252e393533ec992dfd
2020-03-24 13:42:43 -07:00
Bob Badour
455b3cb38f Fix bug caused by set -e
Empty results cause grep/egrep to return a non-zero status.

Bug: 145347092
Bug: 141258651
Bug: 69058154
Bug: 143285996

Test: manual run for notice files

Change-Id: I25d54ae307b97a07a98e99c54f283437718fe657
2020-03-18 17:51:48 -07:00
Bob Badour
02ad5e4de6 Scripts to evaluate dependency transitive closures.
Bug: 145347092
Bug: 141258651
Bug: 69058154
Bug: 143285996

Test: run manually

Change-Id: I29d674f97ccff19ff61f675022dce052f14e0dd8
2020-03-10 21:53:39 +00:00
Nicolas Geoffray
90bc3cd304 Add a build script to compile modules and SDKs in AOSP.
Test: build-mainline-modules.sh
Bug: 142935992
Change-Id: I80a9bf8ce03d77705ba677f95b03aeb2ac2451d5
2020-03-06 14:35:48 +00:00
Treehugger Robot
5d95387398 Merge "Make a soong-only copy of generate-notice-files.py" 2020-03-04 21:56:04 +00:00
Treehugger Robot
49b445cace Merge "Update build_broken_logs script" 2020-03-04 00:21:51 +00:00
Bob Badour
3911e6a1c4 Make a soong-only copy of generate-notice-files.py
This is an unchanged copy of build/make/tools/generate-notice-files.py

After this change, the make implementation of generate-notice-files.py
will change to take a required parameter for $(PRODUCT_OUT) and will
only include notices for files built under $(PRODUCT_OUT).

Because soong has the ability to walk dependency trees, the soong
version will likely change in the future to use that ability causing
both versions to move in different directions.

After those changes are complete, we can look into factoring out any
remaining shared logic.

Test: run manually and system image notices checked for changes

Change-Id: Id139a66503457615548b46e7996349ca0817e831
2020-03-03 13:50:53 -08:00
Martin Stjernholm
37fa32ce94 Output json without trailing whitespaces but with trailing newlines.
Makes them more editor friendly, primarily when copied into
system/linkerconfig/testdata/root.

Test: m
Test: No diff between apex_manifest_full.json in out/
  and in linkerconfig/testdata/root/
Bug: 140599044
Change-Id: I6dacdd4baa59e6d70586c4a6343b9b8fd1b574f6
2020-02-24 22:20:49 +00:00
Baligh Uddin
3be82c00fe Create manifest_utils library target.
This utility can also be used for parsing and
managing the Android Manifest for apex under
system/apex/apexer.

Test:
python manifest_fixer_test.py
python manifest_check_test.py

BUG: 148198056
Change-Id: Iffe465b5f36b2a3fbf81414d6f19e241c5f5648f
2020-02-20 15:58:00 +00:00
Baligh Uddin
5b16dfb39a Allow for setting a logging_parent for an Android App.
Unit test: go test ./... -test.v -run TestOverrideAndroidApp
Unit test: python manifest_fixer_test.py

BUG: 148198056
Change-Id: Ib5ff235d2a93e88b86aec1c0b16327ea938a094d
2020-02-18 09:37:56 -08:00
Sasha Smundak
9dd454b3ac Script to set up android build directory
Test: manual
Change-Id: I93aa3aa9745330ec21385ce12cc586aeaa803e12
2020-01-30 19:18:54 -08:00
Dan Willemsen
9dfaa06e45 Update build_broken_logs script
This can now discover which make module types have been deprecated and
suggest what needs to happen with the BUILD_BROKEN_USES_* flags.

Bug: 130720555
Test: go run .../build_broken_logs.go *  (see header comment)
Change-Id: Iffaa32c0b0079e99b926162257a7c15c530c15a1
2020-01-29 10:50:41 -08:00
Jaewoong Jung
3998234d8c Overwrite test-file-name in test config.
If the install apk name is different than the module name, use
test_config_fixer to update the test-file-name value in the config.

Test: app_test.go
Fixes: 147375216
Change-Id: I2141eeebbb3552995400b45634712306673fd812
2020-01-17 06:08:12 -08:00
Paul Duffin
749f98fb64 java_sdk_library: Allow api dir to be specified
For modules that provide API surfaces in addition to the standard
current, test and system it is useful to be able to specify the
directory containing the api's .txt files to make it easy to create
multiple API surfaces from within the same Android.bp file. e.g. This
is useful for conscrypt, icu and libcore to manage their intra core
and core platform APIs.

Bug: 145998881
Test: m checkbuild
Change-Id: I753631d9b6993fbf30019fef5c052a9429e519de
2020-01-02 15:38:42 +00:00
Paul Duffin
37e0b77e3b java_sdk_library: Avoid generating system and test .txt files
If the library does not provide system and test APIs then do not
generate/require corresponding .txt files.

Bug: 145998881
Test: m checkbuild
Change-Id: I21cfdb0b63fd575e8c8c63ea2b436e0c4aa8f3fc
2020-01-02 15:38:18 +00:00
Martin Stjernholm
c1ecc43aec Add script for building all target arch's needed in AML (Android Mainline)
prebuilts.

This runs Soong in skip-make mode, using normal in-make mode only to query
platform versions.

The same ${OUT_DIR} cannot be used for both skip-make and in-make builds,
because Soong generates a smaller build.ninja file in in-make builds where
many build targets are expected to be provided by the mk files. Thus this
script avoids using ${OUT_DIR} if it's an in-make build, defaulting instead
to out-aml/.

The script is based on build-ndk-prebuilts.sh, but uses a separate Soong
variable Aml_abis to enable the appropriate target architectures for
Mainline modules. Aml_abis is very similar to Ndk_abis, except "armeabi-v7a"
is used instead of "armeabi", which is necessary to match prebuilt
dependencies, e.g. for LLVM.

Test: build/soong/scripts/build-aml-prebuilts.sh libart libdexfile_external
  (verify that libraries for arm, arm64, x86, x86_64 are built)
Test: build/soong/scripts/build-aml-prebuilts.sh \
  out-aml/soong/.intermediates/external/conscrypt/conscrypt-module-sdk/android_common/conscrypt-module-sdk-current.zip
  (verify that the zip file contains libconscrypt_jni.so's for all four arches)
Test: build/soong/scripts/build-aml-prebuilts.sh com.android.art.{release,debug,testing,host}
  (verify that the build completes)
Test: Two identical build/soong/scripts/build-aml-prebuilts.sh runs after each other
  (verify that the 2nd run completes both Soong and ninja steps quickly without any building)
Change-Id: I35712f9f8f0b1cbb77107314c5927c6720e6c3bf
2019-12-20 11:53:21 +00:00
Jaewoong Jung
e5cd4e10a0 Optionally overwrite package value in test config.
If package_name is set for an android_test module, package names in its
AndroidTest.xml config need to be updated too.

Test: test_config_fixer_test.py
Fixes: 145011263
Change-Id: I52f17ef1d1902364b9bcfec4f6e246bd655dbf09
2019-12-05 11:17:09 -08:00
Roland Levillain
8ac05575aa Fix some typos in Soong.
Test: m
Change-Id: I032b6ce2a61491b88416db9943b42e6af4783459
2019-11-13 10:46:49 +00:00
Yi Kong
c49c393f73 Repack libgcc.a to only include required objects
Previous solution by using objcopy uses a quirky behaviour of the GNU
objcopy and there is no equivalent option in llvm-objcopy.

Instead of removing symbols, extract and repack libgcc to only include
required objects.

Bug: 142585047
Test: presubmit
Change-Id: I58af74c18838f797e481da38c3265f0624fddf99
2019-10-24 16:34:54 -07:00
Yi Kong
049ae6ae3e Revert "Create libgcc_stripped with llvm-objcopy"
We rely on a weird, GNU specific behaviour of objcopy:

$ aarch64-linux-android-objcopy -w libgcc.a stripped.a --strip-unneeded-symbol=*
$ llvm-nm --defined-only stripped.a | grep multi
0000000000000000 T __multi3

$ aarch64-linux-android-objcopy -w libgcc.a stripped.a --strip-unneeded-symbol=* --keep-symbol=FOO
$ llvm-nm --defined-only stripped.a | grep multi

llvm-objcopy has a different, more consistent behaviour that does not
mark exported symbols as unneeded when "--keep-symbol" flag exists.
However this behaviour will leave most symbols not deleted in the
libgcc_stripped library.

Revert the change while I'm implementing an alternative solution.

Test: presubmit
Bug: 142585047
Change-Id: I175e811f8a1f6afc6558267fc54e159ad5e12acf
2019-10-15 16:43:12 -07:00
Yi Kong
eb63f76721 Move strip.sh to use llvm-nm instead of GNU nm
Also fix an issue with deps file introduced in ab5e5142. Now correctly
depends on llvm-readelf insteaf of GNU readelf.

Test: presubmit
Change-Id: Id287e2844626c07917348a62820f8b5edbb22c3d
2019-09-14 01:39:53 -07:00
Yi Kong
ab5e514208 Remove use_gnu_strip option
This option is no longer used anywhere.

Test: presubmit
Change-Id: I1a5f2d14e24ecf7c15a437054b8a95ddaf57da2f
2019-09-13 12:18:47 -07:00
Treehugger Robot
f56e89f160 Merge "strip.sh: Fix argument to llvm-strip" 2019-09-09 22:06:56 +00:00
Greg Kaiser
e106d8fd8c strip.sh: Fix argument to llvm-strip
We had a typo in the original checkin.  We need two hypens before
"remove-section" for llvm-strip, just like we have for strip.

Bug: 140721128
Test: Clean build of Go device
Change-Id: Ifb83dc4e6ad8f8070d9ced678f9147d6a040aee7
2019-09-09 09:55:07 -07:00
Yi Kong
a0119f8754 Create libgcc_stripped with llvm-objcopy
llvm-objcopy now implements '--regex' option, which allows it to replace
GNU objcopy for creating libgcc_stripped archieve.

Test: build
Bug: 131631155
Change-Id: Ie1733ac8e9b3765f7652a562406dcedb4735cc1a
2019-09-03 13:44:54 -07:00
Inseob Kim
4288274f14 Implement sysprop_library API stability check
sysprop_library now checks the API stability itself, cutting dependency
on java_sdk_library. Under the directory {module_dir}/api,
{module_name}-current.txt and {module_name}-latest.txt hold API
signatures.

When sysprop_library is built, or a user run "m {module_name}-check-api"
command, API check is performed. First, current.txt must have exactly
same signature with built sysprop_library module. Second, current.txt
must be compatible with latest.txt.

Build system emits a handy error message to generate/update those API
files, in case of missing or mismatching. Also, a script file for
freezing API files is introduced.

Bug: 131637873
Test: 1) m && boot blueline
Test: 2) m {sysprop_library} performs API check
Test: 3) manual test for check-api, freezing api
Change-Id: I9d25f5dc64299e666527ca8e23d7233966901c4e
Merged-In: I9d25f5dc64299e666527ca8e23d7233966901c4e
Merged-In: Ib7ad4f17e82c90da5ef3f80e2ab88c0b53112c60
(cherry picked from commit 093f0eb133)
2019-08-23 06:28:34 +00:00
Jooyung Han
04329f131a Add jsonmodify tool
This tool is used to modify apex_manifest.json when building apex
module.

Here's the usage:

usage: jsonmodify [-h] [-o output] [-v path value] [-s path value]
                     [-r path] [-a path [value ...]]
                     [input]

positional arguments:
  input                 JSON file

optional arguments:
  -h, --help            show this help message and exit
  -o output, --out output
                        write result to a file. If omitted, print to stdout
  -v path value, --value path value
                        set value of the key specified by path. If path
                        doesn't exist, creates new one.
  -s path value, --replace path value
                        replace value of the key specified by path. If path
                        doesn't exist, no op.
  -r path, --remove path
                        remove the key specified by path. If path doesn't
                        exist, no op.
  -a path [value ...], --append_list path [value ...]
                        append values to the list specified by path. If path
                        doesn't exist, creates new list for it.

Bug: 138695532
Test: m jsonmodify
Test: echo {} | jsonmodify -v name hello -a list.nested a b c
{
  "name": "hello",
  "list": {
    "nested": [
      "a",
      "b",
      "c"
    ]
  }
}

Change-Id: I2cd043c614b3ad2306a0c27ccee302633c6d2525
2019-08-02 00:08:05 +09:00
Vic Yang
6cd1be8993 Add sort_bss_symbols_by_size property for shared libs
If sort_bss_symbols_by_size is true, a shared library is built twice.
The first build generates an unsorted output file, which is used to
generate the symbol ordering file.  The output of the second build is
a shared library with its bss symbols sorted by their size.

With this, the only user of symbol_ordering_file, libc, is migrated to
use the new property, so we remove symbol_ordering_file support as well.

Bug: 135754984
Test: Build and check the resulting libc.so has its bss symbols sorted.
Change-Id: I5c892b44d82eb99cbc070cfa2c680be3087f3364
2019-07-29 13:25:55 -07:00
Yi Kong
93e6783410 Use double dashes before llvm-strip arguments
Newer llvm-strip no longer accepts single dash for multi-character
arguments.

Test: TreeHugger
Bug: 131328001
Change-Id: I4ca862d480860c00e7f8f644f79e300cb523dad0
2019-07-19 16:41:51 +00:00
Colin Cross
e5cae33f5d Allow jar wrapper to take quoted arguments
Make the jar wrapper script correctly handle quoted arguments with
spaces in them.  Also allow JVM arguments in the form -J-XX, not just
-JXX.

Test: m checkbuild
Change-Id: Iec5105bc390f2a12c6a4cda7f76d37585c39f520
2019-07-16 11:12:04 -07:00
Tom Cherry
0dd3ab5387 system-clang-format: Add Standard: Cpp11
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
2019-07-10 15:04:04 -07:00
Jaewoong Jung
96eac767df Merge "Touch up manifest if there's no source code." 2019-06-06 13:52:37 +00:00
Tom Cherry
c077eefc1e system-clang-format: Add IncludeBlocks: Preserve
As of [1], the Google format, which we default to, uses IncludeBlocks:
Regroup, which sorts all includes with <> and without .h into the top
group reserved for libc headers, e.g.:

+#include <android-base/properties.h>
+#include <android-base/strings.h>
 #include <ctype.h>
 #include <stdlib.h>
 #include <sys/system_properties.h>

 #include <iostream>

-#include <android-base/properties.h>
-#include <android-base/strings.h>

This is accurate to the Google C++ style guide, which states that
other library headers should be included with "", however we have a
strong tendency to use <> for these headers for Android, so we must
revert this change.

Note, clang-format allows regexes for creating the blocks as well,
however, short of including all possible libc headers, I don't think
there's a way to differentiate between <sys/wait.h> and
<other_lib/header.h>.

[1]:
62e3198c4f (diff-b689ebff2e51e675b346a88289e74542)

Test: clang-format doesn't do the above.
Change-Id: Ifef605ffd6b4c8a36512377644e64ddd26b68a21
2019-06-05 15:30:14 -07:00
Jaewoong Jung
c27ab6678b Touch up manifest if there's no source code.
The new package manager behavior requires packages without source code
to have an application element with hasCode attribute set to false in
their manifest. With this change, Soong can now automatically insert one
for codeless apps.

Test: app_test.go, manifest_fixer_test.py
Fixes: 124375490
Change-Id: Ied89a8d07c63805ab910859a4f7c45fc1c60bb73
2019-06-03 10:51:42 -07:00
Treehugger Robot
20272e1480 Merge "Remove BUILD_BROKEN_ANDROIDMK_EXPORTS" 2019-05-29 01:17:01 +00:00
Colin Cross
ff3f43857f Merge changes If15abf79,Iaae177ef
* changes:
  Add manifest_check tool
  Move manifest_fixer to a python_binary_host module
2019-05-28 16:26:05 +00:00
Dan Willemsen
edff034366 Remove BUILD_BROKEN_ANDROIDMK_EXPORTS
Bug: 73959648
Test: treehugger
Change-Id: I932cc3acc6345f8b1ad8e395235489ae8275e2db
2019-05-25 17:13:55 -07:00
Dan Willemsen
7101d44442 Remove BUILD_BROKEN_ENG_DEBUG_TAGS
All users have been removed.

Test: treehugger
Change-Id: I35e55f3ce79c8e68585be120b5dec810563c7a83
Merged-In: I35e55f3ce79c8e68585be120b5dec810563c7a83
2019-05-25 22:48:12 +00:00
Colin Cross
7211910fd0 Add manifest_check tool
Add a tool that can check that the <uses-library> tags in an
AndroidManifest.xml file match a list provided by the build.

Bug: 132357300
Test: manifest_check_test
Change-Id: If15abf792282bef677469595e80f19923b87ab62
2019-05-24 13:43:27 -07:00