Commit Graph

2014 Commits

Author SHA1 Message Date
Dan Willemsen c2af0bedc1 Add multiproduct_kati
This is a replacement for build/tools/kati_all_products.sh using the new
Soong ui/build package. It doesn't even attempt to run ninja, and it can
be configured to run only the product config, or only the product config
and Soong.

For AOSP on my machine:
 -only-config  1.4s
 -only-soong   1m20s
 <none>        13m

Test: multiproduct_kati
Change-Id: Ie3e6e7bdf692e46a8b8eb828f437190f8003500b
2017-02-06 14:05:07 -08:00
Dan Willemsen 0043c0e767 Add microfactory to bootstrap a go program with minimal overhead
microfactory is a tool to incrementally compile a go program. It's
similar to `go install`, but doesn't require a GOPATH. A package->path
mapping can be specified as command line options. All input files are
hashed, and if any change, the necessary packages will be rebuilt.

microfactory can (re)build itself as necessary, so combined with a shell
script that runs `go run microfactory.go` the first time, it can
bootstrap a go program entirely from sources with just a working goroot.

Time to build soong_ui only using source & GOROOT:

            first time    no-change incremental
microfactory  1400ms               15ms
go install     670ms              130ms

While microfactory takes longer the first time, almost half of that time
is from `go run` and building microfactory for use later. If
microfactory only has to build soong_ui, it's about 580ms.

Test: USE_SOONG_UI=true m -j blueprint_tools
Test: go test -bench . build/soong/cmd/microfactory/microfactory_test.go
Change-Id: I4d2b9825788144fa10042bbd804482e44f459a54
2017-02-06 14:05:07 -08:00
Dan Willemsen 1e70446251 Add a Go replacement for our top-level Make wrapper
Right now this mostly just copies what Make is doing in
build/core/ninja.mk and build/core/soong.mk. The only major feature it
adds is a rotating log file with some verbose logging.

There is one major functional difference -- you cannot override random
Make variables during the Make phase anymore. The environment variable
is set, and if Make uses ?= or the equivalent, it can still use those
variables. We already made this change for Kati, which also loads all of
the same code and actually does the build, so it has been half-removed
for a while.

The only "UI" this implements is what I'll call "Make Emulation" mode --
it's expected that current command lines will continue working, and
we'll explore alternate user interfaces later.

We're still using Make as a wrapper, but all it does is call into this
single Go program, it won't even load the product configuration. Once
this is default, we can start moving individual users over to using this
directly (still in Make emulation mode), skipping the Make wrapper.

Ideas for the future:
* Generating trace files showing time spent in Make/Kati/Soong/Ninja
  (also importing ninja traces into the same stream). I had this working
  in a previous version of this patch, but removed it to keep the size
  down and focus on the current features.
* More intelligent SIGALRM handling, once we fully remove the Make
  wrapper (which hides the SIGALRM)
* Reading the experimental binary output stream from Ninja, so that we
  can always save the verbose log even if we're not printing it out to
  the console

Test: USE_SOONG_UI=true m -j blueprint_tools
Change-Id: I884327b9a8ae24499eb6c56f6e1ad26df1cfa4e4
2017-02-06 14:05:07 -08:00
Colin Cross bd8bb38b49 Merge "Fix zip tests" am: c821042c3f
am: 63f6cabb1a

Change-Id: I0dbc07994b4374757ca2a4e49c838c4867926e22
2017-02-06 21:24:55 +00:00
Colin Cross cf02fcb226 Merge "Support data properties for test binaries" am: 77de5a4b9d
am: 9be3b4aebc

Change-Id: I28459316fa61b0f2156dcf14e71051739aa2af57
2017-02-06 21:24:44 +00:00
Colin Cross 63f6cabb1a Merge "Fix zip tests"
am: c821042c3f

Change-Id: I57af7014b67d5ee4e5ff55027eb2e94a7c3a6a75
2017-02-06 21:22:53 +00:00
Colin Cross 9be3b4aebc Merge "Support data properties for test binaries"
am: 77de5a4b9d

Change-Id: I3a825be74fd0904d72d5606879e1421c5c1effe3
2017-02-06 21:22:43 +00:00
Colin Cross c821042c3f Merge "Fix zip tests" 2017-02-06 21:17:21 +00:00
Colin Cross 77de5a4b9d Merge "Support data properties for test binaries" 2017-02-06 21:17:12 +00:00
Dan Albert 72dcf8efd6 Merge "Add c_std and cpp_std properties." am: 721197de2c
am: d02c9ff9d8

Change-Id: I4acdfe81e9e9d45d1c8bb93a3ed37af555f7e106
2017-02-06 19:25:40 +00:00
Dan Albert d02c9ff9d8 Merge "Add c_std and cpp_std properties."
am: 721197de2c

Change-Id: I9b5b4f14d6611f7a30435fcc2f17381b3fcb254c
2017-02-06 19:22:38 +00:00
Treehugger Robot 721197de2c Merge "Add c_std and cpp_std properties." 2017-02-06 19:18:27 +00:00
Colin Cross afcd623aa7 Allow non-tool dependencies in genrules am: d1b8d760b5
am: 7564cecad8

Change-Id: I8cbfc8b327c7bc274c114588914c3059eb6b1900
2017-02-04 23:43:48 +00:00
Colin Cross 7564cecad8 Allow non-tool dependencies in genrules
am: d1b8d760b5

Change-Id: I98e7a777a1fc2c78aceab81a59ca366d7e505e54
2017-02-04 23:41:17 +00:00
Colin Cross d1b8d760b5 Allow non-tool dependencies in genrules
The genrule tool dependency handling was rejecting any dependencies
that were not tools.  This caused a failure when ExtractSourceDeps
added a source file dependency on a filegroup module.  Remove the
unnecessary check in the tool handling.

Test: builds
Bug: 35002681
Change-Id: Ibd8dff306be3ef55aac2e12a28ddc187be2234d9
2017-02-04 12:45:03 -08:00
Dan Albert 043833ca81 Add c_std and cpp_std properties.
Test: Checked showcommands ouput for each setting.
Bug: None
Change-Id: Ibe02352f19ca2777b9a419136270e5c4390f1149
2017-02-03 16:45:38 -08:00
Evgenii Stepanov d9ebc339af Disable CFI on Mips and add -march to linkflags on ARM. am: a83fdacf7c
am: 5fcdf1374f

Change-Id: Ie8e1957e1c4af0f9fbb77a51b2324477d2a7bfff
2017-02-04 00:20:18 +00:00
Evgenii Stepanov 5fcdf1374f Disable CFI on Mips and add -march to linkflags on ARM.
am: a83fdacf7c

Change-Id: If43102867c9ba3a343a0e282704eddaacbdd6e78
2017-02-04 00:17:47 +00:00
Evgenii Stepanov a83fdacf7c Disable CFI on Mips and add -march to linkflags on ARM.
Mips toolchain does not have ld.gold.
ARM change is a workaround for LLVM r290384.

Bug: 33678192
Test: make ENABLE_CFI=1
Change-Id: I189ffd42760f0ea8d151717337b9355b37cb207b
2017-02-03 23:50:28 +00:00
Evgenii Stepanov a24fc37524 Remove duplicate code. am: cb3f890263
am: c527b4f1a8

Change-Id: I9eced5cc67b383ee5d3475731cde9a757119b2fd
2017-02-03 23:30:55 +00:00
Evgenii Stepanov c527b4f1a8 Remove duplicate code.
am: cb3f890263

Change-Id: I30424f51a21d891963a6ca025b060e7c8d1686b2
2017-02-03 23:28:25 +00:00
Evgenii Stepanov cb3f890263 Remove duplicate code.
Test: NFC
Change-Id: I63a1b1ee244c2ab015914e1879aefc3ba8f886b0
2017-02-03 13:25:03 -08:00
Colin Cross 7b6f0b19f6 Update soong to use pathtools.FileSystem am: 294941bee9
am: 767ded0f60

Change-Id: I3a9d6cb35ca263449c2871bca174802ee1b50db4
2017-02-03 21:06:47 +00:00
Colin Cross 767ded0f60 Update soong to use pathtools.FileSystem
am: 294941bee9

Change-Id: Idde23b07f548bc45fa7eec353f4b190b033e1071
2017-02-03 21:04:18 +00:00
Colin Cross e281d3395b Fix zip tests
Fix error when building zip tests running go test ./...:
android/soong/third_party/zip/zip_test.go:13:2: use of internal package not allowed

Test: go test ./...
Change-Id: I4fd7317401fd3d9c95c6f11799c94c1eff25523e
2017-02-02 16:46:33 -08:00
Colin Cross faeb7aa135 Support data properties for test binaries
Allow tests to specify a data property that lists files or filegroup
modules that will be packaged alongside the test.  Also add a path
property to filegroup modules to allow shifting the path of the
packaged files, and add ExpandSourcesSubDir to expand the filegroup
sources while including a shifted relative path in the Paths objects.

Test: soong tests, manually adding data to a module
Change-Id: I52a48942660e12755d313ef13279313361b4fc35
2017-02-02 16:23:30 -08:00
Colin Cross 294941bee9 Update soong to use pathtools.FileSystem
Update soong to follow changes in
https://github.com/google/blueprint/pull/141

Test: soong tests
Change-Id: I49a9b83cac7590dc75b26b31136b8707c188bc4a
2017-02-02 16:19:56 -08:00
Nan Zhang daccf0477b Fixed then comments to describe how to use android.ModuleBase object. am: b9eeb1d79a
am: 2bc313cf61

Change-Id: Ib0cbe9d8d8c3fc0802dc0ba78a0b4c80d52b4215
2017-02-02 21:47:24 +00:00
Nan Zhang 2bc313cf61 Fixed then comments to describe how to use android.ModuleBase object.
am: b9eeb1d79a

Change-Id: I488d083560f2f5ff0eb8c647ca5ed8a38d0a7233
2017-02-02 21:44:54 +00:00
Nan Zhang b9eeb1d79a Fixed then comments to describe how to use android.ModuleBase object.
Since we have changed the package name from 'common' to 'android'

Test: Manual.
Change-Id: Ic9649f3216609b36fa31db096509de42f83e9ba4
2017-02-02 10:59:16 -08:00
Colin Cross da9d8a5aac Remove extra basePath from ModuleSrcPath am: 7fc17dbfce
am: 0c1dc130bc

Change-Id: Ic3d448af55d6f382d84d626268272c9b3ba4eddf
2017-02-02 04:53:45 +00:00
Colin Cross 0c1dc130bc Remove extra basePath from ModuleSrcPath
am: 7fc17dbfce

Change-Id: I3e1258afd93b6f3a2992cd05ede9212b978ea192
2017-02-02 04:51:15 +00:00
Colin Cross 7fc17dbfce Remove extra basePath from ModuleSrcPath
ModuleSrcPath contains an embedded basePath as well as a
SoucePath that contains another basePath.  Remove the embedded
basePath, and make the SourcePath embedded.

Test: no change to build.ninja
Change-Id: I3cdf3477eca41ed35fac08a892aab22cbcdb2224
2017-02-01 15:14:31 -08:00
Stephen Hines e410bf1e4d Merge "Switch to clang-3688880." am: e25bc9ba83
am: 09668fc4a3

Change-Id: Id80fac9db0316f340686d5b31075fe4c75e08b8a
2017-02-01 21:32:23 +00:00
Stephen Hines 09668fc4a3 Merge "Switch to clang-3688880."
am: e25bc9ba83

Change-Id: Ib05ef16e98c38947b02db38ff27df1181d86319b
2017-02-01 21:30:07 +00:00
Stephen Hines e25bc9ba83 Merge "Switch to clang-3688880." 2017-02-01 21:25:03 +00:00
Stephen Hines d19f58a162 Switch to clang-3688880.
Bug: http://b/31532493
Test: Manual validation.
Change-Id: I386c7fc06bd4ca092535365bccbed0a898eb69da
2017-01-31 12:13:37 -08:00
Colin Cross 649d6f30cd Allow clang builds to disable -pie am: 7a108bccad
am: 5a96f180b2

Change-Id: I14ac99c6493a95a86f08912f8aabf428a7e78072
2017-01-31 17:46:01 +00:00
Colin Cross 5a96f180b2 Allow clang builds to disable -pie
am: 7a108bccad

Change-Id: I6c478610a71536b238dba05a4ead6d7c4af50a91
2017-01-31 17:44:02 +00:00
Colin Cross 7a108bccad Allow clang builds to disable -pie
-pie triggers a bug in glibc's linker when used with goma
(https://sourceware.org/bugzilla/show_bug.cgi?id=16381).  Allow
the clang build to disable -pie for host modules through the
DISABLE_HOST_PIE environment variable so it can produce a toolchain
that works with goma.

Bug: 15814177
Bug: 34722791
Change-Id: Ic664a1b821aaeaf2bde14b0afa1a1975e31300cb
2017-01-30 22:51:59 -08:00
Nan Zhang 95e16a6b6f Merge "Fixed androidmk crash when parsing external/aac/Android.mk" am: 5951d3e2bb
am: 67d5fc5e49

Change-Id: I2fe464be21ad6b5e75d383411a24ba9aa7450e66
2017-01-28 00:10:18 +00:00
Nan Zhang 67d5fc5e49 Merge "Fixed androidmk crash when parsing external/aac/Android.mk"
am: 5951d3e2bb

Change-Id: I3a76b846fc3a88993ee6b8200124326be41ac584
2017-01-28 00:07:48 +00:00
Treehugger Robot 5951d3e2bb Merge "Fixed androidmk crash when parsing external/aac/Android.mk" 2017-01-28 00:05:07 +00:00
Dan Albert 50cc75da63 Don't force libraries upon static executables. am: dc2597d25a
am: 48e5befbdc

Change-Id: I2c4c7644ea43b06753f9c62e741e2c88dea07df2
2017-01-27 23:05:14 +00:00
Dan Albert 48e5befbdc Don't force libraries upon static executables.
am: dc2597d25a

Change-Id: If74fae103ddcd5e4add17da6dd20ad22bf06279f
2017-01-27 23:01:14 +00:00
Nan Zhang 62ea583316 Fixed androidmk crash when parsing external/aac/Android.mk
Catched the error when bpparser encountered the non-standard make variables.

Bug: b/34454142
Test: Manual + (m -j blueprint_tools) command
Change-Id: I0766082baa2c2c4020317f975012a476133f4f77
2017-01-27 14:07:38 -08:00
Dan Albert dc2597d25a Don't force libraries upon static executables.
The linker uses libc++_static but needs to avoid the libc.a
dependency. It does this by setting `stl: "none"` and manually
linking libc++. This behavior matches make.

A better approach would probably be to generalize system_shared_libs
to system_libs and apply those to static executables the same way we
do for dynamic ones, but that's a patch for another day.

Test: make checkbuild
Bug: http://b/34740564
Change-Id: Ie9da0d49a453a220593e8ec2ee721e9af9378007
2017-01-26 17:44:26 -08:00
David Benjamin 8215a5673c Merge "Add libc++ and libc++_static aliases for SDK builds." am: 29c69e83dd
am: 4c51fe50e8

Change-Id: Ia5510a3a3be17eb6969b31b46706e0ea3fab0555
2017-01-26 21:38:21 +00:00
David Benjamin 4c51fe50e8 Merge "Add libc++ and libc++_static aliases for SDK builds."
am: 29c69e83dd

Change-Id: Icd8f61640a7ce5fd25ee06330ca1244af93f1a56
2017-01-26 21:34:21 +00:00
Treehugger Robot 29c69e83dd Merge "Add libc++ and libc++_static aliases for SDK builds." 2017-01-26 21:28:11 +00:00