Skip to content

[cleanup](build) Replace #include exec_env.h with forward declaration in 15 headers#61556

Closed
shuke987 wants to merge 1 commit intoapache:masterfrom
shuke987:iwyu-fwd-decl-exec-env
Closed

[cleanup](build) Replace #include exec_env.h with forward declaration in 15 headers#61556
shuke987 wants to merge 1 commit intoapache:masterfrom
shuke987:iwyu-fwd-decl-exec-env

Conversation

@shuke987
Copy link
Collaborator

Summary

  • Remove unused #include "runtime/exec_env.h" from 7 header files where ExecEnv is not referenced at all
  • Replace #include "runtime/exec_env.h" with class ExecEnv; forward declaration in 8 header files that only use ExecEnv* (pointer/reference)
  • Move the full #include "runtime/exec_env.h" to corresponding .cpp files where needed to maintain compilation

This reduces the include fan-out of exec_env.h (591 lines) across the codebase, improving incremental build times when exec_env.h or any of its transitive dependencies change.

Headers with include removed (unused):

  • pipeline/exec/aggregation_sink_operator.h
  • vec/exec/scan/vscanner.h
  • vec/sink/load_stream_map_pool.h
  • vec/sink/load_stream_stub.h
  • vec/sink/writer/vtablet_writer_v2.h
  • vec/sink/writer/vtablet_writer.h
  • olap/wal/wal_info.h

Headers with forward declaration added:

  • agent/workload_sched_policy_listener.h
  • runtime/group_commit_mgr.h
  • olap/wal/wal_manager.h
  • olap/wal/wal_table.h
  • runtime/query_context.h
  • runtime/workload_management/workload_sched_policy_mgr.h
  • http/action/compaction_score_action.h
  • http/http_handler_with_auth.h

Test plan

  • Verify full build passes (run buildall)
  • No functional changes - purely mechanical include cleanup
  • Each header still compiles standalone (forward declarations provide the needed type info for pointer/reference usage)

🤖 Generated with Claude Code

… in 15 headers

Remove unused #include "runtime/exec_env.h" from 7 header files and replace
with forward declaration class ExecEnv in 8 header files that only use ExecEnv*.
Move the full include to corresponding .cpp files where needed.

This reduces the include fan-out of exec_env.h (591 lines) across the codebase,
improving incremental build times when exec_env.h changes.

Headers with include removed (unused):
- pipeline/exec/aggregation_sink_operator.h
- vec/exec/scan/vscanner.h
- vec/sink/load_stream_map_pool.h
- vec/sink/load_stream_stub.h
- vec/sink/writer/vtablet_writer_v2.h
- vec/sink/writer/vtablet_writer.h
- olap/wal/wal_info.h

Headers with forward declaration added:
- agent/workload_sched_policy_listener.h
- runtime/group_commit_mgr.h
- olap/wal/wal_manager.h
- olap/wal/wal_table.h
- runtime/query_context.h
- runtime/workload_management/workload_sched_policy_mgr.h
- http/action/compaction_score_action.h
- http/http_handler_with_auth.h

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shuke987
Copy link
Collaborator Author

run buildall

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@shuke987
Copy link
Collaborator Author

Closing: file paths were wrong. Will resubmit with verified changes.

@shuke987 shuke987 closed this Mar 20, 2026
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