Commit graph

14298 commits

Author SHA1 Message Date
Dan Willemsen
773386251d Mark envsetup.sh vars as deprecated in makefiles
For the envsetup.sh variables that should not be used in makefiles
(since they're not explicitly set up, and won't be available on the
build servers), mark them as deprecated.

Rework our documentation to have a landing page, and create a "Changes"
section where we can record changes like these. At some point I may go
and backfill some recent work.

Test: build/soong/build_test.bash
Change-Id: I54b9294ddf270245afdb58d17150db8098584e8a
2017-11-28 14:19:50 -08:00
Treehugger Robot
dcbc2e9a26 Merge "Ensure partition_tag is always set correctly" 2017-11-21 04:09:21 +00:00
Bowgo Tsai
aac41d585c Merge "Revert "Reorder assert-max-image-size and AVB signing"" 2017-11-21 03:02:19 +00:00
Bowgo Tsai
47e0b62d6e Revert "Reorder assert-max-image-size and AVB signing"
This reverts commit b855c0c304.

Change-Id: Ia82071bf42fcc6d15dabdf15f4eb5d1749c8cdb8
2017-11-21 02:39:51 +00:00
Treehugger Robot
eea732dbcf Merge "Reorder assert-max-image-size and AVB signing" 2017-11-21 01:23:28 +00:00
Dan Willemsen
ba9badf8ec Switch gcnodir name from basename to just removing .so
$(basename) was catching all of the hidl services that have versions
like "1.0" in their name, marking the .0-service portion as a suffix to
be removed.

Instead just remove ".so" and assume that everything else isn't actually
a suffix.

Bug: 69271974
Test: NATIVE_COVERAGE=true COVERAGE_PATHS=hardware/interfaces m; compare
      ninja files
Change-Id: I76e27d9ab1f9d4862cc2607c5f2ed9c121879421
2017-11-20 13:03:25 -08:00
Treehugger Robot
cbf6fd55bf Merge "Make more Treble make variables read only." 2017-11-20 19:09:21 +00:00
Jiyong Park
003ea369dd Ensure partition_tag is always set correctly
partition_tag is now set to either VENDOR_, OEM_, or ODM_
even when LOCAL_[VENDOR|OEM|ODM]_MODULE isn't set but LOCAL_MODULE_PATH
is explicitly set to under $(TARGET_OUT_[VENDOR|OEM|ODM]).

Test: build walleye

Change-Id: I0f902061889fe0af1c39f6222e54faa80dd15794
2017-11-20 11:01:50 +09:00
Dan Willemsen
d6f229842a Merge "Switch aidl and zipalign prebuilts to build-tools" 2017-11-18 04:50:33 +00:00
Jae Shin
e6b7c84ef7 Generate VNDK snapshot zip as a build artifact
Define a new phony target 'vndk' such that 'make vndk dist'
outputs VNDK snapshot zip file to DIST_DIR.

Bug: 66059995
Test: m -j vndk dist TARGET_PRODUCT=aosp_{arch}_{a, ab}
BOARD_VNDK_VERSION=current
Change-Id: I6fd763a91205b21fba414d1f3068408a6826fad8
2017-11-18 03:11:55 +00:00
Dan Willemsen
6353304dc9 Switch aidl and zipalign prebuilts to build-tools
So that they can be updated more regularly than prebuilts/sdk/tools.

Bug: 69431993
Test: tapas ExactCalculator; m
Change-Id: Id07ab43f9d9e0c794cc15f21b75ae88c3547d8bd
2017-11-17 18:40:45 -08:00
Dan Willemsen
da5fbe3c38 Merge "Add LOCAL_AAPT2_ONLY" 2017-11-18 02:17:48 +00:00
Dan Willemsen
bb6393c5a4 Add LOCAL_AAPT2_ONLY
This allows modules to specify that they may only be used from modules
using aapt2. Using aapt2 removes absolute path references to modules, so
this can be useful if a module is preparing to move its sources, or
replace itself with a prebuilt aar.

Test: m
Test: Label frameworks/support/design; m
Test: Label frameworks/support/v4; m
Test: build/soong/build_test.bash
Change-Id: Icfb3d4b19a6a0e3a3bb00091d2a97a4d88c0c761
2017-11-17 15:54:15 -08:00
Colin Cross
24e034a0bd Remove FORCE from gpl_source.tgz
Package gpl_source.tgz directly into the dist directory (which is
always removed between build server builds) so that FORCE is not
needed.  This prevents the build system from seeing a dirty rule
at the end of a make checkbuild dist.

Bug: 68062417
Test: m checkbuild dist
Change-Id: I4a9d9deb1611cc9ba266e8c1ac086a7ef48061c4
2017-11-17 14:05:19 -08:00
Colin Cross
f1f66974c6 Merge changes from topics "soong_logtags", "droiddoc_srcjars"
* changes:
  Allow converting logtags to java without merged logtags file
  Add support for srcjars to droiddoc
2017-11-17 21:32:27 +00:00
Steven Moreland
0e6301c996 Make more Treble make variables read only.
This makes the following readonly if they are defined:
- PRODUCT_FULL_TREBLE_OVERRIDE
- Linker/sepolicy/vintf overrides for PRODUCT_FULL_TREBLE

Test: multiproduct_kati
Change-Id: Ib33e2e23b74a049e87667358bed331f86e517837
2017-11-17 12:46:54 -08:00
Tobias Thierer
7ef760b832 Tweak comments for OpenJDK 9 build toolchain logic.
This addresses review comments on the preceding CL
http://r.android.com/539055

Test: Treehugger
Change-Id: Icb0674190db3d638546a0ed49dbcb97d0698e549
2017-11-17 15:35:59 +00:00
Bowgo Tsai
b855c0c304 Reorder assert-max-image-size and AVB signing
This change fixes the following warning message:
  WARNING: out/target/product/$(TARGET_DEVICE)/boot.img approaching \
  size limit (33554432 now; limit 33554432)

This is because AVB signing will increase boot.img to
BOARD_BOOTIMAGE_PARTITION_SIZE, in order to place the AVB metadata at
the end of the partition. We should check max image size first then use
avbtool to sign it.

The max allowed size will be (partition size - AVB_HASH_META_SIZE) when
AVB is enabled.

Bug: 69115400
Test: build and checks there is no size limit warning message
Change-Id: If9545e64a0d1714a2ec2440f9bd38293e7b1ba9a
2017-11-17 23:25:38 +08:00
Tobias Thierer
f6bd495728 Break EXPERIMENTAL_USE_OPENJDK9 into {USE,TARGET}_OPENJDK9.
This CL topic breaks the single flag value EXPERIMENTAL_USE_OPENJDK9
into two flags USE_OPENJDK9 and TARGET_OPENJDK9 which are computed
independently in config.mk and config.go; this means that later
build logic no longer depends on / duplicates the semantics of an
unset EXPERIMENTAL_USE_OPENJDK9, because that later build logic
can use USE_OPENJDK9 and TARGET_OPENJDK9 instead. Thus, it becomes
slightly easier to change this default in future CLs (touching
only config.mk and config.go).

It also makes it more straightforward to convert .mk files
to .bp.

This CL also introduces a new allowed value "false" for
EXPERIMENTAL_USE_OPENJDK9. This fourth possible value currently
has the same semantics as a default/unset
EXPERIMENTAL_USE_OPENJDK9, but allows people to explicitly
switch back to the old semantics when the default changes.

Test: make showcommands core-oj (in environments with
      EXPERIMENTAL_USE_OPENJDK9 set to "", "1.8", and "true").
Bug: 38177295

Change-Id: Iaade9610b237722e5d175143808b8653b1e98996
2017-11-17 13:14:11 +00:00
Alan Leung
7d6144d34b Rename r8 to r8-compat-proguard
Test: USE_R8=false USE_D8=true m -j32 && USE_R8=true USE_D8=true m -j32

Change-Id: I2610340cf75f8db5920e33fac542f0dcf294ce29
2017-11-16 17:24:01 -08:00
Colin Cross
e89df93231 Add support for srcjars to droiddoc
Soong generates the R.java for framework-res.apk to a srcjar.
Droiddoc will need to consume them, so add support to the droiddoc
rules for extracting sources from a srcjar.

Test: m checkbuild
Change-Id: I064889c9063b642835d9f668e2568b61d0fabe35
2017-11-16 14:58:05 -08:00
Dan Willemsen
d927abe8a8 Clear some aapt2.mk inputs after use
my_generated_res_dirs wasn't being reset in some cases in between
different modules. To be safe, clear every input variable that I was sure
was not being used by the caller after aapt2.mk.

Test: m
Test: m ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I37c861d99637cad77a2a378a119bf66cee373b3a
2017-11-15 17:00:46 -08:00
Tomasz Wasilczyk
4dbdb60698 Merge "Silence superfluous build messages." 2017-11-15 22:27:30 +00:00
Treehugger Robot
288521a615 Merge "Silence PRODUCT_COPY_FILES ignored messages" 2017-11-15 21:51:46 +00:00
Dan Willemsen
403b98aa25 Silence PRODUCT_COPY_FILES ignored messages
We don't have great alternatives for some of these use cases, so for now
just silence them, writing them to $OUT/product_copy_files_ignored.txt
(and if `dist' is specified, $DIST_DIR/logs/product_copy_files_ignored.txt)

Test: lunch aosp_arm-userdebug; m nothing
Test: lunch aosp_arm-userdebug; m dist
Change-Id: If0228bc8d907346e3505ae136cb477ef37a5c867
2017-11-15 11:13:23 -08:00
Tomasz Wasilczyk
29ec06b7ba Silence superfluous build messages.
Bug: 69315492
Test: it builds
Change-Id: Ic02484b80fa27c53786204402930ed5f33ec7fda
2017-11-15 10:34:01 -08:00
Jiyong Park
55e17a753e Keep PRODUCT_FULL_TREBLE to true even when some requirements are not met
When some of the full treble requirements are turned off,
PROUCT_FULL_TREBLE became false, which in turn cleared macro variables
guarded in treble: {cflags: "..."}.

Until when Soong recognizes each of the requirements (e.g.
treble_sepolicy: { }), don't reset PRODUCT_FULL_TREBLE to false
even when some of the requirements are not met.

Bug: 62019611
Bug: 68710251
Test: get_build_var PRODUCT_FULL_TREBLE returns true for aosp_walleye
Test: aosp_walleye boots to the UI
Change-Id: Iad3ee4f4462c82e9f9e1897f3ec019cdd16da358
2017-11-14 19:14:44 +09:00
Alex Deymo
cbb4ec6cf0 Merge "Update binary name to "brotli"." 2017-11-13 22:43:22 +00:00
Steven Moreland
33fdd8c4ef Break up PRODUCT_FULL_TREBLE into variables.
PRODUCT_SEPOLICY_SPLIT
PRODUCT_TREBLE_LINKER_NAMESPACES
PRODUCT_ENFORCE_VINTF_MANIFEST

Being able to selectively toggle these does several things:
- it's better software engineering (no longer conflating vars)
- easier bringup for devices.
- devices which don't require full Treble can opt out of only
  parts of it and still get the benefits of others.

Bug: 62019611
Test: manual

Merged-In: I728e32869baf043ae9a54e83e513fb99e560c827
Change-Id: I728e32869baf043ae9a54e83e513fb99e560c827
2017-11-13 10:32:52 -08:00
Alex Deymo
b10e07aea7 Update binary name to "brotli".
With the update of brotli to version 1.0.1 the new binary tool is now
called "brotli". This patch updates the scripts to use the new name.

Bug: 34220646
Test: `make dist`; ota_from_target_files on non-A/B device.
Change-Id: Ie8da4333388d029d5960a723a55efd875d8ee820
2017-11-13 18:11:45 +01:00
Dan Willemsen
207b009c86 Merge "Enable missing dependency checks" 2017-11-11 00:35:00 +00:00
Michael Schwartz
20401e3d84 Merge "Archive checkvintf in otatools" 2017-11-10 22:12:28 +00:00
Treehugger Robot
57d78295ef Merge "Turn unusual tags into errors" 2017-11-10 21:47:09 +00:00
Treehugger Robot
279f91510a Merge "Support gcno packaging for executables." 2017-11-10 21:05:42 +00:00
Michael Schwartz
6473e75479 Archive checkvintf in otatools
checkvintf will be used to verify compatibility of OTA packages.

Bug: 68327258
Test: `m -j dist` and inspect archive for checkvintf
Change-Id: I1d4cfcff537a03adee28d1e6ba9403a2e1635fe0
2017-11-10 09:38:28 -08:00
Dan Willemsen
bd8f84fca1 Turn unusual tags into errors
Test: build/soong/build_test.bash
Change-Id: If68bea3929763747137f8acc4a045933f40f5e17
Merged-In: If68bea3929763747137f8acc4a045933f40f5e17
(cherry picked from commit c35641913d)
2017-11-09 17:13:39 -08:00
Dan Willemsen
e43d8ee8ff Enable missing dependency checks
With this enabled, we'll check the entire build graph for missing
dependencies -- even if you don't need to build the module. So it'll
present more errors, but surface them earlier.

These can be turned off manually with an environment variable if the
branch is expected to have missing dependencies:

  ALLOW_MISSING_DEPENDENCIES=true
  SOONG_ALLOW_MISSING_DEPENDENCIES=true   (previous method)

That will be set automatically when using 'mm', which doesn't load the
entire build graph. It will also be set when using 'tapas' to build
unbundled apps, since those are usually on reduced branches.

This provides better error messages when a library is missing:

system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm64) missing libinit (SHARED_LIBRARIES android-arm64)
Available variants:
  libinit (STATIC_LIBRARIES android-arm64)
  libinit (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/init/Android.mk: error: init_tests (NATIVE_TESTS android-arm) missing libinit (SHARED_LIBRARIES android-arm)
Available variants:
  libinit (STATIC_LIBRARIES android-arm64)
  libinit (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/core/main.mk:852: error: exiting from previous errors.

instead of:

ninja: error: 'out/target/product/generic_arm64/obj/SHARED_LIBRARIES/libinit_intermediates/export_includes', needed by 'out/target/product/generic_arm64/obj/NATIVE_TESTS/init_tests_intermediates/import_includes', missing and no known rule to make it

Test: Manually introduce errors, check for expected output
Test: multiproduct_kati on AOSP and internal master, no new breakages
Change-Id: I5847f813045929813214137403c499b44ef67907
Merged-In: I5847f813045929813214137403c499b44ef67907
2017-11-10 01:13:07 +00:00
ShuJie Wang
76e93ba6cf build: clean up proguard_flag_files
we should clean up proguard_flag_files if LOCAL_PROGUARD_ENABLED
not defined in current module in case legacy proguard_flag_files
slips into current jack_all_deps dependencies.

Test: make -j8

Change-Id: I45618fc8e821ab7a8b964fa621824209e1e9894c
Signed-off-by: ShuJie Wang <wangshujie@xiaomi.com>
2017-11-09 15:26:28 +08:00
Vishwath Mohan
61bc4f790e Merge "CFI include/exclude path support (Make)" 2017-11-09 02:57:16 +00:00
Dan Willemsen
a3d94873cf Merge changes from topic "soong_ui_java"
* changes:
  Remove Java PATH check, deprecate using PATH in Kati
  Remove JAVA_NOT_REQUIRED
2017-11-08 20:31:31 +00:00
Vishwath Mohan
23b2d2e531 CFI include/exclude path support (Make)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I02fe1960a822c124fd101ab5419aa81e2dd51adf
2017-11-08 03:46:31 -08:00
Dan Willemsen
2ec3e4a257 Remove Java PATH check, deprecate using PATH in Kati
The Java PATH fixup is now handled within soong_ui, along with the
values of ANDROID_JAVA_HOME based on OVERRIDE_ANDROID_JAVA_HOME /
EXPERIMENTAL_USE_OPENJDK9.

Mark PATH as deprecated, so that any reads/writes will cause warnings.
This will be switched to obsolete once it's verified that there are no
more users.

Using PATH within Kati means that we've got to rebuild the ninja files
whenever your PATH changes, which is not ideal, especially since some of
the envsetup functions can change your PATH. In most cases you only need
to use PATH within the bash portions of the build rules ($${PATH}), which
isn't treated as a make variable, so won't produce an error.

I'm also planning on replacing PATH in a future change with our own
directory that has placeholders for everything in your PATH. This will
let us remove tools that shouldn't be used from the build.

Test: m nothing
Test: build/soong/build_test.bash on AOSP and internal master
Change-Id: I18d8d19cfba313ff9176345bf73ac34e8dbebfbb
2017-11-08 00:24:35 -08:00
Søren Gjesse
8639879e60 Merge "Use prebuild R8 for USE_R8=true" 2017-11-08 07:50:00 +00:00
Treehugger Robot
f599f4010e Merge "Add PRODUCT_ADB_KEYS" 2017-11-08 03:12:17 +00:00
Dan Willemsen
90879f50ea Remove JAVA_NOT_REQUIRED
This is no longer required.

Test: cs/JAVA_NOT_REQUIRED
Change-Id: I9f64e153c9f4af7df1c8dee4eaea3c7458be61c0
2017-11-07 17:43:36 -08:00
Treehugger Robot
4cb631f624 Merge changes from topic "system_default_prop"
* changes:
  Move ART default properties into system partition
  Add PRODUCT_SYSTEM_DEFAULT_PROPERTIES
2017-11-08 01:42:40 +00:00
Jaekyun Seok
5fb6a3eb9f Move ART default properties into system partition
Bug: 64661857
Bug: 68755013
Test: confirmed that ART default properties were stored in
/system/etc/prop.default on sailfish device

Change-Id: Ie07d3049de5ac395cfb9105e208fe7825080fa15
2017-11-08 00:56:43 +00:00
Ryan Campbell
14827f2a98 Support gcno packaging for executables.
Adapt the gcno packaging logic from shared_library_internal.mk for the
case of executable binaries so that gcov artifacts are properly
packaged.

Test: lunch walleye_coverage-userdebug && make -j60
Bug: 67998360
Change-Id: I4994fc21521c91d4c18bdf326be079beda1914a4
2017-11-07 09:52:27 -08:00
Søren Gjesse
c66d297e0a Use prebuild R8 for USE_R8=true
Instead of building R8 from external/r8 use the prebuild jar in
prebuilds/r8.

Test: m -j USE_R8=true

Change-Id: I9680ae430cdbc2b3beb910873c8eed27354f6af1
2017-11-07 16:21:50 +01:00
Dan Willemsen
dcd46870f2 Merge changes Ib37508d4,Ia46ac30e
* changes:
  Turn off Windows builds during BUILD_HOST_static
  zipalign: Fix build failure in static_sdk_tools.
2017-11-06 22:53:46 +00:00