]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Fix and detect headers with missing dependencies (#8893)
authorPeter Dillinger <peterd@fb.com>
Fri, 10 Sep 2021 16:59:05 +0000 (09:59 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Sep 2021 17:00:26 +0000 (10:00 -0700)
commitbda8d93ba95f34aa91ae8578fe7d3454f3324f6a
tree6d4946d69822b2fa6b1fe816d6786e1463fb1173
parentdc0dc90cf5be4afe981037a4cd1ffc0da6dfaa7a
Fix and detect headers with missing dependencies (#8893)

Summary:
It's always annoying to find a header does not include its own
dependencies and only works when included after other includes. This
change adds `make check-headers` which validates that each header can
be included at the top of a file. Some headers are excluded e.g. because
of platform or external dependencies.

rocksdb_namespace.h had to be re-worked slightly to enable checking for
failure to include it. (ROCKSDB_NAMESPACE is a valid namespace name.)

Fixes mostly involve adding and cleaning up #includes, but for
FileTraceWriter, a constructor was out-of-lined to make a forward
declaration sufficient.

This check is not currently run with `make check` but is added to
CircleCI build-linux-unity since that one is already relatively fast.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8893

Test Plan: existing tests and resolving issues detected by new check

Reviewed By: mrambacher

Differential Revision: D30823300

Pulled By: pdillinger

fbshipit-source-id: 9fff223944994c83c105e2e6496d24845dc8e572
35 files changed:
.circleci/config.yml
Makefile
cache/cache_entry_stats.h
db/compaction/compaction_iteration_stats.h
db/job_context.h
db/pre_release_callback.h
db/read_callback.h
db/snapshot_impl.h
db_stress_tool/db_stress_compaction_filter.h
db_stress_tool/db_stress_listener.h
db_stress_tool/db_stress_table_properties_collector.h
include/rocksdb/functor_wrapper.h
include/rocksdb/rocksdb_namespace.h
include/rocksdb/thread_status.h
include/rocksdb/universal_compaction.h
include/rocksdb/utilities/ldb_cmd_execute_result.h
memory/memory_usage.h
table/block_based/block_type.h
table/table_properties_internal.h
table/table_reader_caller.h
util/cast_util.h
util/channel.h
util/crc32c_ppc.h
util/defer.h
util/duplicate_detector.h
util/fastrange.h
util/math.h
util/set_comparator.h
util/work_queue.h
util/xxph3.h
utilities/blob_db/blob_db_gc_stats.h
utilities/cassandra/cassandra_options.h
utilities/cassandra/serialize.h
utilities/trace/file_trace_reader_writer.cc
utilities/trace/file_trace_reader_writer.h