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