Commit Graph

2276 Commits

Author SHA1 Message Date
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
f5f307855f Merge "Fix zip tests" am: c821042c3f am: 63f6cabb1a
am: bd8bb38b49

Change-Id: Iced32f89cd1345352b963791888cc485cd08784f
2017-02-06 21:26:23 +00:00
Colin Cross
2230e6024c Merge "Support data properties for test binaries" am: 77de5a4b9d am: 9be3b4aebc
am: cf02fcb226

Change-Id: I053ec910adc436331b3340c5573fb7b517e5d56d
2017-02-06 21:26:13 +00: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
991584ee9a Merge "Add c_std and cpp_std properties." am: 721197de2c am: d02c9ff9d8
am: 72dcf8efd6

Change-Id: Ibb55e61301fe8674a4148566054b80d62948dc59
2017-02-06 19:27:37 +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
fa725d5904 Allow non-tool dependencies in genrules am: d1b8d760b5 am: 7564cecad8
am: afcd623aa7

Change-Id: Ib68a5807bc9957eff1be0db30bab7874864d8b5e
2017-02-04 23:46:18 +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
43d7014037 Disable CFI on Mips and add -march to linkflags on ARM. am: a83fdacf7c am: 5fcdf1374f
am: d9ebc339af

Change-Id: I28731886d1f49ed6b393ef7dc183d8b610b61810
2017-02-04 00:23:18 +00: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
3e8e833181 Remove duplicate code. am: cb3f890263 am: c527b4f1a8
am: a24fc37524

Change-Id: I901ddba89c6b5571eeb20c7eefd373810c9f162f
2017-02-03 23:33:25 +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
50da8079cd Update soong to use pathtools.FileSystem am: 294941bee9 am: 767ded0f60
am: 7b6f0b19f6

Change-Id: I25bfec471366b7a67d2206b3d88f15c8b699a8da
2017-02-03 21:08:48 +00: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
14ed7a235b Fixed then comments to describe how to use android.ModuleBase object. am: b9eeb1d79a am: 2bc313cf61
am: daccf0477b

Change-Id: I52d9906993d710c48bc2f62f5de667222ddbff00
2017-02-02 21:49:25 +00: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
a103352c12 Remove extra basePath from ModuleSrcPath am: 7fc17dbfce am: 0c1dc130bc
am: da9d8a5aac

Change-Id: I069f925f7a78080b0008359fb6449a14fcef03b0
2017-02-02 04:55:46 +00: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
d0473e6fc7 Merge "Switch to clang-3688880." am: e25bc9ba83 am: 09668fc4a3
am: e410bf1e4d

Change-Id: I965444ddf0f36336c0581627ed186850f6f5c40c
2017-02-01 21:34:55 +00: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
aba8c15d57 Allow clang builds to disable -pie am: 7a108bccad am: 5a96f180b2
am: 649d6f30cd

Change-Id: I8e834f3936833eabbb0966675e88fb82292f9d42
2017-01-31 17:48:32 +00: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