-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use hedronvision boringssl to match rules_boost #198
Conversation
Fixes mvukov#191 Fixes mvukov#197 This PR Removes the internal build file for openssl. Instead, now rules_ros2 uses the hedronvision repository for the @openssl target. This fixes a linker error with the previous BUILD file. It also ensures rules_ros2 stays in-sync with rules_boost since they are both using the same BUILD file now for openssl.
) | ||
|
||
configure_make( | ||
name = "openssl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a (stupid) question: would renaming this target to "ssl"
solve your issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other reason I'd argue for using this is simply for compatibility with rules_boost. Right now, depending on whether rules_boost comes first in your WORKSPACE file or rules_ros2 is first, you'll get a different implementation of openssl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we make decision go/no-go for boringssl, I'd like to understand why you and #191 have problems.
One other thing that occurred to me: this could be related to the ordering of the libs. In particular, libssl.a depends on libcrypto.a (same in boringssl), but, I reversed ordering in out_static_libs. Can you please put libcrypto before libssl and check if there are still linking errors? I had similar issues with iceoryx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help. I tried swapping libcrypto.a and and libssl.a in out_static_libs of the openssl target. I get the same linker errors plus a bunch of new ones now.
ERROR: /home/kgk/.cache/bazel/_bazel_kgk/45603b392bb5e511bd1bbe303a476e47/external/com_github_mvukov_rules_ros2/third_party/foxglove_bridge/BUILD.bazel:11:16: Linking external/com_github_mvukov_rules_ros2/third_party/foxglove_bridge/foxglove_bridge_node failed: (Exit 1): gcc failed: error executing command (from target @com_github_mvukov_rules_ros2//third_party/foxglove_bridge:foxglove_bridge_node) /usr/bin/gcc @bazel-out/k8-fastbuild/bin/external/com_github_mvukov_rules_ros2/third_party/foxglove_bridge/foxglove_bridge_node-2.params
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function cert_stuff: error: undefined reference to 'EVP_PKEY_get_id'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ossl_certchain: error: undefined reference to 'EVP_PKEY_get_id'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ossl_certchain: error: undefined reference to 'EVP_PKEY_get_bn_param'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ossl_certchain: error: undefined reference to 'EVP_PKEY_get_bn_param'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ossl_certchain: error: undefined reference to 'EVP_PKEY_get_bn_param'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ossl_certchain: error: undefined reference to 'EVP_PKEY_get_bn_param'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function servercert: error: undefined reference to 'SSL_get1_peer_certificate'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function servercert: error: undefined reference to 'SSL_get1_peer_certificate'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ssl_setup_x509_store: error: undefined reference to 'X509_STORE_load_file'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ssl_setup_x509_store: error: undefined reference to 'X509_STORE_load_path'
bazel-out/k8-fastbuild/bin/external/curl/curl/lib/libcurl.a(openssl.c.o):openssl.c:function Curl_ssl_setup_x509_store: error: undefined reference to 'X509_STORE_load_path'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl3_record.o):ssl3_record.c:function ssl3_do_uncompress: error: undefined reference to 'COMP_expand_block'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl3_record.o):ssl3_record.c:function ssl3_do_compress: error: undefined reference to 'COMP_compress_block'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_ciph.o):ssl_ciph.c:function do_load_builtin_compressions: error: undefined reference to 'COMP_get_type'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_ciph.o):ssl_ciph.c:function do_load_builtin_compressions: error: undefined reference to 'COMP_get_name'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_ciph.o):ssl_ciph.c:function ssl_cipher_get_evp: error: undefined reference to 'EVP_enc_null'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_ciph.o):ssl_ciph.c:function SSL_COMP_add_compression_method: error: undefined reference to 'COMP_get_type'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_ciph.o):ssl_ciph.c:function SSL_COMP_get_name: error: undefined reference to 'COMP_get_name'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_clear_cipher_ctx: error: undefined reference to 'COMP_CTX_free'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_clear_cipher_ctx: error: undefined reference to 'COMP_CTX_free'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_current_compression: error: undefined reference to 'COMP_CTX_get_method'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_current_expansion: error: undefined reference to 'COMP_CTX_get_method'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_default_verify_paths: error: undefined reference to 'X509_STORE_set_default_paths'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_default_verify_dir: error: undefined reference to 'X509_LOOKUP_hash_dir'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_load_verify_locations: error: undefined reference to 'X509_STORE_load_locations'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ct_extract_ocsp_response_scts: error: undefined reference to 'OCSP_SINGLERESP_get1_ext_d2i'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_new'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set1_cert'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set1_issuer'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set_time'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_free'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_8192'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_4096'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_3072'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_2048'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc2409_prime_1024'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function SSL_srp_server_param_with_username: error: undefined reference to 'SRP_Calc_B'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function SSL_set_srp_server_param_pw: error: undefined reference to 'SRP_get_default_gN'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function SSL_set_srp_server_param_pw: error: undefined reference to 'SRP_create_verifier_BN'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Verify_A_mod_N'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Calc_u'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Calc_server_key'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Verify_B_mod_N'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_u'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_x'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_client_key'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function srp_verify_server_param: error: undefined reference to 'SRP_check_known_gN_param'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(tls_srp.o):tls_srp.c:function SRP_Calc_A_param: error: undefined reference to 'SRP_Calc_A'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_free'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_new'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_free'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_new'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(ssl_conf.o):ssl_conf.c:function do_store: error: undefined reference to 'X509_STORE_load_locations'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_enc.o):t1_enc.c:function tls1_change_cipher_state: error: undefined reference to 'COMP_CTX_new'
bazel-out/k8-fastbuild/bin/external/openssl/openssl/lib/libssl.a(t1_enc.o):t1_enc.c:function tls1_change_cipher_state: error: undefined reference to 'COMP_CTX_new'
collect2: error: ld returned 1 exit status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks.
So, the primary motivation for this PR are linking errors with cmake-compiled openssl that you and #191 experience. I still don't know what causes this. The best I can think of is that it's something ubuntu 20.04 vs 22.04 related. rules_boost can work with cmake-compiled openssl for sure: one needs to define openssl before rules_boost. I use this in this repo and at my daily job (where this combo works on 22.04 btw). Now, the target naming issue is legit but that can be solved with simple Bazel alias target -- that would enable one to switch from boringssl to openssl without hassle and still use rules_boost.
I am somewhat fine to remove openssl to have one dep less to maintain but the linking issues with openssl are still a mystery. Perhaps that should be documented in the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the linking issues are a mystery to me as well! I've reproduced it on 3 machines now though, all Ubuntu 22.04. Very odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments. Thanks for your efforts.
Fixes #191 Fixes #197
This PR removes the internal build file for openssl. Instead, now rules_ros2 uses the hedronvision repository for the @openssl target. This fixes a linker error with the previous BUILD file. It also ensures rules_ros2 stays in sync with rules_boost since they are both using the same BUILD file now for openssl.