acachy commented on issue #2069:
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/2069#issuecomment-858151770


   > bazel build -c opt //pagespeed/automatic:automatic
   
   As far as I understand - it just generates libautomatic.a (that I already 
listed as a part of my merged pagespeed_automatic.a). And implies to use broken 
bazel_merge.sh after
   
   To be sure, I've tried to use just libautomatic.a as pagespeed_automatic.a 
and _ngx_ show errors like
   ```
   /usr/bin/ld: /tmp/ccBVH139.o: warning: relocation against 
`_ZTVN12net_instaweb18NullMessageHandlerE' in read-only section `.text.startup'
   /usr/bin/ld: /tmp/ccBVH139.o: in function `main':
   autotest.cc:(.text.startup+0x37): undefined reference to `vtable for 
net_instaweb::StringWriter'
   /usr/bin/ld: autotest.cc:(.text.startup+0x83): undefined reference to 
`net_instaweb::MessageHandler::MessageHandler()'
   ```
   
   I've checked a bit how pagespeed_automatic is made. In "before-bazel" way it 
uses merge_libraries.sh to combine these libraries:
   ```
   /build/libwebp_dsp.a
   /build/libwebp_enc.a
   /build/libwebp_mux.a
   /build/libwebp_utils.a
   /net/instaweb/libautomatic_util.a
   /net/instaweb/libinstaweb_add_instrumentation_data2c.a
   /net/instaweb/libinstaweb_add_instrumentation_opt_data2c.a
   /net/instaweb/libinstaweb_admin_site_css_data2c.a
   /net/instaweb/libinstaweb_apr.a
   /net/instaweb/libinstaweb_automatic.a
   /net/instaweb/libinstaweb_caches_css_data2c.a
   /net/instaweb/libinstaweb_caches_js_data2c.a
   /net/instaweb/libinstaweb_caches_js_opt_data2c.a
   /net/instaweb/libinstaweb_client_domain_rewriter_data2c.a
   /net/instaweb/libinstaweb_client_domain_rewriter_opt_data2c.a
   /net/instaweb/libinstaweb_console_css_data2c.a
   /net/instaweb/libinstaweb_console_js_data2c.a
   /net/instaweb/libinstaweb_console_js_opt_data2c.a
   /net/instaweb/libinstaweb_critical_css_beacon_data2c.a
   /net/instaweb/libinstaweb_critical_css_beacon_opt_data2c.a
   /net/instaweb/libinstaweb_critical_css_loader_data2c.a
   /net/instaweb/libinstaweb_critical_css_loader_opt_data2c.a
   /net/instaweb/libinstaweb_critical_images_beacon_data2c.a
   /net/instaweb/libinstaweb_critical_images_beacon_opt_data2c.a
   /net/instaweb/libinstaweb_critical_images_pb.a
   /net/instaweb/libinstaweb_critical_keys_pb.a
   /net/instaweb/libinstaweb_dedup_inlined_images_data2c.a
   /net/instaweb/libinstaweb_dedup_inlined_images_opt_data2c.a
   /net/instaweb/libinstaweb_defer_iframe_data2c.a
   /net/instaweb/libinstaweb_defer_iframe_opt_data2c.a
   /net/instaweb/libinstaweb_delay_images_data2c.a
   /net/instaweb/libinstaweb_delay_images_inline_data2c.a
   /net/instaweb/libinstaweb_delay_images_inline_opt_data2c.a
   /net/instaweb/libinstaweb_delay_images_opt_data2c.a
   /net/instaweb/libinstaweb_dependencies_pb.a
   /net/instaweb/libinstaweb_deterministic_data2c.a
   /net/instaweb/libinstaweb_deterministic_opt_data2c.a
   /net/instaweb/libinstaweb_extended_instrumentation_data2c.a
   /net/instaweb/libinstaweb_extended_instrumentation_opt_data2c.a
   /net/instaweb/libinstaweb_flush_early_pb.a
   /net/instaweb/libinstaweb_graphs_css_data2c.a
   /net/instaweb/libinstaweb_graphs_js_data2c.a
   /net/instaweb/libinstaweb_graphs_js_opt_data2c.a
   /net/instaweb/libinstaweb_input_info_pb.a
   /net/instaweb/libinstaweb_js_defer_data2c.a
   /net/instaweb/libinstaweb_js_defer_opt_data2c.a
   /net/instaweb/libinstaweb_lazyload_images_data2c.a
   /net/instaweb/libinstaweb_lazyload_images_opt_data2c.a
   /net/instaweb/libinstaweb_local_storage_cache_data2c.a
   /net/instaweb/libinstaweb_local_storage_cache_opt_data2c.a
   /net/instaweb/libinstaweb_messages_js_data2c.a
   /net/instaweb/libinstaweb_messages_js_opt_data2c.a
   /net/instaweb/libinstaweb_rendered_image_pb.a
   /net/instaweb/libinstaweb_responsive_js_data2c.a
   /net/instaweb/libinstaweb_responsive_js_opt_data2c.a
   /net/instaweb/libinstaweb_rewriter.a
   /net/instaweb/libinstaweb_rewriter_base.a
   /net/instaweb/libinstaweb_rewriter_css.a
   /net/instaweb/libinstaweb_rewriter_html.a
   /net/instaweb/libinstaweb_rewriter_html_gperf.a
   /net/instaweb/libinstaweb_rewriter_csp_gperf.a
   /net/instaweb/libinstaweb_rewriter_image.a
   /net/instaweb/libinstaweb_rewriter_javascript.a
   /net/instaweb/libinstaweb_rewriter_pb.a
   /net/instaweb/libinstaweb_spriter.a
   /net/instaweb/libinstaweb_spriter_pb.a
   /net/instaweb/libinstaweb_static_asset_config_pb.a
   /net/instaweb/libinstaweb_statistics_css_data2c.a
   /net/instaweb/libinstaweb_statistics_js_data2c.a
   /net/instaweb/libinstaweb_statistics_js_opt_data2c.a
   /net/instaweb/libinstaweb_system.a
   /net/instaweb/libinstaweb_util.a
   /net/instaweb/libprocess_context.a
   /net/instaweb/libtest_infrastructure.a
   /pagespeed/libjs_tokenizer.a
   /pagespeed/libjsminify.a
   /pagespeed/libmem_lock.a
   /pagespeed/libpagespeed_ads_util.a
   /pagespeed/libpagespeed_base.a
   /pagespeed/libpagespeed_base_core.a
   /pagespeed/libpagespeed_base_test_infrastructure.a
   /pagespeed/libpagespeed_cache.a
   /pagespeed/libpagespeed_controller.a
   /pagespeed/libpagespeed_controller_proto.a
   /pagespeed/libpagespeed_html.a
   /pagespeed/libpagespeed_html_gperf.a
   /pagespeed/libpagespeed_http.a
   /pagespeed/libpagespeed_http_core.a
   /pagespeed/libpagespeed_http_gperf.a
   /pagespeed/libpagespeed_http_pb.a
   /pagespeed/libpagespeed_image_processing.a
   /pagespeed/libpagespeed_image_types_pb.a
   /pagespeed/libpagespeed_javascript_gperf.a
   /pagespeed/libpagespeed_logging.a
   /pagespeed/libpagespeed_logging_enums_pb.a
   /pagespeed/libpagespeed_logging_pb.a
   /pagespeed/libpagespeed_opt_http.a
   /pagespeed/libpagespeed_property_cache_pb.a
   /pagespeed/libpagespeed_sharedmem.a
   /pagespeed/libpagespeed_sharedmem_pb.a
   /pagespeed/libpagespeed_thread.a
   /pagespeed/libpthread_system.a
   /pagespeed/libutil.a
   /third_party/apr/libapr.a
   /third_party/aprutil/libaprutil.a
   /third_party/base64/libbase64.a
   
/third_party/chromium/src/base/third_party/dynamic_annotations/libdynamic_annotations.a
   /third_party/css_parser/libcss_parser.a
   /third_party/css_parser/libcss_parser_gperf.a
   /third_party/css_parser/libutf.a
   /third_party/domain_registry_provider/src/domain_registry/libassert_lib.a
   
/third_party/domain_registry_provider/src/domain_registry/libdomain_registry_lib.a
   
/third_party/domain_registry_provider/src/domain_registry/libinit_registry_tables_lib.a
   /third_party/gflags/libgflags.a
   /third_party/giflib/libdgiflib.a
   /third_party/giflib/libgiflib_core.a
   /third_party/grpc/libgpr.a
   /third_party/grpc/libgrpc_core.a
   /third_party/grpc/libgrpc_cpp.a
   /third_party/hiredis/libhiredis.a
   /third_party/icu/libicudata.a
   /third_party/icu/libicuuc.a
   /third_party/jsoncpp/libjsoncpp.a
   /third_party/libjpeg_turbo/libjpeg.a
   /third_party/libjpeg_turbo/src/libjpeg_turbo.a
   /third_party/libpng/libpng.a
   /third_party/optipng/libopngreduc.a
   /third_party/protobuf/libprotobuf_full_do_not_use.a
   /third_party/re2/libre2.a
   /third_party/serf/libopenssl.a
   /third_party/serf/libserf.a
   /third_party/zlib/libzlib.a
   /url/liburl_lib.a
   ```
   
   But now there are almost totally different names, so I've just get all "*.a" 
libs except few copies and ones that related to envoy and tests.
   At least, errors are different after
   
   
   
   
   
   > If that yields the undefined reference you mention, then I think we're 
missing a dependency in a BUILD file on glog. Maybe adding it in 
https://github.com/apache/incubator-pagespeed-mod/blob/master/pagespeed/automatic/BUILD#L20
 helps.
   
   At the moment I didn't succeed with search for correct dependency name
   
   However
   - File "base/logging.h" contains "include glog/logging.h"
   - I had error about "glog" until I've added path to "glog/logging.h" to list 
of "include"-paths for CC-command in ngx/config:$pagespeed_include
   - When pagespeed_automatic.a is not complete - it also triggers "undefined 
reference"
   
   So, maybe it needs to include some extra ".a" library?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to