Skip to content

Conversation

@kjyoun
Copy link
Contributor

@kjyoun kjyoun commented Nov 3, 2025

This PR refactors GN build dependencies. The primary goal is to improve build hygiene and modularity by reducing
transitive dependency "leakage."

The two main categories of changes are:

  1. Privatizing dependencies by moving them from 'public_deps' to 'deps'. This is done for many core targets, including cobalt_shell_lib, cobalt_shell_app, and various test support libraries.
  2. Adding explicit dependencies to targets that previously relied on them transitively.

Bug: 457596041

This change moves :cobalt_shell_switches and :cobalt_shell_lib_deps
from public_deps to deps in cobalt_shell_lib. It also moves
:cobalt_shell_app_deps to deps in cobalt_shell_app.

This required adding explicit dependencies to several targets that
were previously relying on transitive public dependencies from
cobalt_shell_lib.
@kjyoun
Copy link
Contributor Author

kjyoun commented Nov 3, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly refactors dependencies in cobalt_shell_lib and cobalt_shell_app by moving them from public_deps to deps. This improves build encapsulation by reducing transitive dependencies. The consequential changes to add explicit dependencies in other targets seem correct. I found one critical issue where an Android-specific dependency is added unconditionally, which will break builds on other platforms. Please see my comment for details.

@kjyoun
Copy link
Contributor Author

kjyoun commented Nov 4, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors dependencies in the GN build files, moving cobalt_shell_switches and cobalt_shell_lib_deps from public_deps to deps in cobalt_shell_lib, and cobalt_shell_app_deps to deps in cobalt_shell_app. This change correctly reflects the direct dependencies of these targets and ensures that other targets explicitly declare their dependencies, improving build clarity and preventing unintended transitive dependencies. The changes are well-aligned with good dependency management practices.

@kjyoun kjyoun changed the title move cobalt_shell_switches and cobalt_shell_lib_deps to private deps Refactor Cobalt Build.gn to use private deps, instead of public_deps Nov 4, 2025
@kjyoun kjyoun changed the title Refactor Cobalt Build.gn to use private deps, instead of public_deps Refactor Cobalt GN targets to use private deps, instead of public_deps Nov 4, 2025
@kjyoun
Copy link
Contributor Author

kjyoun commented Nov 4, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and valuable refactoring of the GN build dependencies. Moving dependencies from public_deps to deps is a great step towards improving build hygiene and reducing transitive dependencies. The changes are extensive and appear to be correctly implemented across all the modified BUILD.gn files. I have one minor suggestion to improve the sorting of a dependency list with a conditional dependency.

@kjyoun kjyoun marked this pull request as ready for review November 4, 2025 05:59
@kjyoun kjyoun requested review from a team as code owners November 4, 2025 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant