Skip to content

refactor: reduce dependencies#220

Merged
chhy2009 merged 1 commit into
trpc-group:mainfrom
xuhongxu96:xhx/250731-depreduce
Sep 9, 2025
Merged

refactor: reduce dependencies#220
chhy2009 merged 1 commit into
trpc-group:mainfrom
xuhongxu96:xhx/250731-depreduce

Conversation

@xuhongxu96

Copy link
Copy Markdown
Contributor

Hi,

I've identified several redundant dependencies in the Bazel build scripts as part of a research project on dependency reduction. Below are some examples:

  • redundant (can be directly removed)
    • //trpc/admin:base_funcs -> //trpc/common/config:trpc_config
    • //trpc/compressor:trpc_compressor -> //trpc/util/buffer
    • //trpc/compressor/common:zlib_util -> //trpc/compressor
    • ...
  • overly general (can often be replaced with more specific transitive dependencies)
    • //trpc/codec/grpc/http2:response -> //trpc/util/http:response (flatten to //trpc/util/http:response_hdrs)
    • //trpc/common/config:local_file_sink_conf -> :default_log_conf (flatten to :default_log_conf_h and :default_log_conf_parser)
    • //trpc/util/internal:index_alloc_test -> @com_google_googletest//:gtest_main (flatten to @com_google_googletest//:gtest)
      • Note: Many test targets depending on gtest_main already define their own main function.
    • ...
  • can be lifted (dependency is only used by dependents, and can be moved there)
    • //trpc/compressor/lz4:lz4_util -> //trpc/util/buffer (lifted as :lz4_compressor_test -> //trpc/util/buffer)
    • //trpc/runtime/common:periphery_task_scheduler -> //trpc/util/thread:latch (lifted as :periphery_task_scheduler_test -> //trpc/util/thread:latch)
    • ...

Feel free to leave feedback, suggest improvements, or directly edit this PR.

Thanks for your support!

@github-actions

github-actions Bot commented Jul 31, 2025

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@xuhongxu96

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@chhy2009

Copy link
Copy Markdown
Contributor

Hi,

I've identified several redundant dependencies in the Bazel build scripts as part of a research project on dependency reduction. Below are some examples:

  • redundant (can be directly removed)

    • //trpc/admin:base_funcs -> //trpc/common/config:trpc_config
    • //trpc/compressor:trpc_compressor -> //trpc/util/buffer
    • //trpc/compressor/common:zlib_util -> //trpc/compressor
    • ...
  • overly general (can often be replaced with more specific transitive dependencies)

    • //trpc/codec/grpc/http2:response -> //trpc/util/http:response (flatten to //trpc/util/http:response_hdrs)

    • //trpc/common/config:local_file_sink_conf -> :default_log_conf (flatten to :default_log_conf_h and :default_log_conf_parser)

    • //trpc/util/internal:index_alloc_test -> @com_google_googletest//:gtest_main (flatten to @com_google_googletest//:gtest)

      • Note: Many test targets depending on gtest_main already define their own main function.
    • ...

  • can be lifted (dependency is only used by dependents, and can be moved there)

    • //trpc/compressor/lz4:lz4_util -> //trpc/util/buffer (lifted as :lz4_compressor_test -> //trpc/util/buffer)
    • //trpc/runtime/common:periphery_task_scheduler -> //trpc/util/thread:latch (lifted as :periphery_task_scheduler_test -> //trpc/util/thread:latch)
    • ...

Feel free to leave feedback, suggest improvements, or directly edit this PR.

Thanks for your support!

@chhy2009 chhy2009 closed this Aug 12, 2025
@chhy2009 chhy2009 reopened this Aug 12, 2025
@chhy2009

chhy2009 commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

aprprove

@chhy2009 chhy2009 merged commit 0c7b592 into trpc-group:main Sep 9, 2025
3 of 4 checks passed
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.

2 participants