Commit graph

1430 commits

Author SHA1 Message Date
Colin Cross
6898d26054 Add isStruct and isStructPtr helpers
Test: proptools tests
Change-Id: I7814b2138cd19b538a3a33036a15119e118d7644
2020-01-28 09:51:19 -08:00
asmundak
30f225ba8a
Merge pull request #280 from asmundak/master
Fix null pointer dereference printing an expression.
2020-01-27 10:17:26 -08:00
Automerger Merge Worker
86b631cee4 Merge remote-tracking branch 'aosp/upstream' into master am: a70b3381cb am: 2e9dbb516b am: 352eca5484
Change-Id: I778ad0df7f5b3b0c76e980407c671f331c6d5aff
2020-01-23 22:10:02 +00:00
Automerger Merge Worker
352eca5484 Merge remote-tracking branch 'aosp/upstream' into master am: a70b3381cb am: 2e9dbb516b
Change-Id: Ia58cb2ffb54a013c55eb467e321e5e933e72b0a0
2020-01-23 21:57:37 +00:00
Automerger Merge Worker
2e9dbb516b Merge remote-tracking branch 'aosp/upstream' into master am: a70b3381cb
Change-Id: Id96124baa24e4112b262fe2b9482c82450240a06
2020-01-23 21:46:24 +00:00
Sasha Smundak
77418b70b4 Fix null pointer dereference printing an expression.
Parser.parseVariable method should always set the value of the variable
it creates. Failure to do so may end up in the following:

```
$ androidmk  <(printf "FOO:=(X)\nFOO:=bar\n")
parse error:
<input>:3:1: variable already set, previous assignment: FOO@<input>:1:5 = %!s(PANIC=String method: runtime error: invalid memory address or nil pointer dereference) (%!s(PANIC=String method: runtime error: invalid memory address or nil pointer dereference)) false
```

The cause is that calling Parser.Parse to parse `FOO=abc` created
a Variable instance with nil value, causing panic on print attempt.

Test: m androidmk && androidmk  <(printf "FOO:=(X)\nFOO:=bar\n")
(should print:
ERROR:  parse error:
<input>:3:1: variable already set, previous assignment: FOO@<input>:1:5 = X = Not Evaluated (X = Not Evaluated) false)

Change-Id: I296d7984df6d8796e0075f9eb692b234f8c94f08
2020-01-23 13:32:43 -08:00
Colin Cross
a70b3381cb Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Remove blueprint:"filter(*)" tag support
  Make FilterPropertyStructSharded smarter

Bug: 146234651
Test: m checkbuild
Change-Id: Ib3de8d8dd43e6354c17f1734705a9feb2ca7f701
2020-01-22 18:09:56 +00:00
colincross
0c4d1db0a0
Merge pull request #278 from colincross/filtershard
Make FilterPropertyStructSharded smarter
2020-01-21 12:12:08 -08:00
Colin Cross
571f77a60d Remove blueprint:"filter(*)" tag support
The filter tag is unused, replaced with FilterPropertyStruct to
generate a new type at runtime that only contains the filtered
fields.

Test: unpack_test.go
Change-Id: Id91cf99290832094d05426f3263279836f0fea73
2020-01-21 11:49:27 -08:00
Colin Cross
b89d91c67c Make FilterPropertyStructSharded smarter
FilterPropertyStructSharded was just sharding the top level
properties into groups of 10.  For nested property structs
this can be insufficient - there could be a single top level
property with many properties below it.

Take a maximum name size, and track the size used by parent
structs to determine when sharding a nested struct is necessary.

Bug: 146234651
Test: filter_test.go
Change-Id: I5b5ed11ea27a0325b2fd6c2c3fb427ea1e2af0c2
2020-01-21 11:49:27 -08:00
Automerger Merge Worker
4be0581f7f Merge "Add mappings for Go extractor." am: 450c4f565a am: 6c9bd9ab34 am: 21c577f719
Change-Id: I26fd3940385e8c3e05a104523fc108e66f592500
2020-01-17 08:40:07 +00:00
Automerger Merge Worker
21c577f719 Merge "Add mappings for Go extractor." am: 450c4f565a am: 6c9bd9ab34
Change-Id: I861a8524a619b0fc9f09dc79b0bf04fb7cca5dd7
2020-01-17 08:26:26 +00:00
Automerger Merge Worker
6c9bd9ab34 Merge "Add mappings for Go extractor." am: 450c4f565a
Change-Id: I33befabb4d828c9b2a530c0b0e60fde53bc019aa
2020-01-17 08:08:26 +00:00
Treehugger Robot
450c4f565a Merge "Add mappings for Go extractor." 2020-01-17 07:58:43 +00:00
Automerger Merge Worker
52bc20d83b Merge remote-tracking branch 'aosp/upstream' into master am: 76a390c22e am: 8623fab804 am: 8a2693ba80
Change-Id: Iaa35e3e2a7824a14ed1b3ba5465be73dee0dc67b
2020-01-16 21:58:17 +00:00
Automerger Merge Worker
8a2693ba80 Merge remote-tracking branch 'aosp/upstream' into master am: 76a390c22e am: 8623fab804
Change-Id: I1db66cabf1055ba915cb6eb20161cbf9a0347dc0
2020-01-16 21:43:35 +00:00
Colin Cross
8623fab804 Merge remote-tracking branch 'aosp/upstream' into master
am: 76a390c22e

Change-Id: Ibf73b384760e3f5fdb729be7e86032a9fabdca27
2020-01-16 13:32:43 -08:00
Colin Cross
76a390c22e Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Fix missing glob filelists when sandboxed
  Fix primary builder reruns caused by globs
  Add EarlyModuleContext.BlueprintsFile

Test: m checkbuild
Change-Id: I239f16f6f9fe9ba0e83da28bdc4f32d8ee807351
2020-01-16 11:14:58 -08:00
colincross
6ea3f9ddd2
Merge pull request #277 from colincross/glob_incremental
Speed up incremental builds after globs
2020-01-16 11:01:00 -08:00
Colin Cross
67d0cbed90 Fix missing glob filelists when sandboxed
Sandboxing the primary builder caused the glob filelists to not
be written because they were using a relative path, causing
primary builder reruns on the second build.

Also report errors when writing the filelist files.

Test: m checkbuild
Change-Id: Id1706560d04c85f00f829cfb714967bb8600626f
2020-01-16 10:57:08 -08:00
Colin Cross
1cda3fd3e4 Fix primary builder reruns caused by globs
Globs produce a filelist using restat rules to avoid primary builder
reruns.  On the first execution of the primary builder the filelists
are written directly by the primary builder, so that the second
execution can restat them all but avoid rerunning the primary builder.
This wasn't working because the glob filelists were written after
the build.ninja file, but the build.ninja file depends on the
filelists.  Switching the order avoids the extra rerun.

Test: m nothing && m nothing
Change-Id: Ia8e0924598220d4ff34235907a8de2e3e03632df
2020-01-16 10:38:46 -08:00
Sasha Smundak
d7a5f952f2 Add mappings for Go extractor.
Bug: 137798757
Test: manual
Change-Id: I48905714d5fb4c4051c2ef3c77d8ff03d9935480
2020-01-14 17:02:29 -08:00
colincross
b92b466a46
Merge pull request #276 from colincross/blueprintsfile
Add EarlyModuleContext.BlueprintsFile
2020-01-14 14:14:41 -08:00
Colin Cross
c03a50c49c Add EarlyModuleContext.BlueprintsFile
EarlyModuleContext already has ModuleDir, add BlueprintsFile too.

Test: m checkbuild
Change-Id: Ia9e0c724562e1461dfcd5e01f56ff8abbea2ac06
2020-01-14 13:00:01 -08:00
Automerger Merge Worker
1cb6f844c5 Merge remote-tracking branch 'aosp/upstream' into master am: de71320aa6 am: 1b5f9af317 am: ca01e7e98f
Change-Id: Idb952836d4e88257d1e09ea5f1cacfd6eae58bd4
2020-01-11 07:34:02 +00:00
Automerger Merge Worker
ca01e7e98f Merge remote-tracking branch 'aosp/upstream' into master am: de71320aa6 am: 1b5f9af317
Change-Id: I70c865fb198e30cd381b0b14c4fa2785d7908d7b
2020-01-11 07:17:14 +00:00
Colin Cross
1b5f9af317 Merge remote-tracking branch 'aosp/upstream' into master
am: de71320aa6

Change-Id: I3358f3d9f28e37922a1699d02ddd1f7b4722aed0
2020-01-10 23:00:52 -08:00
Colin Cross
de71320aa6 Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Fix reading absolute paths through OsFs

Bug: 146437378
Test: m checkbuild
Change-Id: Iabee4c296902a227def128b6285118de50917885
2020-01-10 17:09:30 -08:00
colincross
b6ebce2c23
Merge pull request #275 from colincross/sandbox_primary_builder
Fix reading absolute paths through OsFs
2020-01-10 14:16:28 -08:00
Colin Cross
2f95ec7031 Fix reading absolute paths through OsFs
OsFs may be asked to read absolute paths if buildDir is absolute.
Check if the path is absolute before prepending srcDir to it.

Bug: 146437378
Test: fs_test.go
Change-Id: I2a67593e9d836ca3e11dc10b81f49a4fb49d2cdf
2020-01-10 13:52:22 -08:00
Colin Cross
a02b6b638f Merge remote-tracking branch 'aosp/upstream' into master am: 40e4d10377 am: a722dcff9a
am: cd0c3da180

Change-Id: I60cdc44f388a70cee032e888b263f3fda09ac199
2020-01-10 11:13:47 -08:00
Automerger Merge Worker
cd0c3da180 Merge remote-tracking branch 'aosp/upstream' into master am: 40e4d10377 am: a722dcff9a
Change-Id: Ia893371a10874dc53fc1e624370746a8b030e7d7
2020-01-10 17:52:44 +00:00
Colin Cross
a722dcff9a Merge remote-tracking branch 'aosp/upstream' into master
am: 40e4d10377

Change-Id: I0c0849f3f7a9de20def3dccd401b17191f422807
2020-01-10 09:37:47 -08:00
Colin Cross
40e4d10377 Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Allow primary builder to change working directory

Bug: 146437378
Test: m checkbuild
Change-Id: I95c476539cd2a74500b3f94baf048306ad5d9eca
2020-01-09 14:25:08 -08:00
colincross
5e8efd5f08
Merge pull request #274 from colincross/sandbox_primary_builder
Allow primary builder to change working directory
2020-01-09 12:56:10 -08:00
Colin Cross
c5fa50e057 Allow primary builder to change working directory
Bug: 146437378
Test: pathtools/fs_test.go
Change-Id: I513ceb9b8b0b4f18223bc34ecad9846fe220709b
2020-01-08 15:54:58 -08:00
Automerger Merge Worker
af62d35849 Merge remote-tracking branch 'aosp/upstream' into master am: 86286b9ac9 am: 2ad0aebc37 am: e356e519fd
Change-Id: I0f610e86b5e5fea6e655f27e0c7adee90b272764
2020-01-06 23:23:36 +00:00
Automerger Merge Worker
e356e519fd Merge remote-tracking branch 'aosp/upstream' into master am: 86286b9ac9 am: 2ad0aebc37
Change-Id: If811a4aff87b0be85e0519925bfb7938024c22c0
2020-01-06 23:03:12 +00:00
Colin Cross
2ad0aebc37 Merge remote-tracking branch 'aosp/upstream' into master
am: 86286b9ac9

Change-Id: I7de707e2e39e3159e37da789ba65fb7d5f78e45a
2020-01-06 14:48:45 -08:00
Colin Cross
86286b9ac9 Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Move unpackProperties to proptools and export it
  Add scoped module factories
  Move LoadHooks from Soong to Blueprint

Test: m checkbuild
Change-Id: I25ac946cdbe6c4faca167413c347f3de4be58024
2020-01-06 12:59:56 -08:00
colincross
55ca1c0860
Merge pull request #273 from colincross/scoped_module_factories
Scoped module factories
2020-01-06 12:53:54 -08:00
Colin Cross
f27c5e470b Move unpackProperties to proptools and export it
Test: unpack_test.go
Change-Id: I145369323bd7d5003a261c13dfb8ed31d0be51b5
2020-01-02 20:32:51 -08:00
Colin Cross
9672d86a87 Add scoped module factories
Add RegisterScopedModuleType to LoadHookContext that registers
a module type factory that will be visible for the remainder of
the file.  Also add ModuleFactories that returns the globally
register module factories.

Test: all blueprint tests
Change-Id: If646a73befe3b8e45c4b0984531c6a39ddc8d066
2020-01-02 20:32:51 -08:00
Colin Cross
da70fd0b84 Move LoadHooks from Soong to Blueprint
Move LoadHooks from Blueprint and run them during ParseBlueprintsFiles.
This will allow them to add scoped module types that are visible to the
rest of the Blueprints file.  Requires passing the config object to
ParseBlueprintsFiles.

Test: all blueprint tests
Change-Id: Ia2a2c9a0223d5458bfd48bd22ebed0fdbd0156c6
2020-01-02 20:32:51 -08:00
Automerger Merge Worker
fc94ba447b Merge remote-tracking branch 'aosp/upstream' into master am: 88e39c0c1c am: cfcbd29e86 am: 12612a4222
Change-Id: Ibfa0c30bf77d7b61020e2af684b77c5f99a13862
2019-12-18 20:18:27 +00:00
Automerger Merge Worker
12612a4222 Merge remote-tracking branch 'aosp/upstream' into master am: 88e39c0c1c am: cfcbd29e86
Change-Id: I9c3a79ef2d8cfdbdf4e8a97011a03cc1a0c6f628
2019-12-18 20:07:02 +00:00
Colin Cross
cfcbd29e86 Merge remote-tracking branch 'aosp/upstream' into master
am: 88e39c0c1c

Change-Id: Ib75816fe43d1aaaa9d71f817459e1d3cedf4b199
2019-12-18 11:50:01 -08:00
Colin Cross
88e39c0c1c Merge remote-tracking branch 'aosp/upstream' into master
* aosp/upstream:
  Add Context.SetFs

Bug: 146437378
Test: m checkbuild
Change-Id: I5d40d2467957b34fb8787b5d12b9b994d8627ad1
2019-12-17 15:55:16 -08:00
colincross
9999eddc46
Merge pull request #272 from colincross/sandbox_primary_builder
Add Context.SetFs
2019-12-17 14:42:15 -08:00
Colin Cross
8cde425b60 Add Context.SetFs
Allow the primary builder to set the filesystem directly.

Bug: 146437378
Test: m checkbuild
Change-Id: Ic8cc3e6a03943d5f47b041a66df6a11f4336c97b
2019-12-17 13:14:31 -08:00