Commit graph

6796 commits

Author SHA1 Message Date
Colin Cross
2077c15150 Report errors when opening config files am: 15cd21a492
am: aa14355b6a

Change-Id: If8c21d072d2eafb12233b82b824f854715caf462
2018-02-27 22:26:02 +00:00
Colin Cross
aa14355b6a Report errors when opening config files
am: 15cd21a492

Change-Id: I3625ab981fae0c9d647c5a1c37d67e7807c68264
2018-02-27 22:21:00 +00:00
Colin Cross
15cd21a492 Report errors when opening config files
The error handling when opening config files was ignoring all errors
except ENOEXIST.  Report other errors, instead of passing nil to
json.NewDecoder and getting:
config file: out/soong/soong.config did not parse correctly: invalid argument

Bug: 73951413
Test: touch out/soong/soong.config && chmod a-r out/soong/soong.config && m
Test: rm out/soong/soong.config && m
Change-Id: I4a609b7f060b760b76ee829b83c0eb405340f58f
2018-02-27 19:30:40 +00:00
Colin Cross
c4a18e0291 Sort macho symbol table entries
macho symbol table entries are not always in order, which breaks
finding the next symbol to find the size of the target symbol.

Test: build_version_test
Change-Id: I41d1c3c3ff9929694e9ec2b034553d6b7ddef937
2018-02-23 22:45:55 -08:00
Colin Cross
64c6d4bf14 Fix symbol_inject on win32 exes
Win32 exes seem to prefix each symbol with an underscore like
macho.

Test: build_version_test
Change-Id: I9de0a0f5f25f93ad17d34b7c1b993511c77a57eb
2018-02-23 18:24:48 -08:00
Colin Cross
761955541f Merge changes I84868c92,If1690a70,Ia9aeb2ff am: d2092dbc0d am: 113265ec4c
am: a544914e5f

Change-Id: I5ffddc29b0006e763fef2cb2c4c315306a8a36d1
2018-02-24 01:08:43 +00:00
Colin Cross
a544914e5f Merge changes I84868c92,If1690a70,Ia9aeb2ff am: d2092dbc0d
am: 113265ec4c

Change-Id: Ibe5499bd0ce393703bbf51d9227ac3ad57db4a7f
2018-02-24 01:02:49 +00:00
Colin Cross
113265ec4c Merge changes I84868c92,If1690a70,Ia9aeb2ff
am: d2092dbc0d

Change-Id: Ib6f5ac0c1a6c6d30f692ccbef52d78318820f540
2018-02-24 00:56:32 +00:00
Colin Cross
d2092dbc0d Merge changes I84868c92,If1690a70,Ia9aeb2ff
* changes:
  Use PathForSource instead of PathsForSource
  Move AllowMissingDependencies check from PathsForSource to PathForSource
  Pass nil instead of []string{} to ctx.Glob* functions
2018-02-24 00:39:56 +00:00
Dan Willemsen
6c3ba6c46c Merge "Add proto.canonical_path_from_root" am: 7c695eb797 am: c530837d4c
am: fb408c8e6d

Change-Id: I6bfe260cc2c8d67f73bdbb1eb70ee1df6bf33de4
2018-02-23 21:00:53 +00:00
Dan Willemsen
fb408c8e6d Merge "Add proto.canonical_path_from_root" am: 7c695eb797
am: c530837d4c

Change-Id: I0b3d042cf8cbb997274ad612b56b750eae0b86d5
2018-02-23 20:55:21 +00:00
Dan Willemsen
c530837d4c Merge "Add proto.canonical_path_from_root"
am: 7c695eb797

Change-Id: I072c8db0a9b8d4f351adc21d5eaf59b1e02f3f28
2018-02-23 20:49:18 +00:00
Dan Willemsen
7c695eb797 Merge "Add proto.canonical_path_from_root" 2018-02-23 20:38:10 +00:00
Colin Cross
480cd76672 Use PathForSource instead of PathsForSource
This reapplies If1690a708393964d3030cb908beaf7b6897c0084.

PathForSource does the AllowMissingDependencies check now, use it
instead of PathsForSource.

Test: m checkbuild
Change-Id: I84868c92ee43779f9b5c8b285dac92f5f87b018c
2018-02-23 11:31:45 -08:00
Colin Cross
192e97a95c Move AllowMissingDependencies check from PathsForSource to PathForSource
This reapplies Id7925999a27ea75a05e9301bbf1eb9f9a6bc4652 with
additional fixes to not use PathForSource in PathForModuleSrc.

PathsForSource was handling the AllowMissingDependencies case, but
PathForSource was not.  Refactor PathForSource and
ExistentPathForSource, and add logic to PathForSource to fall back
to behavior similar to ExistentPathForSource when
AllowMissingDependencies is set.

PathForModuleSrc uses PathForSource, which causes too many
globs (>50k).  The AllowMissingDependencies check doesn't make
much sense for PathForModuleSrc, since we already know the
project containing the definition of the module exists, we can
expect its local source files to exist.  Use pathForSource and
do an manual existence check instead.

Test: paths_test.go
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: If1690a708393964d3030cb908beaf7b6897c0084
2018-02-23 11:31:45 -08:00
Colin Cross
461b445d62 Pass nil instead of []string{} to ctx.Glob* functions
[]string{} is unnecessary, just use nil.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Ia9aeb2ffc483429787da0e473a7f1bc87eb4cad1
2018-02-23 11:31:45 -08:00
Colin Cross
77b3dc4172 Merge "Revert "Use PathForSource instead of PathsForSource"" am: 0c18d451d2 am: be6724dd30
am: dd5d40eb37

Change-Id: I0cabaeee1add960ea94ba2b06985655dcfe9efe8
2018-02-23 07:52:06 +00:00
Colin Cross
dd5d40eb37 Merge "Revert "Use PathForSource instead of PathsForSource"" am: 0c18d451d2
am: be6724dd30

Change-Id: I3713d1fa4a5e0121e6de2e6c87c3c170cd8a9276
2018-02-23 07:46:23 +00:00
Colin Cross
be6724dd30 Merge "Revert "Use PathForSource instead of PathsForSource""
am: 0c18d451d2

Change-Id: Iaad079afd21e00dd92bb7cefc177bfed198c125e
2018-02-23 07:39:52 +00:00
Colin Cross
0c18d451d2 Merge "Revert "Use PathForSource instead of PathsForSource"" 2018-02-23 07:32:19 +00:00
Colin Cross
0071b0d8bd Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource" am: c48c14369c am: 6fe8d17dd2
am: d543f37598

Change-Id: Id00030c0a6253237777b6ccf69bcb6ee63550668
2018-02-23 07:28:49 +00:00
Colin Cross
d543f37598 Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource" am: c48c14369c
am: 6fe8d17dd2

Change-Id: I5daa9f0d88314ab10bda27f2aa3e89dd3da6276e
2018-02-23 07:23:16 +00:00
Colin Cross
6fe8d17dd2 Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource"
am: c48c14369c

Change-Id: Ib0a5754a9958a8876573a744f28bb93276831e91
2018-02-23 07:18:44 +00:00
Colin Cross
c48c14369c Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource"
This reverts commit 94a321045a.

Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true

Change-Id: I9604887f796a79809ef8d6c741597796219dcaf3
2018-02-23 07:09:15 +00:00
Colin Cross
5a49e1c65e Revert "Use PathForSource instead of PathsForSource"
This reverts commit 9d37831dd3.

Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true

Change-Id: Ibff79642f747b83364c83d6b298334121028e02d
2018-02-23 07:08:43 +00:00
Colin Cross
10c7d51f6d Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503 am: 1b5599e462 am: b3407069ee
am: 945aebf48e

Change-Id: Ie14264d306d957f92beca7070867d947773692b1
2018-02-23 02:44:01 +00:00
Colin Cross
945aebf48e Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503 am: 1b5599e462
am: b3407069ee

Change-Id: Ib0f7f8e93842cea36b915c1e10929f96249c20e3
2018-02-23 02:38:58 +00:00
Colin Cross
b3407069ee Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503
am: 1b5599e462

Change-Id: If6ed7347189045341276d527b1fd555400203899
2018-02-23 02:34:06 +00:00
Treehugger Robot
1b5599e462 Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503
* changes:
  Use PathForSource instead of PathsForSource
  Move AllowMissingDependencies check from PathsForSource to PathForSource
  Propagate errors out of validatePath
  Add t.Run and t.Helper to paths_test.go
  Remove unused intermediates parameter from ExistentPathForSource
2018-02-23 02:28:35 +00:00
Dan Willemsen
ab9f4268c0 Add proto.canonical_path_from_root
Historically, we've always passed '-I .' as the first argument to
protoc, essentially treating all proto file package names as their full
path in the android source tree. This would make sense in a monorepo
world, but it makes less sense when we're pulling in external projects
with established package names.

So keep the same default (for now), but allow individual builds to opt
into using local paths as the default names with
'canonical_path_from_root: false'. A cleanup effort and/or large scale
change in the future could change the default to false.

As part of this, run protoc once per input proto file, since the flags
may need to change per-file. We'll also need this in order to specify
--dependency_out in the future.

Bug: 70704330
Test: aosp/master build-aosp_arm.ninja is identical
Test: aosp/master soong/build.ninja has expected changes
Test: m
Test: Build protobuf test
Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce
2018-02-22 16:48:35 -08:00
Colin Cross
88c6509e99 Fix java_import and android_library_import conversions am: 336ad7a667 am: b4b91fa725
am: 230c992943

Change-Id: I5ba782b236dca03401a83ecd925e1b04c9214a3f
2018-02-22 23:36:39 +00:00
Colin Cross
d671f5216b Don't pretend *parser.List is immutable am: 3fad895e75 am: 0ae9d91508
am: f1a271a4d0

Change-Id: I797b9e78621fe2240ce2fd7c6c805c0199df9b68
2018-02-22 23:36:34 +00:00
Colin Cross
ddaecb786b Soong AAR prebuilt support am: fabb608b27 am: cb7137994f
am: dc425fe743

Change-Id: Icecd172a1bae483d0aad04f68dba30832a4b2dd3
2018-02-22 23:36:27 +00:00
Colin Cross
a833f3c1cc Add aapt includes for prebuilt SDK jars am: 9ca6942956 am: 022c52e269
am: 380c9a1f87

Change-Id: I1c5c4b13ffe7390953c9763e3090639b5eedd154
2018-02-22 23:36:22 +00:00
Colin Cross
230c992943 Fix java_import and android_library_import conversions am: 336ad7a667
am: b4b91fa725

Change-Id: Ideeda0de950d7f153558b8691abacff8aa76c329
2018-02-22 23:32:44 +00:00
Colin Cross
f1a271a4d0 Don't pretend *parser.List is immutable am: 3fad895e75
am: 0ae9d91508

Change-Id: I2dbdf6343e9d58df94e5133744811ca8b7e24d33
2018-02-22 23:32:36 +00:00
Colin Cross
dc425fe743 Soong AAR prebuilt support am: fabb608b27
am: cb7137994f

Change-Id: I90f4d95a810685c3622ee3e5d38f59bc91fe6da6
2018-02-22 23:32:32 +00:00
Colin Cross
380c9a1f87 Add aapt includes for prebuilt SDK jars am: 9ca6942956
am: 022c52e269

Change-Id: I8fdda06cba16df50fd217a9fcdbea936f95b1edc
2018-02-22 23:32:23 +00:00
Colin Cross
b4b91fa725 Fix java_import and android_library_import conversions
am: 336ad7a667

Change-Id: Ib4963012cee1f839ef141e61676d60365cb674c1
2018-02-22 23:28:41 +00:00
Colin Cross
0ae9d91508 Don't pretend *parser.List is immutable
am: 3fad895e75

Change-Id: I342ed780933174e1126980c9f658891c0c73dd80
2018-02-22 23:28:36 +00:00
Colin Cross
cb7137994f Soong AAR prebuilt support
am: fabb608b27

Change-Id: I38ce0673ecbd0b81e29f433480dcbd2e295b9eea
2018-02-22 23:28:29 +00:00
Colin Cross
022c52e269 Add aapt includes for prebuilt SDK jars
am: 9ca6942956

Change-Id: Ic940e06a20e8d299f147e53531f78fbc5af593dc
2018-02-22 23:28:23 +00:00
Dan Willemsen
7df0d3585d Merge "Only depend on a single file for generated headers" am: 2f2f24f775 am: 463a23efc3
am: 73e1814213

Change-Id: I290199404c22d50f8af4075455dd3ded698da888
2018-02-22 23:27:42 +00:00
Nan Zhang
bfef411697 Droiddoc Support in Soong am: 581fd21e91 am: 2ea76706b3
am: a400bb400c

Change-Id: I5c317052e5b1cba68e04720db75cb07cdd7ca0f7
2018-02-22 23:25:14 +00:00
Dan Willemsen
73e1814213 Merge "Only depend on a single file for generated headers" am: 2f2f24f775
am: 463a23efc3

Change-Id: I21780fcd1966c8174e7067d2ace53f06036742fa
2018-02-22 23:13:30 +00:00
Nan Zhang
a400bb400c Droiddoc Support in Soong am: 581fd21e91
am: 2ea76706b3

Change-Id: I240c145395bd018f75398502390650e3f475dc2e
2018-02-22 23:11:15 +00:00
Dan Willemsen
463a23efc3 Merge "Only depend on a single file for generated headers"
am: 2f2f24f775

Change-Id: Iedf323be7d0feb84bd0c38c1a3e1f26fc33e8329
2018-02-22 23:00:43 +00:00
Nan Zhang
2ea76706b3 Droiddoc Support in Soong
am: 581fd21e91

Change-Id: I3da14242bfb501afc14e1ebc07a9393be2558001
2018-02-22 22:58:56 +00:00
Colin Cross
336ad7a667 Fix java_import and android_library_import conversions
java_import and android_library_import modules can't be handled
directly in androidmk because the results may depend on properties
that haven't been parsed yet.  Add a bpfix pass (which is
automatically included at the end of androidmk) to select
android_library_import vs. java_import based on the extension
of the prebuilt file, and convert the srcs property to jars or aars
as appropriate.

Bug: 73724997
Test: androidmk_test.go
Change-Id: I1024742e9e96d5e1e88c3cc139eeb0d5a2f6849b
2018-02-22 14:54:47 -08:00
Colin Cross
3fad895e75 Don't pretend *parser.List is immutable
The functions in bpfix that take a *parser.List and return a
modified *parser.List are always returning the same pointer
and mutating the target of the pointer.  Remove the extra
unnecessary return value.

Also extract the getLiteralListProperty function.

Test: androidmk_test.go
Change-Id: I08d8aff955c72b7916741cda8083974a49af4d6f
2018-02-22 14:54:47 -08:00