Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
BUILD.gn | H A D | 25-Apr-2025 | 1.3 KiB | 48 | 42 | |
README.md | H A D | 25-Apr-2025 | 1.2 KiB | 37 | 26 | |
list_gclient_deps.py | H A D | 25-Apr-2025 | 1.2 KiB | 44 | 27 | |
private_code_test.gni | H A D | 25-Apr-2025 | 2.1 KiB | 64 | 60 | |
private_code_test.py | H A D | 25-Apr-2025 | 4.1 KiB | 136 | 99 |
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