From b49cc30e1117e9b35f6c3a988ddb05cf85c0c643 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 25 Aug 2011 11:50:18 +0200 Subject: [PATCH] Put ABI symbol checks into 'make check' * We have files in which all public symbols for the gck and gcr libraries, and then check these against the linked libraries. * Not a panacea for ABI changes, but at least a simple check --- gck/Makefile.am | 26 ++++++-- gck/gck.symbols | 195 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ gcr/Makefile.am | 20 +++++- gcr/gcr.symbols | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 429 insertions(+), 9 deletions(-) create mode 100644 gck/gck.symbols create mode 100644 gcr/gcr.symbols diff --git a/gck/Makefile.am b/gck/Makefile.am index c8f44ce..7be70dc 100644 --- a/gck/Makefile.am +++ b/gck/Makefile.am @@ -78,18 +78,30 @@ gck-marshal.c: gck-marshal.list $(GLIB_GENMARSHAL) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gck-$(GCK_MAJOR).pc +gck-expected.abi: gck.symbols + $(AM_V_GEN) cpp -P $< | sort > $@ + +gck-actual.abi: $(builddir)/.libs/libgck-@GCK_MAJOR@.so + $(AM_V_GEN) $(NM) -D -g --defined-only $< | \ + cut -d ' ' -f 3 | grep -Ev '^(__bss_start|_edata|_end)' | sort > $@ + +check-symbols: gck-expected.abi gck-actual.abi + $(AM_V_GEN) diff -U0 --ignore-blank-lines gck-expected.abi gck-actual.abi || \ + (echo "check-symbols: Symbols have CHANGED. Fix gck.symbols"; exit 1) + +check-local: check-symbols + EXTRA_DIST = \ gck.pc.in \ - gck-marshal.list + gck-marshal.list \ + gck.symbols + +CLEANFILES = \ + gck-actual.abi \ + gck-expected.abi DISTCLEANFILES = \ gck-$(GCK_MAJOR).pc gck-$(GCK_MAJOR).pc: gck.pc cp gck.pc gck-$(GCK_MAJOR).pc - -symbols: libgck-$(VERSION).symbols - -libgck-$(VERSION).symbols: .libs/libgck-@GCK_MAJOR@.so - nm -D .libs/libgck-@GCK_MAJOR@.so | grep -F ' T ' | \ - cut -d ' ' -f 3 | sort > $@ diff --git a/gck/gck.symbols b/gck/gck.symbols new file mode 100644 index 0000000..2ab48d9 --- /dev/null +++ b/gck/gck.symbols @@ -0,0 +1,195 @@ +/* This file lists all exported symbols. It is used to guarantee that we + * only consciously change our ABI. + */ + +gck_attribute_clear +gck_attribute_dump +gck_attribute_dup +gck_attribute_equal +gck_attribute_free +gck_attribute_get_boolean +gck_attribute_get_date +gck_attribute_get_string +gck_attribute_get_ulong +gck_attribute_init +gck_attribute_init_boolean +gck_attribute_init_copy +gck_attribute_init_date +gck_attribute_init_empty +gck_attribute_init_invalid +gck_attribute_init_string +gck_attribute_init_ulong +gck_attribute_is_invalid +gck_attribute_new +gck_attribute_new_boolean +gck_attribute_new_date +gck_attribute_new_empty +gck_attribute_new_invalid +gck_attribute_new_string +gck_attribute_new_ulong +gck_attributes_add +gck_attributes_add_all +gck_attributes_add_boolean +gck_attributes_add_data +gck_attributes_add_date +gck_attributes_add_empty +gck_attributes_add_invalid +gck_attributes_add_string +gck_attributes_add_ulong +gck_attributes_at +gck_attributes_contains +gck_attributes_count +gck_attributes_dump +gck_attributes_find +gck_attributes_find_boolean +gck_attributes_find_date +gck_attributes_find_string +gck_attributes_find_ulong +gck_attributes_get_boxed_type +gck_attributes_new +gck_attributes_new_empty +gck_attributes_new_full +gck_attributes_ref +gck_attributes_unref +gck_enumerator_get_type +gck_enumerator_next +gck_enumerator_next_async +gck_enumerator_next_finish +gck_enumerator_next_n +gck_get_error_quark +gck_list_ref_copy +gck_list_unref_free +gck_mechanism_info_free +gck_mechanisms_check +gck_message_from_rv +gck_module_equal +gck_module_get_functions +gck_module_get_info +gck_module_get_path +gck_module_get_slots +gck_module_get_type +gck_module_hash +gck_module_info_free +gck_module_initialize +gck_module_new +gck_modules_enumerate_objects +gck_modules_enumerate_uri +gck_modules_get_slots +gck_modules_initialize_registered +gck_modules_list_registered_paths +gck_modules_object_for_uri +gck_modules_objects_for_uri +gck_modules_token_for_uri +gck_object_destroy +gck_object_destroy_async +gck_object_destroy_finish +gck_object_equal +gck_object_from_handle +gck_object_get +gck_object_get_async +gck_object_get_data +gck_object_get_data_async +gck_object_get_data_finish +gck_object_get_data_full +gck_object_get_finish +gck_object_get_full +gck_object_get_handle +gck_object_get_module +gck_object_get_session +gck_object_get_template +gck_object_get_template_async +gck_object_get_template_finish +gck_object_get_type +gck_object_hash +gck_object_set +gck_object_set_async +gck_object_set_finish +gck_object_set_template +gck_object_set_template_async +gck_object_set_template_finish +gck_objects_from_handle_array +gck_session_create_object +gck_session_create_object_async +gck_session_create_object_finish +gck_session_decrypt +gck_session_decrypt_async +gck_session_decrypt_finish +gck_session_decrypt_full +gck_session_derive_key +gck_session_derive_key_async +gck_session_derive_key_finish +gck_session_derive_key_full +gck_session_encrypt +gck_session_encrypt_async +gck_session_encrypt_finish +gck_session_encrypt_full +gck_session_find_objects +gck_session_find_objects_async +gck_session_find_objects_finish +gck_session_from_handle +gck_session_generate_key_pair +gck_session_generate_key_pair_async +gck_session_generate_key_pair_finish +gck_session_generate_key_pair_full +gck_session_get_handle +gck_session_get_info +gck_session_get_module +gck_session_get_options +gck_session_get_slot +gck_session_get_state +gck_session_get_type +gck_session_info_free +gck_session_init_pin +gck_session_init_pin_async +gck_session_init_pin_finish +gck_session_login +gck_session_login_async +gck_session_login_finish +gck_session_logout +gck_session_logout_async +gck_session_logout_finish +gck_session_set_pin +gck_session_set_pin_async +gck_session_set_pin_finish +gck_session_sign +gck_session_sign_async +gck_session_sign_finish +gck_session_sign_full +gck_session_unwrap_key +gck_session_unwrap_key_async +gck_session_unwrap_key_finish +gck_session_unwrap_key_full +gck_session_verify +gck_session_verify_async +gck_session_verify_finish +gck_session_verify_full +gck_session_wrap_key +gck_session_wrap_key_async +gck_session_wrap_key_finish +gck_session_wrap_key_full +gck_slot_equal +gck_slot_from_handle +gck_slot_get_handle +gck_slot_get_info +gck_slot_get_mechanism_info +gck_slot_get_mechanisms +gck_slot_get_module +gck_slot_get_token_info +gck_slot_get_type +gck_slot_has_flags +gck_slot_hash +gck_slot_info_free +gck_slot_open_session +gck_slot_open_session_async +gck_slot_open_session_finish +gck_slot_open_session_full +gck_slot_open_session_full_async +gck_slots_enumerate_objects +gck_string_from_chars +gck_token_info_free +gck_uri_build +gck_uri_get_error_quark +gck_uri_info_free +gck_uri_parse +gck_value_to_boolean +gck_value_to_ulong diff --git a/gcr/Makefile.am b/gcr/Makefile.am index 97892e5..74bb353 100644 --- a/gcr/Makefile.am +++ b/gcr/Makefile.am @@ -176,6 +176,19 @@ gcr-$(GCR_MAJOR).pc: gcr.pc # ---------------------------------------------------------------- +gcr-expected.abi: gcr.symbols + $(AM_V_GEN) cpp -P $< | sort > $@ + +gcr-actual.abi: $(builddir)/.libs/libgcr-@GCR_MAJOR@.so + $(AM_V_GEN) $(NM) -D -g --defined-only $< | \ + cut -d ' ' -f 3 | grep -Ev '^(__bss_start|_edata|_end)' | sort > $@ + +check-symbols: gcr-expected.abi gcr-actual.abi + $(AM_V_GEN) diff -U0 --ignore-blank-lines gcr-expected.abi gcr-actual.abi || \ + (echo "check-symbols: Symbols have CHANGED. Fix gcr.symbols"; exit 1) + +check-local: check-symbols + EXTRA_DIST = \ gcr.pc.in \ gcr-marshal.list \ @@ -184,11 +197,14 @@ EXTRA_DIST = \ $(ui_DATA) \ $(conf_DATA) \ gcr-enum-types.h.template \ - gcr-enum-types.c.template + gcr-enum-types.c.template \ + gcr.symbols CLEANFILES = \ $(BUILT_SOURCES) \ - $(pkgconfig_DATA) + $(pkgconfig_DATA) \ + gcr-actual.abi \ + gcr-expected.abi DISTCLEANFILES = \ $(pkgconfig_DATA) diff --git a/gcr/gcr.symbols b/gcr/gcr.symbols new file mode 100644 index 0000000..86a6158 --- /dev/null +++ b/gcr/gcr.symbols @@ -0,0 +1,197 @@ +/* This file lists all exported symbols. It is used to guarantee that we + * only consciously change our ABI. + */ + +gcr_certificate_basics_widget_get_certificate +gcr_certificate_basics_widget_get_type +gcr_certificate_basics_widget_new +gcr_certificate_basics_widget_set_certificate +gcr_certificate_compare +gcr_certificate_chain_add +gcr_certificate_chain_build +gcr_certificate_chain_build_async +gcr_certificate_chain_build_finish +gcr_certificate_chain_flags_get_type +gcr_certificate_chain_get_anchor +gcr_certificate_chain_get_certificate +gcr_certificate_chain_get_endpoint +gcr_certificate_chain_get_length +gcr_certificate_chain_get_status +gcr_certificate_chain_get_type +gcr_certificate_chain_new +gcr_certificate_chain_status_get_type +gcr_certificate_details_widget_get_certificate +gcr_certificate_details_widget_get_type +gcr_certificate_details_widget_new +gcr_certificate_details_widget_set_certificate +gcr_certificate_get_columns +gcr_certificate_get_der_data +gcr_certificate_get_expiry_date +gcr_certificate_get_fingerprint +gcr_certificate_get_fingerprint_hex +gcr_certificate_get_icon +gcr_certificate_get_issued_date +gcr_certificate_get_issuer_cn +gcr_certificate_get_issuer_dn +gcr_certificate_get_issuer_part +gcr_certificate_get_issuer_raw +gcr_certificate_get_key_size +gcr_certificate_get_serial_number +gcr_certificate_get_serial_number_hex +gcr_certificate_get_subject_cn +gcr_certificate_get_subject_dn +gcr_certificate_get_subject_part +gcr_certificate_get_subject_raw +gcr_certificate_get_type +gcr_certificate_mixin_class_init +gcr_certificate_mixin_comparable_init +gcr_certificate_mixin_get_property +gcr_certificate_is_issuer +gcr_certificate_renderer_get_attributes +gcr_certificate_renderer_get_certificate +gcr_certificate_renderer_get_type +gcr_certificate_renderer_new +gcr_certificate_renderer_new_for_attributes +gcr_certificate_renderer_set_attributes +gcr_certificate_renderer_set_certificate +gcr_certificate_widget_get_attributes +gcr_certificate_widget_get_certificate +gcr_certificate_widget_get_type +gcr_certificate_widget_new +gcr_certificate_widget_set_attributes +gcr_certificate_widget_set_certificate +gcr_collection_emit_added +gcr_collection_emit_removed +gcr_collection_get_length +gcr_collection_get_objects +gcr_collection_get_type +gcr_collection_model_change_selected +gcr_collection_model_column_for_selected +gcr_collection_model_get_selected_objects +gcr_collection_model_get_type +gcr_collection_model_is_selected +gcr_collection_model_iter_for_object +gcr_collection_model_new +gcr_collection_model_new_full +gcr_collection_model_object_for_iter +gcr_collection_model_set_columns +gcr_collection_model_set_selected_objects +gcr_collection_model_toggle_selected +gcr_column_flags_get_type +gcr_combo_selector_get_collection +gcr_combo_selector_get_selected +gcr_combo_selector_get_type +gcr_combo_selector_new +gcr_combo_selector_set_selected +gcr_comparable_compare +gcr_comparable_get_type +gcr_comparable_memcmp +gcr_data_error_get_domain +gcr_data_error_get_type +gcr_data_format_get_type +gcr_error_get_domain +gcr_importer_get_parser +gcr_importer_get_prompt_behavior +gcr_importer_get_slot +gcr_importer_get_type +gcr_importer_import +gcr_importer_import_async +gcr_importer_import_finish +gcr_importer_listen +gcr_importer_new +gcr_importer_prompt_behavior_get_type +gcr_importer_queue +gcr_importer_set_parser +gcr_importer_set_prompt_behavior +gcr_importer_set_slot +gcr_key_renderer_get_attributes +gcr_key_renderer_get_type +gcr_key_renderer_new +gcr_key_renderer_set_attributes +gcr_key_widget_get_attributes +gcr_key_widget_get_type +gcr_key_widget_new +gcr_key_widget_set_attributes +gcr_list_selector_get_collection +gcr_list_selector_get_selected +gcr_list_selector_get_type +gcr_list_selector_new +gcr_list_selector_set_selected +gcr_parser_add_password +gcr_parser_format_disable +gcr_parser_format_enable +gcr_parser_format_supported +gcr_parser_get_parsed_attributes +gcr_parser_get_parsed_description +gcr_parser_get_parsed_label +gcr_parser_get_type +gcr_parser_new +gcr_parser_parse_data +gcr_parser_parse_stream +gcr_parser_parse_stream_async +gcr_parser_parse_stream_finish +gcr_pkcs11_add_module +gcr_pkcs11_add_module_from_file +gcr_pkcs11_certificate_get_attributes +gcr_pkcs11_certificate_get_type +gcr_pkcs11_certificate_lookup_issuer +gcr_pkcs11_certificate_lookup_issuer_async +gcr_pkcs11_certificate_lookup_issuer_finish +gcr_pkcs11_get_modules +gcr_pkcs11_get_trust_lookup_slots +gcr_pkcs11_get_trust_lookup_uris +gcr_pkcs11_get_trust_store_slot +gcr_pkcs11_get_trust_store_uri +gcr_pkcs11_set_modules +gcr_pkcs11_set_trust_lookup_uris +gcr_pkcs11_set_trust_store_uri +gcr_renderer_create +gcr_renderer_emit_data_changed +gcr_renderer_get_type +gcr_renderer_popuplate_popup +gcr_renderer_register +gcr_renderer_render +gcr_renderer_render_view +gcr_simple_certificate_get_type +gcr_simple_certificate_new +gcr_simple_certificate_new_static +gcr_simple_collection_add +gcr_simple_collection_contains +gcr_simple_collection_get_type +gcr_simple_collection_new +gcr_simple_collection_remove +gcr_tree_selector_get_collection +gcr_tree_selector_get_columns +gcr_tree_selector_get_selected +gcr_tree_selector_get_type +gcr_tree_selector_new +gcr_tree_selector_set_selected +gcr_trust_add_pinned_certificate +gcr_trust_add_pinned_certificate_async +gcr_trust_add_pinned_certificate_finish +gcr_trust_is_certificate_anchored +gcr_trust_is_certificate_anchored_async +gcr_trust_is_certificate_anchored_finish +gcr_trust_is_certificate_pinned +gcr_trust_is_certificate_pinned_async +gcr_trust_is_certificate_pinned_finish +gcr_trust_remove_pinned_certificate +gcr_trust_remove_pinned_certificate_async +gcr_trust_remove_pinned_certificate_finish +gcr_unlock_options_widget_get_choice +gcr_unlock_options_widget_get_label +gcr_unlock_options_widget_get_sensitive +gcr_unlock_options_widget_get_ttl +gcr_unlock_options_widget_get_type +gcr_unlock_options_widget_new +gcr_unlock_options_widget_set_choice +gcr_unlock_options_widget_set_label +gcr_unlock_options_widget_set_sensitive +gcr_unlock_options_widget_set_ttl +gcr_viewer_add_renderer +gcr_viewer_count_renderers +gcr_viewer_get_renderer +gcr_viewer_get_type +gcr_viewer_new +gcr_viewer_new_scrolled +gcr_viewer_remove_renderer -- 2.7.4