Message ID | ZblrjEl9IuRwWEir@zen.kayari.org |
---|---|
State | New |
Headers | show |
Series | [v2] mklog: Add lookup for new generated files in libstdc++ | expand |
On Tue, 30 Jan 2024 at 21:35, Jonathan Wakely wrote: > > On 30/01/24 15:02 +0000, Jonathan Wakely wrote: > >That way other subdirectories could add their own extra generated files to it. > > Like so. > > mklog: Add lookup for generated files in specific sub-directories > > The mklog.py output for libstdc++-v3/include/bits/version.h is awful. For example, here's what the mklog output shows for r14-7220-gac1a399bf61b04 (which only actually changed one macro, and just altered the line numbers for the ones following it): * include/bits/version.h (defined): (if): (__glibcxx_bind_back): (__cpp_lib_bind_back): (__glibcxx_want_bind_back): (__glibcxx_want_starts_ends_with): (__glibcxx_want_bit_cast): (__glibcxx_want_bitops): (__glibcxx_want_bounded_array_traits): (__glibcxx_want_concepts): (__glibcxx_want_optional): (__glibcxx_want_destroying_delete): (__glibcxx_want_constexpr_string_view): (__glibcxx_want_endian): (__glibcxx_want_int_pow2): (__glibcxx_want_integer_comparison_functions): (__glibcxx_want_is_constant_evaluated): (__glibcxx_want_constexpr_char_traits): (__glibcxx_want_is_layout_compatible): (__glibcxx_want_is_nothrow_convertible): (__glibcxx_want_is_pointer_interconvertible): (__glibcxx_want_math_constants): (__glibcxx_want_make_obj_using_allocator): (__glibcxx_want_remove_cvref): (__glibcxx_want_source_location): (__glibcxx_want_span): (__glibcxx_want_ssize): (__glibcxx_want_three_way_comparison): (__glibcxx_want_to_address): (__glibcxx_want_to_array): (__glibcxx_want_type_identity): (__glibcxx_want_unwrap_ref): (__glibcxx_want_constexpr_iterator): (__glibcxx_want_interpolate): (__glibcxx_want_constexpr_utility): (__glibcxx_want_shift): (__glibcxx_want_ranges): (__glibcxx_want_constexpr_numeric): (__glibcxx_want_constexpr_functional): (__glibcxx_want_constexpr_algorithms): (__glibcxx_want_constexpr_tuple): (__glibcxx_want_constexpr_memory): (__glibcxx_want_atomic_shared_ptr): (__glibcxx_want_atomic_wait): (__glibcxx_want_barrier): (__glibcxx_want_format): (__glibcxx_want_format_uchar): (__glibcxx_want_constexpr_complex): (__glibcxx_want_constexpr_dynamic_alloc): (__glibcxx_want_constexpr_string): (__glibcxx_want_constexpr_vector): (__glibcxx_want_erase_if): (__glibcxx_want_generic_unordered_lookup): (__glibcxx_want_jthread): (__glibcxx_want_latch): (__glibcxx_want_list_remove_return_type): (__glibcxx_want_polymorphic_allocator): (__glibcxx_want_move_iterator_concept): (__glibcxx_want_semaphore): (__glibcxx_want_smart_ptr_for_overwrite): (__glibcxx_want_syncbuf): (__glibcxx_want_byteswap): (__glibcxx_want_constexpr_charconv): (__glibcxx_want_constexpr_typeinfo): (__glibcxx_want_expected): (__glibcxx_want_freestanding_algorithm): (__glibcxx_want_freestanding_array): (__glibcxx_want_freestanding_cstring): (__glibcxx_want_freestanding_expected): (__glibcxx_want_freestanding_optional): (__glibcxx_want_freestanding_string_view): (__glibcxx_want_freestanding_variant): (__glibcxx_want_invoke_r): (__glibcxx_want_is_scoped_enum): (__glibcxx_want_reference_from_temporary): (__glibcxx_want_ranges_to_container): (__glibcxx_want_ranges_zip): (__glibcxx_want_ranges_chunk): (__glibcxx_want_ranges_slide): (__glibcxx_want_ranges_chunk_by): (__glibcxx_want_ranges_join_with): (__glibcxx_want_ranges_repeat): (__glibcxx_want_ranges_stride): (__glibcxx_want_ranges_cartesian_product): (__glibcxx_want_ranges_as_rvalue): (__glibcxx_want_ranges_as_const): (__glibcxx_want_ranges_enumerate): (__glibcxx_want_ranges_fold): (__glibcxx_want_ranges_contains): (__glibcxx_want_ranges_iota): (__glibcxx_want_ranges_find_last): (__glibcxx_want_constexpr_bitset): (__glibcxx_want_stdatomic_h): (__glibcxx_want_adaptor_iterator_pair_constructor): (__glibcxx_want_formatters): (__glibcxx_want_forward_like): (__glibcxx_want_ios_noreplace): (__glibcxx_want_move_only_function): (__glibcxx_want_out_ptr): (__glibcxx_want_print): (__glibcxx_want_spanstream): (__glibcxx_want_stacktrace): (__glibcxx_want_string_contains): (__glibcxx_want_string_resize_and_overwrite): (__glibcxx_want_to_underlying): (__glibcxx_want_unreachable): (__glibcxx_want_fstream_native_handle): (__glibcxx_want_ratio): (__glibcxx_want_saturation_arithmetic): (__glibcxx_want_to_string): Notice it has nonsense like "if" and "defined" in the function names it tries to guess.
diff --git a/contrib/mklog.py b/contrib/mklog.py index d764fb41f99..b9631f92600 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -92,6 +92,12 @@ function_extensions = {'.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def', '.md'} # NB: Makefile.in isn't listed as it's not always generated. generated_files = {'aclocal.m4', 'config.h.in', 'configure'} +subdir_generated_files = { +'libstdc++-v3': { 'include/bits/version.h', + 'include/bits/text_encoding-data.h' + 'include/bits/unicode-data.h' } +} + help_message = """\ Generate ChangeLog template for PATCH. PATCH must be generated using diff(1)'s -up or -cp options @@ -284,6 +290,9 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False, elif os.path.basename(file.path) in generated_files: out += '\t* %s: Regenerate.\n' % (relative_path) append_changelog_line(out, relative_path, 'Regenerate.') + elif relative_path in subdir_generated_files.get(changelog, {}): + out += '\t* %s: Regenerate.\n' % (relative_path) + append_changelog_line(out, relative_path, 'Regenerate.') else: if not no_functions: for hunk in file:
On 30/01/24 15:02 +0000, Jonathan Wakely wrote: >That way other subdirectories could add their own extra generated files to it. Like so. mklog: Add lookup for generated files in specific sub-directories The mklog.py output for libstdc++-v3/include/bits/version.h is awful. Teaching mklog.py that it's generated makes it correctly use "Regenerate" for its changes. We can do the same for the other new generated headers as well. This change adds a new dict with directories as keys, and a set of filenames as the values. The location of the ChangeLog file can be looked up in the dict and then the relative_path looked up in the set. contrib/ChangeLog: * mklog.py (subdir_generated_files): New dict of per-directory generated files. (generate_changelog): Use subdir_generated_files.