two way dependency between blink and services: touching a mojom file in //services causes v8 bindings to be rebuilt |
||||||
Issue descriptionEvery now and then when I make a one line change to services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom I end up with >5k targets to rebuild, that involve all of webkit and v8 bindings. That makes development of stuff in //services quite uncomfortable There is a two way dependency here: 1) stuff in resource-coordinator is part of services that depends on blink because of data_decoder (https://cs.chromium.org/chromium/src/services/data_decoder/BUILD.gn?rcl=3552abab97931475862cb0134fdaac70f24b3fde&l=45). 2) In turn blink depends on resource-coordinator generated interfaces because of the dependency on resource_coordinator_cpp (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/BUILD.gn?rcl=db74d3de144d34ae6e9eccfadf0e3db86c129b49&l=1499) Proof: 1) How services depends on Blink $ gn path out/dbg //third_party/WebKit/Source/core/animation:animation //services:services_unittests //services:services_unittests --[private]--> //services/data_decoder:tests --[private]--> //third_party/WebKit/public:blink --[private]--> //third_party/WebKit/Source/core:core --[private]--> //third_party/WebKit/Source/core/animation:animation $ gn path out/dbg //third_party/WebKit/Source/bindings/core/v8:bindings_core_impl //services:services_unittests //services:services_unittests --[private]--> //services/data_decoder:tests --[private]--> //third_party/WebKit/public:blink --[private]--> //third_party/WebKit/Source/core:core --[public]--> //third_party/WebKit/Source/core:core_generated --[public]--> //third_party/WebKit/Source/bindings/core/v8:bindings_core_impl 2) How blink depends on services $ ninja -C out/dbg -t query gen/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom-shared.h obj/third_party/WebKit/Source/core/animation/animation/CSSFontSizeInterpolationType.o gen/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom-shared.h: input: __services_resource_coordinator_public_interfaces_interfaces_internal_shared__generator___build_toolchain_mac_clang_x64__rule ../../services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom | obj/services/resource_coordinator/public/interfaces/interfaces_internal_shared__generator.inputdeps.stamp outputs: obj/services/resource_coordinator/public/interfaces/interfaces_internal_shared__generator.stamp obj/third_party/WebKit/Source/core/animation/animation/CSSFontSizeInterpolationType.o: input: cxx ../../third_party/WebKit/Source/core/animation/CSSFontSizeInterpolationType.cpp || obj/third_party/WebKit/Source/core/animation/animation.inputdeps.stamp outputs: libblink_core.dylib libblink_core.dylib.TOC obj/third_party/WebKit/Source/core/animation/animation.stamp
,
Sep 11 2017
So, to be clear, there are two distinct problems here: Problem 1: two way dependency between blink and services -------------------------------------------------------- +jam, I think this materializes my question during the presentation: how should dependency flow in/out of services? Right now we have dependencies between blink and services in both directions. The blink -> services dep (2 above) is because of the dependency on the resource_coordinator public library (not the service itself), which actually comes from [1]: blink:platform -> resource_coordinator_cpp -> interfaces:interfaces_internal -> mojom files Problem 2: touching a mojom file causes rebuild of many sources in blink ------------------------------------------------------------------------ This is orthogonal and not fully justified by Problem 1. Essentially the problem I see here is that because of bilnk:platform depending on resource_coordinator:interfaces_internal [1], it seems that every single translation unit in blink gets a dependency on the memory_instrumentation generated mojom.h file, even if they don't #include it for reasons I don't fully understand (see the ninja dep graph above in #0). I cannot see any header or translation unit in blink including resource_coordinator.*memory_instrumentation: https://cs.chromium.org/search/?q=include.*resource_coordinator.*memory+f:webkit&type=cs So I don't understand why all those blink translation units (e.g., CSSFontSizeInterpolationType.o) get rebuilt. I just know that the final effect, of Problem 1 and 2 together, is that touching a mojom file in services/resource_coordinator*memory_instrumentation causes the following cascading effects: - the autogen mojom.h are be re-generated (expected) - the resource_coordinator public library (resource_coordinator_cpp) needs to be rebuilt (expected) - many .o files in blink now are considered stale (not expected) - services depends on blink because of data_decoder, so in order to build "services" ninja needs to build "blink" - because the stale files above, most of blink files need to be rebuilt [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/BUILD.gn?rcl=296fb5ec56e89ab6b9b09b5d42037dd18b217d31&l=1499
,
Sep 12 2017
,
May 15 2018
,
May 17 2018
this is not network service related but s13n related in general.
,
May 30 2018
,
Oct 17
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by jmukthavaram@chromium.org
, Sep 11 2017