Commit graph

5644 commits

Author SHA1 Message Date
Dan Willemsen
22de216799 Increase per-process file limits for multiproduct_kati
On large branches (250+ configurations), the open file count can go
over the default 1024 soft limit on Ubuntu. Many systems have increased
that default, but for the ones that haven't, at least opt into the
hard limit until this can be refactored to use fewer open files.

Bug: 70370883
Test: prlimit -n256:4096 build/soong/build_test.bash -only-config
Test: ulimit -Sn 256; build/soong/build_test.bash -only-config (darwin)
Change-Id: I7a952ffc89a0149ab65b04db1523d348daa6ab3e
2017-12-11 22:53:16 +00:00
Jeff Gaston
592faab77d Merge "Clearer error if no Android.bp is found" 2017-12-11 21:10:38 +00:00
Tobias Thierer
e05f3a5f3f Revert "Build with OpenJDK 9 -target 1.8 by default except for errorprone."
After this revert CL topic, the default toolchain for Android
goes back to being OpenJDK 8.

This revert is being prepared ahead of time in case of
any problems with CL topic:
https://r.android.com/#/q/topic:bug69449021_attempt2

Bug: 69449021
Test: Treehugger
Change-Id: I9ead8d569226bd487baee3c6d5be9ec7033eb56a
2017-12-11 14:54:10 +00:00
Tobias Thierer
13f23a2753 Build with OpenJDK 9 -target 1.8 by default except for errorprone.
(This is cherry-picked from the first attempt to submit this CL
topic, which was reverted after 3 hours because of bug 70286093;
robolectric 3.{1.1,4.2} now stick with OpenJDK 8 to avoid that bug).

Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: Running robolectric tests succeeds on internal-master
      after cherry-picking this CL topic, using the command
      line from http://b/70286093#comment1
(cherry picked from commit 0ae8b548af)

Change-Id: Ide6a7e55126d919a44f89ef8e0bd14fb12ff470e
2017-12-11 14:53:52 +00:00
Colin Cross
ac87c992be Allow globs in tool_files
tool_files can be used to add dependencies on files used by tools,
so let it support globs.

Test: m checkbuild
Change-Id: I1c1cb098190e1bb1c81292f6eb0c4ed0e240c1e1
2017-12-08 18:23:57 -08:00
Jeff Gaston
02ae4decb7 Clearer error if no Android.bp is found
Bug: 70036990
Test: touch .out-dir && m -j nothing 2>&1 | grep "must not exist"
Change-Id: Idefa70dafa53bca17134e99185d2c524671bae25
2017-12-08 14:39:37 -08:00
Tobias Thierer
06ae582000 Export makevars ANDROID_JAVA{8,9}_HOME.
These variables are published by config.go for use inside
.mk scripts. They are suitable for rules that need to be
pinned to a particular java/javac version because they do
not (yet) support the other.

Bug: 70286093
Test: Treehugger
Change-Id: Id407fca187fdf6c1947fc9d1ed7cd634fe089384
Merged-In: Id407fca187fdf6c1947fc9d1ed7cd634fe089384
2017-12-08 18:35:43 +00:00
Colin Cross
e304cc4575 Merge "Split logtags implementations for cc and java" 2017-12-08 16:14:06 +00:00
Colin Cross
5beccee92c Split logtags implementations for cc and java
Logtags files in cc and java are treated fundamentally differently.
In cc, they are not used for compiling at all, but need to be passed
to Make to be combined into the global logtags list, and logtag files
are listed in a logtags property.  In java they are listed in srcs
and produce generated code that is compiled in, and so shouldn't
also need to be listed in a logtags property.

Move the logtags property to cc and export it to Make from there,
and have java extract logtags files from srcs to be exported to
Make.

Test: m checkbuild
Change-Id: I31d49289efe72db60d2f33566df771b4a3ebc8a0
2017-12-07 15:32:30 -08:00
Jeff Gaston
29e959dd7f Search for files named Blueprints only under build/blueprint
to enable other subprojects to use their own instance of
Blueprint in other directories.

Files named Android.bp are still autodetected throughout the
tree like previously.

Bug: 64363847
Test: mkdir -p subdir \
      && echo "syntax error" > Blueprints \
      && m -j nothing

Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/soong:work^' 'build/soong:work'

Change-Id: I8199f12b68dc1699bf44682b86169def37b53a5e
2017-12-07 13:00:51 -08:00
Chih-Hung Hsieh
2c07fc68fd Add default -Werror to cts.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I4900286f75c4f0ee17967085ed7012ddbe6024c9
2017-12-07 11:22:00 -08:00
Chih-hung Hsieh
4b9bb14dd2 Merge "Remove 6 directories from WarningAllowed*Projects." 2017-12-07 17:02:15 +00:00
Treehugger Robot
b973cd152e Merge "Add HostToolPath() for Python binary" 2017-12-07 00:43:51 +00:00
Chih-Hung Hsieh
b47ac038e8 Remove 6 directories from WarningAllowed*Projects.
Test: normal build
Change-Id: I44381a2a7994d9f74329b0516d2bb303b5866a66
2017-12-07 00:12:35 +00:00
Colin Cross
9e094ebe1d Merge changes from topic "soong_dexpreopt"
* changes:
  Add more dex_preopt properties
  Run gofmt -w
2017-12-06 23:32:36 +00:00
Nan Zhang
b8bdacfd0b Add HostToolPath() for Python binary
So in the genrule, Python binary module can be used as tool.

Test: manually write a test genrule.
Change-Id: Idfd3af4c1002dd608e1bdffa203e01c802f1bf21
2017-12-06 15:13:10 -08:00
Treehugger Robot
fd2005fc19 Merge "Update pom2mk to allow duplicate module names if rewritten" 2017-12-06 21:39:46 +00:00
Colin Cross
1bd8780881 Add more dex_preopt properties
Move dex_preopt to dex_preopt.enabled, and add dex_preopt.app_image,
dex_preopt.profile_guided, and dex_preopt.profile.  These values will
be passed back to Make if provided to control dex preopting.

Test: m checkbuild
Change-Id: I54a4b1de697a08be20ab65d2a5dc43ce0046692d
2017-12-06 13:27:56 -08:00
Colin Cross
7a6fcbe302 Run gofmt -w
Test: none
Change-Id: I2b503e06a4ae8e72a08f6bfb64692dfd33e2b7e2
2017-12-06 13:19:14 -08:00
Tobias Thierer
38f7173524 Merge "Revert "Default to building with OpenJDK 9 -target 1.8.""
am: c7efdd9b36

Change-Id: Icdbace15dcd4cc5f337b575e98db6265fdf967f2
2017-12-06 14:09:41 +00:00
Tobias Thierer
c7efdd9b36 Merge "Revert "Default to building with OpenJDK 9 -target 1.8."" 2017-12-06 14:00:47 +00:00
Tobias Thierer
51512a1848 Merge "Build with OpenJDK 9 -target 1.8 by default except for errorprone."
am: cf8d83de82

Change-Id: Ibe7792469a125f78ef98240f63f2d08047d0e4f1
2017-12-06 11:09:46 +00:00
Tobias Thierer
cf8d83de82 Merge "Build with OpenJDK 9 -target 1.8 by default except for errorprone." 2017-12-06 11:05:31 +00:00
Colin Cross
21fafc6298 Split java_binary modules into common and binary variants
am: 6b4a32d771

Change-Id: I6da3e0b26b39e079769dbaed65903416f9fa1ebb
2017-12-06 04:27:01 +00:00
Colin Cross
a244a33418 Make (Source|Output)Path.Join("foo").Rel() return "foo"
am: 0db5568612

Change-Id: I6a19550ef017532b2623491938ff000a0e31ac29
2017-12-06 04:26:59 +00:00
Colin Cross
6b4a32d771 Split java_binary modules into common and binary variants
Add a common_first multilib type and use it for java.Binary
so that the java part is compiled as a "common" arch type
but the wrapper script is installed as a "linux_glibc" arch
type.  This allows java_binary to be used as a tool dependency
for a genrule.

Bug: 68397812
Test: TestJavaBinary
Change-Id: I809060839ce8878300da3fb76426ceb1ea6b0e8e
2017-12-06 04:16:21 +00:00
Colin Cross
0db5568612 Make (Source|Output)Path.Join("foo").Rel() return "foo"
This allows TestModule.Output("foo") to be used to find
a file called "foo" that was installed using ctx.InstallFile.

Test: soong tests
Change-Id: I04833c9ee8ac5baa6b6afd35715d1191c1622a78
2017-12-06 04:16:00 +00:00
Colin Cross
ac07312f15 Add java_genrules to use jars as inputs and outputs
am: 5425090a4f

Change-Id: I0b6f3b8f04bb5ced5df7b9a985ed5298e8ba2e1e
2017-12-06 04:01:28 +00:00
Colin Cross
799ed60b06 Make TestModule.Output print a list of all outputs on error
am: 9cf27db425

Change-Id: Id3e6b3e4b2faee411753d4e34ce59a3cee2651ac
2017-12-06 04:01:26 +00:00
Colin Cross
5425090a4f Add java_genrules to use jars as inputs and outputs
Add a java_genrule that has the right multilib flags to be a
dependency of a java rule.  Make java libraries implement
SourceFileProducer so that their classes jar can be used as an
input to a java_genrule.  Allow libs and static_libs dependencies
to be a java_genrule.

Test: TestJarGenrules
Change-Id: Ib1b31ef9c0b7e72eeed2c9ecc4ce8a1088e0b1c9
2017-12-06 03:55:20 +00:00
Colin Cross
9cf27db425 Make TestModule.Output print a list of all outputs on error
Debugging when writing tests using TestModule.Outputs is
unnecessarily hard, it panics when an incorrect output path
is given but doesn't provide any help to figure out why.
Follow the pattern used by TestContext.ModuleForTests
and print the list of valid output paths on failure.

Test: m checkbuild
Change-Id: I50e8e2dfc2070bd538d47cf6495a489f727b1564
2017-12-06 03:55:08 +00:00
Chih-Hung Hsieh
875e78c85e Allow warnings in libbufferhub.
am: 809d3f8f63

Change-Id: Ia4c668bbf02fc0a7af7fec12e1f1f1ec3aaabf58
2017-12-06 02:18:46 +00:00
Chih-Hung Hsieh
809d3f8f63 Allow warnings in libbufferhub.
* This directory still has warnings.

Test: normal build
Change-Id: Ie322ebf38d828d63e9115308b8e71769fc2a452a
2017-12-05 16:51:22 -08:00
Chih-Hung Hsieh
02c11fa130 Reduce WarningAllowedProjects.
am: 8ca48361ef

Change-Id: Id48dfe471ff908df3e3ec6bc4dab8d7e3466fbaf
2017-12-05 23:04:34 +00:00
Alan Viverette
75b95f8a61 Update pom2mk to allow duplicate module names if rewritten
Fixes: 70162730
Test: ./update_current.py -s -t 4482279
Change-Id: I874d7bfb50fd2d2bc488f5458cfe57b2e0d4d4e5
2017-12-05 12:53:44 -05:00
Chih-Hung Hsieh
8ca48361ef Reduce WarningAllowedProjects.
* Warnings were fixed or suppressed in these projects.

Test: normal build
Change-Id: I24ef1b59d6c5ccd50979b7d792764de9d6da7e30
2017-12-05 09:12:35 -08:00
Jeff Gaston
40573a7456 Merge changes from topic "soong-namespaces"
am: 73c2099534

Change-Id: I75fa176c2fa545811bf14500c23f55d7426aa439
2017-12-05 03:55:25 +00:00
Jeff Gaston
3f51258096 require namespaces to be declared only in files named Android.bp
am: 5c3886de5a

Change-Id: I41b69b310e9051f07533962f2c90c2ef311051fc
2017-12-05 03:55:17 +00:00
Jeff Gaston
dc1a9a8eb4 Document Soong namespaces
am: 44c0cd8543

Change-Id: Ice8ea9a9682121d0530d59aa482f50f0b21737ed
2017-12-05 03:55:07 +00:00
Jeff Gaston
994f9e7a92 Revert "Revert "Soong support for namespaces""
am: 088e29ed38

Change-Id: Id969fc05530600bbde27282c3035ad75e6e46a0e
2017-12-05 03:54:51 +00:00
Jeff Gaston
73c2099534 Merge changes from topic "soong-namespaces"
* changes:
  Make ninja file deterministic even with dup module names
  require namespaces to be declared only in files named Android.bp
  Document Soong namespaces
  Revert "Revert "Soong support for namespaces""
2017-12-05 03:48:20 +00:00
Jeff Gaston
4f9834d119 Merge "Have diff_build_graphs.sh print the number of lines in the diff"
am: 7c25d88e6b

Change-Id: I809ac491b2a6b9bca8c9683df421c21dbd6b12e1
2017-12-05 02:16:37 +00:00
Tobias Thierer
7c05949407 Revert "Default to building with OpenJDK 9 -target 1.8."
After this revert CL topic, the default toolchain for Android
goes back to being OpenJDK 8.

This revert is being prepared ahead of time in case of
any problems with original change topic,
https://r.android.com/#/q/topic:bug_69449021

Bug: 69449021
Test: Treehugger

This reverts commit 0ae8b548af.

Change-Id: Ief7646a94f1a264085cd299b4327d244b78a1537
2017-12-05 02:10:55 +00:00
Tobias Thierer
0ae8b548af Build with OpenJDK 9 -target 1.8 by default except for errorprone.
Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: "make core-oj", checked that compilation now uses
      OpenJDK 9 javac -target 1.8
Test: Checked that this is still compiled using OpenJDK 8.
      export EXPERIMENTAL_USE_OPENJDK9=false
      make core-oj

Change-Id: Ic87e9bb2a2e5da0ff13a2e51845b5365901c1507
2017-12-05 02:07:30 +00:00
Treehugger Robot
7c25d88e6b Merge "Have diff_build_graphs.sh print the number of lines in the diff" 2017-12-05 02:04:29 +00:00
Jeff Gaston
5c3886de5a require namespaces to be declared only in files named Android.bp
Bug: 65683273
Test: m -j nothing # which runs unit tests

Change-Id: I5edf0e0482809f5ac9fb9dfff342fb404e1c52da
2017-12-04 17:44:32 -08:00
Jeff Gaston
44c0cd8543 Document Soong namespaces
Bug: 65683273
Test: Read README.md

Change-Id: I179c085e123858ae425515ac6bbf4b272c245a2e
2017-12-04 17:44:32 -08:00
Jeff Gaston
b274ed3252 Make ninja file deterministic even with dup module names
Bug: 65683273
Test: ./build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm '' ''

Change-Id: Ie01ff579d69e94b12363f53aec5d25810211c451
2017-12-04 17:44:32 -08:00
Jeff Gaston
088e29ed38 Revert "Revert "Soong support for namespaces""
This mostly reverts commit 178d5fefc0
and mostly reapplies change I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c .

Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I32baae00277a547fdcdd1c2219fe6625ee0e45d7
2017-12-04 17:44:29 -08:00
Justin Yun
702a40d5cd Install VNDK snapshot libraries for system build
am: 7154928c93

Change-Id: I5320a9aa79cfac4d30ade0db1d2c901d03055c1a
2017-12-05 01:38:26 +00:00