internal/new: Don't pass alignment to Delete when `__cpp_aligned_new` isn't set by mzacho · Pull Request #1702 · google/cel-cpp

Hi, I have same issue for building the https://github.com/envoyproxy/envoy which seems to use google/cel-cpp internal.
Here is a build fail logs.

% bazel build -c opt envoy --verbose_failures
INFO: Analyzed target //:envoy (1 packages loaded, 36 targets configured).
INFO: From GoLink external/com_envoyproxy_protoc_gen_validate/protoc-gen-validate_/protoc-gen-validate [for tool]:
ld: warning: ignoring duplicate libraries: '-lm'
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a [for tool]:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt-exec-ST-a828a81199fe/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_protobuf/src/google/protobuf/libdescriptor_proto.upb.a [for tool]:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt-exec-ST-a828a81199fe/bin/external/com_google_protobuf/src/google/protobuf/libdescriptor_proto.upb.a the table of contents is empty (no object file members in the library define global symbols)
ERROR: /private/var/tmp/_bazel_u5/8fbcd3295816604c295774e14efb0586/external/com_google_cel_cpp/internal/BUILD:44:11: Compiling internal/new.cc failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@com_google_cel_cpp//internal:new)
  (cd /private/var/tmp/_bazel_u5/8fbcd3295816604c295774e14efb0586/sandbox/darwin-sandbox/5466/execroot/envoy && \
  exec env - \
    PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++14' -MD -MF bazel-out/darwin_arm64-opt/bin/external/com_google_cel_cpp/internal/_objs/new/new.d '-frandom-seed=bazel-out/darwin_arm64-opt/bin/external/com_google_cel_cpp/internal/_objs/new/new.o' -iquote external/com_google_cel_cpp -iquote bazel-out/darwin_arm64-opt/bin/external/com_google_cel_cpp -iquote external/com_google_absl -iquote bazel-out/darwin_arm64-opt/bin/external/com_google_absl '-mmacosx-version-min=10.11' '-DABSL_MIN_LOG_LEVEL=4' -Wno-deprecated-declarations '-std=c++20' -Wno-nullability-completeness -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_cel_cpp/internal/new.cc -o bazel-out/darwin_arm64-opt/bin/external/com_google_cel_cpp/internal/_objs/new/new.o)
# Configuration: a8a21d93286812c5abf32fab801d01585ced2c1ced24e004647f8138359be6b2
# Execution platform: @@internal_platforms_do_not_use//host:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/com_google_cel_cpp/internal/new.cc:71:15: warning: 'aligned_alloc' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
  void* ptr = std::aligned_alloc(static_cast<size_t>(alignment), size);
              ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/malloc/_malloc.h:65:35: note: 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS 10.11.0
void * __sized_by_or_null(__size) aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
                                  ^
external/com_google_cel_cpp/internal/new.cc:71:15: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
  void* ptr = std::aligned_alloc(static_cast<size_t>(alignment), size);
              ^~~~~~~~~~~~~~~~~~
external/com_google_cel_cpp/internal/new.cc:110:17: error: use of undeclared identifier 'size'
    Delete(ptr, size);
                ^
1 warning and 1 error generated.
Target //source/exe:envoy-static failed to build
INFO: Elapsed time: 37.550s, Critical Path: 34.29s
INFO: 794 processes: 72 internal, 722 darwin-sandbox.
ERROR: Build did NOT complete successfully