Skip to content

Commit

Permalink
Support deps files with no output
Browse files Browse the repository at this point in the history
AIDL generates a deps file with no output listed temporarily pass it
through without error in the makedeps parser.

Bug: 141372861
Test: m checkbuild
Change-Id: I8c6740833dbc2ff3318dfc424ec497728cfc48d2
  • Loading branch information
colincross committed Oct 4, 2019
1 parent 332f35f commit 5274d58
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions makedeps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ func Parse(filename string, r io.Reader) (*Deps, error) {
return nil, fmt.Errorf("%sunsupported variable expansion: %v", pos(node), x.Target.Dump())
}
outputs := x.Target.Words()
if len(outputs) == 0 {
return nil, fmt.Errorf("%smissing output: %v", pos(node), x)
if len(outputs) > 0 {
ret.Output = outputs[0].Value(nil)
} else {
// TODO(b/141372861): put this back
//return nil, fmt.Errorf("%smissing output: %v", pos(node), x)
}
ret.Output = outputs[0].Value(nil)

if !x.Prerequisites.Const() {
return nil, fmt.Errorf("%sunsupported variable expansion: %v", pos(node), x.Prerequisites.Dump())
Expand Down
14 changes: 14 additions & 0 deletions makedeps/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ b: e`,
},
},
},
{
// TODO(b/141372861): remove this
// AIDL produces a dep file with no output file for a parcelable (b/
name: "AIDL parcelable",
input: ` : \
frameworks/base/tests/net/integration/src/com/android/server/net/integrationtests/HttpResponse.aidl
`,
output: Deps{
Output: "",
Inputs: []string{
"frameworks/base/tests/net/integration/src/com/android/server/net/integrationtests/HttpResponse.aidl",
},
},
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 5274d58

Please sign in to comment.