New issue
Advanced search Search tips

Issue 898779 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 29
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Build system for perfetto's unittests will trigger gn check errors when inside chromium

Project Member Reported by brat...@opera.com, Oct 25

Issue description

gn check will verify that dependencies are correctly described and not violated. For perfetto the dependency from unit tests to gtest seems wrong. (primiano said: "I think we need to tweak the part behind build_with_chromium")

To reproduce
-------------
(note that third_party/perfetto is not in .gn's check_targets list so not checked by default)
1. gn out/Default "//third_party/perfetto/*"

Expected
-----------
No errors

Actually
----------
About 10 of the error below:

ERROR at //third_party/perfetto/src/base/string_utils_unittest.cc:19:11: Can't include this header from here.
#include "gmock/gmock.h"
 ^------------
The target:
 //third_party/perfetto/src/base:unittests
is including a file from the target:
 //third_party/googletest:gmock

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
 //third_party/perfetto/src/base:unittests -->
 //third_party/perfetto/gn:gtest_deps -->
 //testing/gmock:gmock --[private]-->
 //third_party/googletest:gmock
 
Status: Started (was: Assigned)
Working on this in https://android-review.googlesource.com/c/platform/external/perfetto/+/801494
Looks more complicated than i expected. Maybe gtest.h can be hidden behind a local gtest.h that hides all the logic?

Status: Verified (was: Started)
Fixed and verified on TOT.

Sign in to add a comment