envoyproxy / envoy-openssl

Envoy OpenSSL extensions
Apache License 2.0
44 stars 39 forks source link

Made headers available to other bazel rules #83

Closed knm3000 closed 1 year ago

knm3000 commented 1 year ago

bssl-compat headers are now visible and can be used during envoy bazel build

knm3000 commented 1 year ago

With these changes envoy bazel build is using bssl-compat headers and the whole repo build goes further than before, however it now fails with the following error (needs to be addressed in a separate PR):

ERROR: /root/.cache/bazel/_bazel_root/b13ba8860b1c0fe9823fbc66927d7a61/external/envoy/source/extensions/transport_sockets/tls/BUILD:67:17: Compiling source/extensions/transport_sockets/tls/io_handle_bio.cc failed: (Exit 1): clang-14 failed: error executing command (from target @envoy//source/extensions/transport_sockets/tls:io_handle_bio_lib) /usr/bin/clang-14 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' ... (remaining 116 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:18:57: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  return reinterpret_cast<Envoy::Network::IoHandle*>(bio->ptr);
                                                        ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:23:6: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  bio->init = 0;
     ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:24:6: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  bio->num = -1;
     ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:25:6: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  bio->ptr = nullptr;
     ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:26:6: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  bio->flags = 0;
     ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:36:10: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  if (bio->shutdown) {
         ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:37:12: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
    if (bio->init) {
           ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:40:8: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
    bio->init = 0;
       ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:41:8: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
    bio->flags = 0;
       ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:100:12: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
    ret = b->shutdown;
           ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:103:6: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
    b->shutdown = int(num);
     ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:136:4: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  b->num = -1;
   ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:137:4: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  b->ptr = io_handle;
   ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:138:4: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  b->shutdown = 0;
   ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
external/envoy/source/extensions/transport_sockets/tls/io_handle_bio.cc:139:4: error: member access into incomplete type 'BIO' (aka 'ossl_bio_st')
  b->init = 1;
   ^
bazel-out/k8-fastbuild/bin/external/bssl-compat/bssl-compat/include/ossl/openssl/types.h:86:16: note: forward declaration of 'ossl_bio_st'
typedef struct ossl_bio_st ossl_BIO;
               ^
15 errors generated.
Target //:envoy failed to build
tedjpoole commented 1 year ago

LGTM thanks