Commit graph

11871 commits

Author SHA1 Message Date
Colin Cross
aa812d122c Allow debugging with SOONG_DELVE=<listen addr>
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
2019-07-03 16:33:31 -07:00
Colin Cross
7b97ecd1f5 Print ninja stdout live during the build
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
2019-07-03 16:33:10 -07:00
Mikhail Naganov
9d42425f25 Perform TERM check for file writers only
Tests use fakeSmartTerminal, this case must not be affected
by the TERM setting.

Test: TERM=dumb make
Change-Id: Ib926a1c6ba2d8c4117d412fe351d872ccfc1c799
2019-07-02 09:51:42 -07:00
Paul Duffin
aebc02ab29 Allow neverallow rules to be defined by custom bootstrap_go_packages
* 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
2019-07-01 16:15:07 +01:00
Treehugger Robot
e65d84c84c Merge "Enforce hidden api usage in vendor (soong)" 2019-07-01 02:06:57 +00:00
Treehugger Robot
a3ded95424 Merge "Improve dumb terminal detection" 2019-06-29 02:45:43 +00:00
Treehugger Robot
dd5cf7574b Merge "Disabled avx avx2 avx512 compiler flags by default. Library components can enable the flags based on performance impact" 2019-06-28 21:14:33 +00:00
Treehugger Robot
35bb770e0e Merge "Treat .cxx files as c++" 2019-06-28 20:43:33 +00:00
Paul Duffin
4190926e61 Merge changes from topic "package default_visibility"
* changes:
  Inherit default_visibility from parent package
  Allow default visibility to be set per package
2019-06-28 09:24:57 +00:00
Jeongik Cha
6bd33c13bb Enforce hidden api usage in vendor (soong)
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
2019-06-28 14:56:59 +09:00
Colin Cross
d34ab7c6b2 Treat .cxx files as c++
Fixes: 135749365
Fixes: 135667566
Test: m checkbuild
Change-Id: If47274812dfe781ebbb9f8a60a395650573727d5
2019-06-27 14:46:10 -07:00
Mikhail Naganov
b073581441 Improve dumb terminal detection
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
2019-06-27 10:54:53 -07:00
Mathieu Chartier
8a255acae2 Merge "Revert "Revert "Remove option to create boot image based on preloaded classes""" 2019-06-27 15:56:52 +00:00
Paul Duffin
e484f47a63 Inherit default_visibility from parent package
Enhances the visibility mechanism to use the default_visibility
property of the closest ancestor package that has the property
specified.

Bug: 133290645
Test: m droid
Change-Id: I7248e9034a73894ac8d514f913316438c4d7c079
2019-06-27 13:24:59 +01:00
Paul Duffin
e2453c705f Allow default visibility to be set per package
Adds a package module type with a default_visibility property. The
package module type can only be specified once per package.

Bug: 133290645
Test: m droid
Change-Id: Ibb2fb499c9ea88ecaa662d3cd2cbde478e4b9a4b
2019-06-27 13:24:50 +01:00
Paul Duffin
bf46d96c60 Merge "core_current does not include framework libraries" 2019-06-27 11:43:32 +00:00
jaishank
7e84969f96 Disabled avx avx2 avx512 compiler flags by default.
Library components can enable the flags based on
performance impact

Test: run-test gtest
Change-Id: I41c4464cffd2b0e830d4ab1c5a25b378e2a25129
Signed-off-by: jaishank <jaishankar.rajendran@intel.com>
2019-06-27 10:36:23 +05:30
Hsin-Yi Chen
30057808e1 Merge "Generate ABI dumps for libraries without source" 2019-06-27 02:08:34 +00:00
Treehugger Robot
7c9b4cf144 Merge "Compute critical path when ninja finishes" 2019-06-26 23:22:52 +00:00
Mathieu Chartier
6adeee1131 Revert "Revert "Remove option to create boot image based on preloaded classes""
Test: make
Test: build/soong/scripts/build-ndk-prebuilts.sh

This reverts commit d3f688b521.

Change-Id: Ia8898d11d67e5f0c4d8886f13d29f5dbd5f8609b
2019-06-26 14:54:47 -07:00
Colin Cross
7b6245388c Compute critical path when ninja finishes
Keep a running map of the critical path to each edge as it
finishes.  At the end of the build, find the edge with the
longest critical path and print the path to out/soong.log.

Test: critical_path_test.go
Change-Id: Ie01d26b068b768156b166bff00cdc3273e8124ca
2019-06-26 11:31:17 -07:00
Colin Cross
b2e4f475c3 Merge "Don't pass --legacy by default to aapt2 compile" 2019-06-26 17:05:34 +00:00
Treehugger Robot
25bdad9f2c Merge "Remove unused condition in decodeSdkDep(...)" 2019-06-26 16:56:20 +00:00
Mathieu Chartier
a6c4ff2cc8 Merge "Revert "Remove option to create boot image based on preloaded classes"" 2019-06-26 16:52:45 +00:00
Mathieu Chartier
d3f688b521 Revert "Remove option to create boot image based on preloaded classes"
This reverts commit 4a0473175e.

Reason for revert: NDK build broken

Change-Id: Id98bf9d5f82ed72d8c489264cf9d754e8ea1d27e
2019-06-26 16:44:38 +00:00
Mathieu Chartier
e2a8e7f0ec Merge "Remove option to create boot image based on preloaded classes" 2019-06-26 15:56:36 +00:00
Paul Duffin
7aae6e7794 core_current does not include framework libraries
Bug: 134566750
Test: m droid
Change-Id: I9496a121e28fabe0c60959ac8ccea60ec4b58544
2019-06-26 14:38:00 +01:00
Paul Duffin
735d03c65c Remove unused condition in decodeSdkDep(...)
The string "core.platform.api.stubs" is never passed to the toModule
function since change I6bb6c1a0ea24437c8253dc5d8fabd37edabc9d3e.

Bug: 134566750
Test: m droid
Change-Id: Ia425a433cd762bba30be72e837fa4199580e5b6c
2019-06-26 14:37:31 +01:00
Treehugger Robot
02f6880c27 Merge "Use prebuilt m4 for bison too" 2019-06-26 03:33:43 +00:00
Treehugger Robot
49eb5477c7 Merge "Uncompress dex in unbundled privileged apps" 2019-06-26 00:51:45 +00:00
Dan Willemsen
c4a6aa83e8 Use prebuilt m4 for bison too
Bison is currently looking for m4 directly in `/usr/bin/m4`, instead of
through $PATH, so it hadn't been tracked via the $PATH interposer
checks. But if you don't install m4 at all, it starts failing.

Bug: 117561006
Bug: 130111713
Test: Run on a machine without m4, build passes
Change-Id: I3fbad64127c183de79c17511e979fd5df946eb80
2019-06-25 16:12:12 -07:00
Mathieu Chartier
4a0473175e Remove option to create boot image based on preloaded classes
From now on, the only supported approach is to use a boot image profile.

Test: make

Change-Id: Ibd8fbd1dd81db0a7b3f3b3e626a70dcc26510224
2019-06-25 15:38:25 -07:00
Colin Cross
53a87f523b Uncompress dex in unbundled privileged apps
Mainline builds privileged apps unbundled and then uses them as
prebuilts, so they need to respect the privileged flag when
deciding whether or not to uncompress the dex.

Bug: 135772877
Test: TestUncompressDex
Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
2019-06-25 13:36:46 -07:00
Jaewoong Jung
c1001ec0c5 Create test build dir only once for apex_test.
Test: apex_test.go
Change-Id: Ib96ea4ec5d5ff0d8e8cf4a9eb479099cf2b1977c
2019-06-25 11:20:53 -07:00
Jaewoong Jung
50c744e916 Merge changes from topic "apex_notice"
* changes:
  Embed NOTICE output as an APEX asset.
  Optionally embed NOTICE files in apks.
2019-06-25 16:41:16 +00:00
Hsin-Yi Chen
f6a95467e2 Generate ABI dumps for libraries without source
This commit enables ABI diff for libraries without source.
Stub libraries are excluded.

Test: ./create_reference_dumps.py -products aosp_arm64
Test: make
Bug: 135728451
Change-Id: Idbe276db6f5e057175fc098f0226cb38996faa17
2019-06-25 15:06:13 +08:00
Treehugger Robot
ba9a51979d Merge "Revert "Switch to toybox tar."" 2019-06-25 05:24:44 +00:00
Jaewoong Jung
14f5ff62c9 Embed NOTICE output as an APEX asset.
Instead of outputting an aggregated NOTICE file as an intermediate build
resource to allow Make to include it in the final system-wide NOTICE,
process and embed it as an asset in the final APEX. This allows us to
update the NOTICE contents automatically when an APEX is updated.

Fixes: 135218846
Test: Built mainline modules, apex_test.go
Change-Id: Ic851b330fe93be1f602907d44ecc7886c3b0171b
2019-06-24 20:10:34 -07:00
Jaewoong Jung
5b425e2e20 Optionally embed NOTICE files in apks.
If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files
from all dependencies of the android_app, merge them with the app's own
one (if exists), transform it to HTML, gzip it, and put it as an asset
in the final APK output.

Bug: 135460391
Test: app_test.go
Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8
2019-06-24 19:10:22 -07:00
Elliott Hughes
afeb6cb817 Revert "Switch to toybox tar."
This reverts commit 3b584b7861.

Reason for revert: missing --mode.

Change-Id: I0cde94c38905e26c79c31a03fd0177d7d57daa32
2019-06-25 01:40:42 +00:00
Treehugger Robot
7d7cae85ab Merge "Soong: Add build_error proto raw file to $(OUT_DIR)." 2019-06-24 22:59:33 +00:00
Colin Cross
bbeb2c1a50 Merge "Color long running durations when using action table output" 2019-06-24 21:38:51 +00:00
Elliott Hughes
9b74dfe96c Merge "Switch to toybox tar." 2019-06-24 21:24:53 +00:00
Patrice Arruda
297cebad26 Soong: Add build_error proto raw file to $(OUT_DIR).
Soong_ui produces a build_error raw file to $(OUT_DIR) where
the file contains a list of build action errors. Each build action
error represents an error raised by a command. The build_error file
is populated if there was a build error.

Bug: b/132969697
Test: Ran m for successful build. Introduced a broken build change,
      ran m and verified using printproto that build_error was
      generated successfully.

Change-Id: I690ca1778b4e56f144a3173ba1d16d8494c32c15
2019-06-24 13:02:35 -07:00
Colin Cross
5137de0bdd Color long running durations when using action table output
When printing the action table, color the duration of commands that
have been running for 30 seconds yellow, and commands that have been
running for 60 seconds red.

Test: manual
Change-Id: I61cb21b0dae10811d345cb9f62cd07915cfc69ee
2019-06-24 10:49:11 -07:00
Paul Duffin
5c2f963a1d Remove the no_framework_libs property
Corrects an error message that refers to no_framework_libs.

Removes any tests that use no_framework_libs:true where possible as
there are duplicate tests for sdk_version:"core_platform". Otherwise,
switches them over to use sdk_version:"core_platform".

Bug: 134566750
Test: m droid
Change-Id: I41abe1a49f5c744e3393ca9cdf0c41888f810c9f
2019-06-24 16:03:56 +01:00
Treehugger Robot
84338df001 Merge "Allow passing --legacy in aaptflags" 2019-06-24 00:59:15 +00:00
Colin Cross
4215cfd8f9 Don't pass --legacy by default to aapt2 compile
Don't pass --legacy by default, it is rarely necessary and converts
some errors into warnings that crash at runtime.  The modules that
need it have had --legacy added to aaptflags.

Bug: 135597368
Test: m java
Change-Id: Ib05a07ead4084dd32ba28df26708d81bb53f2f2a
2019-06-22 13:04:30 -07:00
Colin Cross
a0ba2f5858 Allow passing --legacy in aaptflags
--legacy will soon no longer be passed by default to all aapt2
compiles.  Allow it to be specified in aaptflags by passing it to
aapt2 compile when it is present and filtering it out from the
flags passed to aapt2 link.

Bug: 135597368
Test: m java
Change-Id: Ib65d1a9b7c32ae4ff5ab6f58e66aedfb5f296712
2019-06-22 12:59:27 -07:00
Colin Cross
e264f22bec Merge changes Ia77090da,I95a57f76
* changes:
  Fix data races in finder_test.go
  Optimize sanitizerRuntimeDepsMutator
2019-06-21 17:01:23 +00:00