GN friend declarations don't work for Android tests in Chromium |
|
Issue descriptionWe ran into this trying to get gn check working for //third_party/boringssl. Patchset 3 of https://chromium-review.googlesource.com/c/chromium/src/+/1014028/3 should have a repro. The problem appears to be that the test template on Android places the sources under a separate internal target, so the friend declaration does not match. https://cs.chromium.org/chromium/src/testing/test.gni?rcl=1f4382b7fc13da2ec7563f7cd5556802d8794355&l=27 Is the expectation that people write down the inner target names too? That seems a bit awkward and abstraction-breaking. I could also imagine taking the test files and splitting them into a source_set that the test target depends on, but that's a bit of boilerplate. Do GN targets track what template instantiated them? Maybe friend declarations should match those too. Or perhaps there should be a way for :foo_unittests to say "pass on my friend privileges to :foo_unittests__impl". (I don't think forward_variables_from would work because the friend variable is on the library target, not the test target.)
,
Apr 18 2018
Ah, okay. Maybe worth mentioning on the thread then, since probably just about every friend declaration in Chromium will be a test template.
,
Apr 18 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/145465a79bc9ea86e8b1a00305ae81c71132bbfb commit 145465a79bc9ea86e8b1a00305ae81c71132bbfb Author: Steven Valdez <svaldez@chromium.org> Date: Wed Apr 18 21:54:21 2018 Enable gn checking for BoringSSL. This sets friend to be a wildcard to allow all third_party/boringssl to depend on internals. Bug: 834415 Change-Id: I38c3a923abe57fca2bb86c9c1b30c443aeb7fa0d Reviewed-on: https://chromium-review.googlesource.com/1017780 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Steven Valdez <svaldez@chromium.org> Cr-Commit-Position: refs/heads/master@{#551839} [modify] https://crrev.com/145465a79bc9ea86e8b1a00305ae81c71132bbfb/.gn [modify] https://crrev.com/145465a79bc9ea86e8b1a00305ae81c71132bbfb/third_party/boringssl/BUILD.gn |
|
►
Sign in to add a comment |
|
Comment 1 by brettw@chromium.org
, Apr 18 2018