Commit graph

4029 commits

Author SHA1 Message Date
Treehugger Robot
e87ae20e25 Merge changes I670144f4,I7144cd42
* changes:
  Silence error during microfactory trace import
  Synchronize file rotation
2017-10-18 23:51:45 +00:00
Jeff Gaston
92d3dadf3b Merge "Automatically reorder C/C++ link dependencies in Soong" 2017-10-18 23:09:34 +00:00
Dan Willemsen
69b18ed167 Silence error during microfactory trace import
This may happen if there's been another call to microfactory before
we've read the log file. Just ignore the error and continue.

Test: Run `while true; do get_build_var TARGET_PRODUCT; done` in parallel
Change-Id: I670144f4637281ebf1299dbd9151dd9819c363e3
2017-10-18 15:09:16 -07:00
Dan Willemsen
ca8feb385c Synchronize file rotation
Create a lock file during log rotation so that multiple processes won't
step on each other.

Test: Run `while true; do get_build_var TARGET_PRODUCT; done` in parallel
Test: m blueprint_tools
Change-Id: I7144cd42aca47c694487ddae44713f82665ed81e
2017-10-18 15:09:08 -07:00
Jeff Gaston
294356f045 Automatically reorder C/C++ link dependencies in Soong
This uses knowledge of transitive dependencies to reorder
linker command line arguments such that if module A depends
on module B, then module A is automatically listed before
module B in the linker command line.

This should mostly remove the need for Android.bp files to
list all of their static dependencies in link order

Bug: 66260943
Test: reorder the entries of static_libs in an Android.bp and see that linking still succeeds

Change-Id: I20f851ab9f2f30031254e4f30023b6140d15d6c3
2017-10-18 14:30:05 -07:00
Treehugger Robot
31b59cf604 Merge "Have bpfix not remove empty lists" 2017-10-18 20:07:42 +00:00
Jeff Gaston
af3cc2d23c Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: I88c24a8a31ef68f428919087d206433659265684
2017-10-18 18:06:02 +00:00
Treehugger Robot
16b9ce4dff Merge "MIPS: Remove -U__unix and -U__unix__ from cflags" 2017-10-18 17:30:07 +00:00
Colin Cross
a482065454 Use soong_javac_wrapper in soong javac compiles
Test: m checkbuild
Change-Id: I0f9ff0a719ac550a011c2878fc51595dc3427aed
2017-10-18 17:09:54 +00:00
Goran Jakovljevic
68a321d92f MIPS: Remove -U__unix and -U__unix__ from cflags
Leave '__unix' and '__unix__' defined on mips/mips64, like arm.
This is needed to avoid a warning in external/libcxx project.

Test: successful build and boot aosp_mips-eng
Test: successful build and boot aosp_mips64-eng

Change-Id: I8f0e17bdbeffd5078c19aa7506564b8e79a9c945
2017-10-18 16:37:21 +02:00
Treehugger Robot
fa86d794b0 Merge "Allow jarjar_rules to be arch-specific" 2017-10-18 09:41:11 +00:00
Treehugger Robot
db58c63807 Merge "Use indent to preformat genrule property documentation" 2017-10-18 07:38:37 +00:00
Treehugger Robot
63160240d8 Merge "Explicitly document that export_include_dirs implies local_include_dirs" 2017-10-18 07:24:29 +00:00
Colin Cross
2296f5b3c4 Use indent to preformat genrule property documentation
Test: manual inspection of soong_build.html
Change-Id: Ibb5086de5497eb096ee7f68a5fd1ccaba630aa89
2017-10-18 05:44:54 +00:00
Colin Cross
5d19560e5e Explicitly document that export_include_dirs implies local_include_dirs
Test: none
Change-Id: I601919447a5539c49350378d7422083f5a076bf7
2017-10-18 05:44:31 +00:00
Colin Cross
ae96e5376a Hide "bootstrap class path not set in conjunction with -source" messages
javac warns whenever -source is used with a version that does not
match javac, because it wants an rt.jar provided for the given
source level.  We are not using -source to prevent usage of APIs
that don't exist in the newer rt.jar, so hide the messages.

Test: javac_wrapper_test.go
Change-Id: Ic94b61767436848fc164e377dc3cc5a63726f1cf
2017-10-18 05:44:04 +00:00
Treehugger Robot
21dc570e5f Merge "Fix soong_ui with empty arguments" 2017-10-18 05:30:23 +00:00
Dan Willemsen
6ac63ef003 Fix soong_ui with empty arguments
Test: build/soong/soong_ui.bash --make-mode "" nothing
Change-Id: I8bbe947078eaa00976811ce1b9b34e1a7c23f97f
2017-10-17 20:35:34 -07:00
Treehugger Robot
95e84af399 Merge "Allow arch-specific modules to be disabled in the PDK" 2017-10-18 01:18:52 +00:00
Treehugger Robot
c37e1018c7 Merge "Initial kotlin support" 2017-10-18 01:15:41 +00:00
Treehugger Robot
d3ded4073d Merge "Add --dumpvar[s]-mode to replace config.mk uses" 2017-10-18 00:54:44 +00:00
Colin Cross
975f9f79ff Allow jarjar_rules to be arch-specific
Modules may need to use jarjar on the device to move classes into
the android namespace, but not on the host.

Test: m checkbuild
Change-Id: I910ebbe20e45e98edecca0d7c4fb18e806bc3c6c
2017-10-17 16:25:26 -07:00
Colin Cross
99967a7b34 Allow arch-specific modules to be disabled in the PDK
Modules may need to be disabled in the PDK for the device but not
the host.

Test: m checkbuild
Change-Id: Ie40555d1437d9f36ceec753884dc4045132998eb
2017-10-17 16:25:26 -07:00
Colin Cross
93e8595044 Initial kotlin support
Allow java libraries to specify .kt sources, precompile them with
kotlin, and then pass them in the classpath to javac.

Bug: 65219535
Test: java_test.go
Change-Id: Ife22b6ef82ced9ec26a9e5392b2dadacbb16546f
2017-10-17 16:25:22 -07:00
Dan Willemsen
051133ba54 Add --dumpvar[s]-mode to replace config.mk uses
build/soong/soong_ui.bash --dumpvars-mode \
    --vars="..." \
    --abs-vars="..." \
    --var-prefix="..." \
    --abs-var-prefix="..."

is similar to the previous:

  CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
  make -f build/core/config.mk dump-many-vars \
    DUMP_MANY_VARS="..." \
    DUMP_MANY_ABS_VARS="..." \
    DUMP_VAR_PREFIX="..." \
    DUMP_ABS_VAR_PREFIX="..."

and

  build/soong/soong_ui.bash --dumpvar-mode [--abs] VAR

is similar to the previous:

  CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
  make -f build/core/config.mk dumpvar-[abs-]-VAR

But uses soong_ui and ckati, so that we use a consistent make parser and
sandboxing configurations.

One major output difference between the pure make implementation and
this one is that report_config in Go is implemented using embedded
newlines in single quotes, while the make implementation uses `` with
embedded echo commands. This seems to work fine for both bash and zsh,
and report_config isn't meant to be machine-parsed anyways.

Test: build/soong/soong_ui.bash --dumpvar-mode report_config
Test: build/soong/soong_ui.bash --dumpvar-mode TARGET_DEVICE
Test: build/soong/soong_ui.bash --dumpvar-mode --abs PRODUCT_OUT
Test: build/soong/soong_ui.bash --dumpvar-mode --abs ALL_PRODUCTS
Test: build/soong/soong_ui.bash --dumpvars-mode --vars="report_config TARGET_DEVICE" --abs-vars="ALL_PRODUCTS"
Test: build/soong/soong_ui.bash --dumpvars-mode --vars=TARGET_DEVICE --abs-vars=PRODUCT_OUT --var-prefix=v_ --abs-var-prefix=a_
Change-Id: I0fbd0732bbf6fcfcd24084cf3c830a91a4b6bfc2
2017-10-17 12:57:41 -07:00
Treehugger Robot
f6df17afd1 Merge changes Iaab7a588,I7bc1d1f3
* changes:
  Use jars containg sources for java generators
  Pass output file names into java.Transform* functions
2017-10-17 19:22:50 +00:00
Colin Cross
8c71d16652 Merge "Initial support for converting jars to java9 system modules" 2017-10-17 18:37:35 +00:00
Pirama Arumuga Nainar
0e8afed83a Merge "Add enable_profile_use property" 2017-10-17 03:00:05 +00:00
Colin Cross
59149b6df5 Use jars containg sources for java generators
srcFileLists was an ill-fated attempt to deal with generators that
produce a set of java sources that is not known ahead of time.
For example, the list of files produced by protoc depends on the
package statement in the .proto file.  srcFileLists put the list
of generated files into a file, which was then passed to javac
using the @file syntax.  This worked, but it was too easy to cause
missing dependencies, and will not work well in a future distributed
build environment.

Switch to putting generated sources into a jar, and then pass them
jar to javac using -sourcepath.

Test: m checkbuild
Change-Id: Iaab7a588a6c1239f7bf46e4f1b102b3ef517619b
2017-10-16 19:39:39 -07:00
Colin Cross
e9a275b440 Pass output file names into java.Transform* functions
Pass the output file name into the java.Transform* functions.
This consistently puts control of the filename into java.go,
which is often necessary to avoid collisions when the same
rule is used multiple times in a single module.  It also
has the side-effect of removing the poorly named "stem"
parameters.

Test: java_test.go
Change-Id: I7bc1d1f3bfae6f9d2c92870e6df381817817aab4
2017-10-16 19:39:39 -07:00
Colin Cross
1369cdb280 Initial support for converting jars to java9 system modules
Adds a java_system_modules module type that (when
EXPERIMENTAL_USE_OPENJDK9 is set to true) converts a list of
java library modules and prebuilt jars into system modules,
and plumbs the system modules through to the javac command
line.

Also exports the location of the system modules to make
variables, as well as the name of the default system module.

Test: TestClasspath in java_test.go, runs automatically as part of the build
Bug: 63986449
Change-Id: I27bd5d2010092422a27b69c91568e49010e02f40
2017-10-16 15:00:02 -07:00
Pirama Arumuga Nainar
6aeed8b439 Add enable_profile_use property
Bug: http://b/65598278

This property defaults to 'true' and setting it to false skips profile
use.  This escape hatch lets us disable PGO for a module without
completely removing the 'pgo' property.  Additionally, this also helps
selectively disabling PGO for some architectures, if desired.

Test: Test that -fprofile-use is not added for a test module if
'enable_profile_use: false' is set.

Change-Id: Ifcf1a48c194bc86efd88a529cc2d66a47b7ab080
2017-10-16 13:36:29 -07:00
Colin Cross
070879e69e Refactor errorprone support to reduce duplication
Use a helper function to set up errorprone and javac compiles.

Test: m -j checkbuild
Test: m -j RUN_ERROR_PRONE=true
Change-Id: Icef3a5e1b359487eea3c3306d3d5763dab912b38
2017-10-16 12:50:29 -07:00
Dan Willemsen
8122bd58ba Revert "Always run asan ckati on the build servers"
This reverts commit a3e6c520ac. I fixed
a few heavy stack users, and we've got better debugging.

Bug: 36182021
Test: m dist
Change-Id: Iefd8589185720e44c40a2e0ceff5fd1438211b86
2017-10-14 00:43:13 +00:00
Dan Willemsen
75d2c170b4 Always record kati stats into soong log
Pass --dump-stats to ckati, but filter out the '*kati*' lines so that
they only end up in our verbose output. That way we've always got access
to the statistics.

Bug: 36182021
Test: m nothing; cat out/soong.log
Change-Id: Iaf7a814fc67f3e475c913faf69924a7f4e2ae3b3
2017-10-14 00:42:30 +00:00
Dan Willemsen
37cba1471f Merge "Switch product configs from make to ckati" 2017-10-13 23:22:00 +00:00
Jeff Gaston
daf774f1f0 Merge "Make some params in soong_zip explicit and/or exported" 2017-10-13 20:08:52 +00:00
Elliott Hughes
4d219e801d Merge "Unified sysroot: arch-X/include directories are gone." 2017-10-13 17:35:41 +00:00
Jiyong Park
6a43f04777 Squash vendor sources before linkageMutator runs
linkageMutator removes srcs property of the shared variant of a lib in
order to reuse *.o files compiled for the static variant also to the
shared variant.

However, this causes problem when vendor-specific srcs are specified in
target: {vendor: {srcs: ["..."]}}. For example, let's assume

cc_library {
    name: "libfoo",
    srcs: ["foo.c"],
    target: {
        vendor: {
            srcs: ["bar.c"],
        },
    },
}

Then,
static_vendor: inputs = foo.o, bar.o
shared_vendor: inputs = foo.o (from static_vendor), bar.o (from
static_vendor), bar.o

So, bar.o is included twice and this causes multiple symbol definition
error.

In order to handle the problem, vendor mutator is applied before the
linkage mutator and the vendor-specific srcs are squashed in the vendor
mutator.

Bug: 67731122
Test: build
Test: cc_test.go

Change-Id: I2a5390295dddfc41260e9b6f02746908cdf47228
2017-10-13 14:36:12 +09:00
Dan Willemsen
b2e6c2e571 Switch product configs from make to ckati
This speeds up dumping make variables from ~380ms using make to ~220ms
using ckati. It also means that we're consistently using the same parser
for builds (with the same .KATI_READONLY/etc extensions).

envsetup.sh (lunch) / other scripts still use make, changing those to go
through soong_ui will be a future change.

Test: m clean; m nothing
Test: USE_GOMA=true m nothing
Test: m PRODUCT-aosp_x86-sdk
Test: m APP-Calculator
Test: build/soong/build_test.bash -only-config  (on AOSP and internal master)
Change-Id: I6ca554de8de4955fb869001d06d29969b75751cc
2017-10-12 18:11:08 -07:00
Jeff Gaston
c3bdc975a4 Make some params in soong_zip explicit and/or exported
in preparation to split soong_zip into a lib and a bin

Bug: 67478260
Test: m -j
Change-Id: I725da6f0c9b13069e3e5b036e2ac8cbdde9ba6bf
2017-10-12 12:51:52 -07:00
Elliott Hughes
de28deb460 Unified sysroot: arch-X/include directories are gone.
Bug: N/A
Test: builds
Change-Id: I98fc6a1a3c0be1c90b1deb35b54f36ab16a202ac
2017-10-12 09:07:53 -07:00
Treehugger Robot
432a2d4033 Merge "Let tests override environment" 2017-10-11 08:18:17 +00:00
Colin Cross
6ccbc913e4 Let tests override environment
Pass an environment to TestConfig that will be used for
all Config.Getenv calls.

Test: none
Change-Id: I683cd9c9e0db61c9bfd2adb27fca78f558f225c4
2017-10-10 23:28:43 -07:00
Treehugger Robot
7228a62297 Merge "vendor_available:false hides a lib from vendors" 2017-10-11 01:45:36 +00:00
Treehugger Robot
3656beab20 Merge changes Ib23bad52,I1923ebde
* changes:
  Do not use profiles if ANDROID_PGO_NO_PROFILE_USE is set
  Refactor methods to be on PgoProperties struct
2017-10-11 00:08:29 +00:00
Pirama Arumuga Nainar
0fdfc459cf Do not use profiles if ANDROID_PGO_NO_PROFILE_USE is set
Bug: http://b/65598278

Non-PGO builds (with this environment variable set) can be used to
measure the performance difference induced by PGO.

Test: Build PGO modules with ANDROID_PGO_PROFILE_USE set.
Change-Id: Ib23bad5208ac7f54894c7768d7532f53b6b91179
2017-10-10 15:41:25 -07:00
Pirama Arumuga Nainar
3f5bb9c89b Refactor methods to be on PgoProperties struct
These methods only need the 'PgoProperties' struct.  Avoid the extra
indirection by directly using this struct.

Test: Build modules with PGO property.
Change-Id: I1923ebde4b0d546810de8e696514d218b3a4f54b
2017-10-10 10:58:37 -07:00
Colin Cross
92430106c3 Add hostdex support
If hostdex: true is specified for a java library, create an extra
Make module that copies the dex jar to a module with a -hostdex
suffix in the host output directory.

Bug: 67600882
Test: m -j checkbuild
Change-Id: I859dfaabeefdca714b566de94e00f74e03c85939
2017-10-10 08:02:20 -07:00
Jiyong Park
82e2bf3b7f vendor_available:false hides a lib from vendors
When a lib is explicitly marked as `vendor_available: false`, then it
can't be directly depended by a vendor lib which is installed to /vendor
partition. This is to hide some VNDK libs (including llndk) from vendors
so that platform owners can have a freedom of modifying their ABI
without breaking vendors.

In addition, the list of the private libs are exported to the make world
as VNDK_PRIVATE_LIBRARIES.

Also, fixed a bug that allowed a vndk lib to link against to vendor
library (or vendor variant of a system lib) if the lib is prebuilt.

Bug: 64730695
Bug: 64994918
Test: Add `vendor_available: false` to libft2 and libcompiler_rt.
Add the libs to shared_libs property of a vendor library in soong
(i.e. libnbaio_mono). The build fails with the error message.

Change-Id: Iab575db96bb4f6739a592f3fa0a75124296bea0c
2017-10-10 19:38:06 +09:00