diff options
author | Jiyong Park <jiyong@google.com> | 2024-03-22 23:33:48 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-03-22 23:33:48 +0000 |
commit | 74ff1f80bc380134f00b6ce5a38509a223c6f101 (patch) | |
tree | 715e556c6ef5a71d7a96f0ab1117468618fe499c | |
parent | 567b9d707b1ce13b1a100de4f3fe70f9650c3c02 (diff) | |
parent | 8fb0e9734c84a4c819963f2e7c532a3198e5df94 (diff) | |
download | soong-74ff1f80bc380134f00b6ce5a38509a223c6f101.tar.gz |
Merge "Ensure that genrule's host tool deps are for host" into main
-rw-r--r-- | genrule/genrule.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index cf2a96673..43f4fe5ee 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -317,7 +317,17 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) { // required relative locations of the tool and its dependencies, use those // instead. They will be copied to those relative locations in the sbox // sandbox. - packagedTools = append(packagedTools, specs...) + // Care must be taken since TransitivePackagingSpec may return device-side + // paths via the required property. Filter them out. + for i, ps := range specs { + if ps.Partition() != "" { + if i == 0 { + panic("first PackagingSpec is assumed to be the host-side tool") + } + continue + } + packagedTools = append(packagedTools, ps) + } // Assume that the first PackagingSpec of the module is the tool. addLocationLabel(tag.label, packagedToolLocation{specs[0]}) } else { |