google / quiche

BSD 3-Clause "New" or "Revised" License
660 stars 132 forks source link

Bump com_google_googleurl to fix clang-18 compile error ( error: no template named '__is_cpp17_contiguous_iterator'; did you mean '__libcpp_is_contiguous_iterator'?) #77

Open maflcko opened 2 months ago

maflcko commented 2 months ago

According to https://github.com/google/quiche/blob/4249f8025caed1e3d71d04d9cadf42251acb7cac/WORKSPACE.bazel#L47-L51

the dependency was last updated in 2022.

However, in 2023 a patch was submitted in https://chromium.googlesource.com/chromium/src/+/9bfbbffdba73668fdb483e5a850911d2b64c35d7%5E%21/#F0 to work around a compile error.

My suggestion would be to bump the dependency.

Otherwise, compiling with clang-18 will fail with an error similar to:


ERROR: /root/.cache/bazel/_bazel_root/67f069a6e37e19c66574e49dfbd08b7c/external/com_google_googleurl/url/BUILD:12:11: Compiling url/url_parse_file.cc failed: (Exit 1): clang-18 failed: error executing command (from target @com_google_googleurl//url:url) 
  (cd /root/.cache/bazel/_bazel_root/67f069a6e37e19c66574e49dfbd08b7c/sandbox/linux-sandbox/205/execroot/com_google_quiche && \
  exec env - \
    CC=clang \
    CXX=clang++ \
    FUZZINTRO_OUTDIR=/src \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-6.2.1-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/out \
    PWD=/proc/self/cwd \
  /usr/local/bin/clang-18 -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' -MD -MF bazel-out/k8-fastbuild/bin/external/com_google_googleurl/url/_objs/url/url_parse_file.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/external/com_google_googleurl/url/_objs/url/url_parse_file.pic.o' -fPIC '-DBAZEL_CURRENT_REPOSITORY="com_google_googleurl"' -iquote external/com_google_googleurl -iquote bazel-out/k8-fastbuild/bin/external/com_google_googleurl -iquote external/com_google_absl -iquote bazel-out/k8-fastbuild/bin/external/com_google_absl -Wno-narrowing -DFUZZTEST_COMPATIBILITY_MODE '-std=c++17' -fno-rtti -O1 -fno-omit-frame-pointer -gline-tables-only '-Wno-error=enum-constexpr-conversion' '-Wno-error=incompatible-function-pointer-types' '-Wno-error=int-conversion' '-Wno-error=deprecated-declarations' '-Wno-error=implicit-function-declaration' '-Wno-error=implicit-int' -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION '-fsanitize=address' -fsanitize-address-use-after-scope '-fsanitize=fuzzer-no-link' '-stdlib=libc++' '-DNDEBUG=1' '-std=c++17' -fno-strict-aliasing -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_googleurl/url/url_parse_file.cc -o bazel-out/k8-fastbuild/bin/external/com_google_googleurl/url/_objs/url/url_parse_file.pic.o)
# Configuration: 4b41b17b63765a985bda05258a5914b54725df95453dd8960b93ca722634cf73
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_googleurl/url/url_parse_file.cc:7:
In file included from external/com_google_googleurl/url/url_file.h:11:
In file included from external/com_google_googleurl/base/strings/string_util.h:22:
In file included from external/com_google_googleurl/base/containers/span.h:17:
In file included from external/com_google_googleurl/polyfills/base/check_op.h:9:
external/com_google_googleurl/base/template_util.h:141:7: warning: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Wdeprecated-builtins]
  141 |       __has_trivial_copy(T) && __has_trivial_destructor(T);
      |       ^
external/com_google_googleurl/base/template_util.h:141:32: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
  141 |       __has_trivial_copy(T) && __has_trivial_destructor(T);
      |                                ^
In file included from external/com_google_googleurl/url/url_parse_file.cc:7:
In file included from external/com_google_googleurl/url/url_file.h:11:
In file included from external/com_google_googleurl/base/strings/string_util.h:22:
In file included from external/com_google_googleurl/base/containers/span.h:19:
external/com_google_googleurl/base/containers/checked_iterators.h:241:8: error: no template named '__is_cpp17_contiguous_iterator'; did you mean '__libcpp_is_contiguous_iterator'?
  241 | struct __is_cpp17_contiguous_iterator<::gurl_base::CheckedContiguousIterator<T>>
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |        __libcpp_is_contiguous_iterator
/usr/local/bin/../include/c++/v1/__iterator/iterator_traits.h:482:8: note: '__libcpp_is_contiguous_iterator' declared here
  482 | struct __libcpp_is_contiguous_iterator : false_type {};
      |        ^
2 warnings and 1 error generated.
maflcko commented 2 months ago

For example, this would be needed for https://github.com/google/oss-fuzz/pull/12094