Name Date Size #Lines LOC

..--

BUILD.gnH A D25-Apr-20251.3 KiB4842

README.mdH A D25-Apr-20251.2 KiB3726

list_gclient_deps.pyH A D25-Apr-20251.2 KiB4427

private_code_test.gniH A D25-Apr-20252.1 KiB6460

private_code_test.pyH A D25-Apr-20254.1 KiB13699

README.md

1# Private Code Test
2
3This directory provides a mechanism for testing that native does not link in
4object files from unwanted directories. The test finds all linker inputs, and
5checks that none live inside a list of internal paths.
6
7Original bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1266989
8
9## Determining Internal Directories
10
11This is done by parsing the `.gclient_entries` file for all paths coming from
12https://chrome-internal.googlesource.com. I chose this approach since it is
13simple.
14
15The main alternative I found was to use `gclient flatten`. Example output:
16
17```
18  # src -> src/internal
19  "src/internal": {
20    "url": "https://chrome-internal.googlesource.com/chrome/src-internal.git@c649c6a155fe65c3730e2d663d7d2058d33bf1f9",
21    "condition": 'checkout_src_internal',
22  },
23```
24
25* Paths could be found in this way by looking for `checkout_src_internal`
26  within `condition`, and by looking for the comment line for `recurse_deps`
27  that went through an internal repo.
28
29## Determining Linker Inputs
30
31This is done by performing a custom link step with a linker that just records
32inputs. This seemed like the simplest approach.
33
34Two alternatives:
351) Dump paths found in debug information.
362) Scan a linker map file for input paths.
37