bazel-team team mailing list archive
-
bazel-team team
-
Mailing list archive
-
Message #00071
Bug#1068202: bazel-bootstrap: FTBFS: /usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
Control: tags -1 patch
Hi,
> bazel-out/k8-dbg/bin/src/main/protobuf/command_server.grpc.pb.cc:6:
> /usr/include/absl/base/policy_checks.h:79:2: error: #error "C++
> versions less than C++14 are not supported." 79 | #error "C++
> versions less than C++14 are not supported." | ^~~~~
>
I've attached a patch [1] to fix FTBFS.
[1] 0001-Fix-FTBFS-with-std-c-0x-C-11.patch
I'm not sure that it should be fixed with .bzl source code under tools
directory too. (I guess that generated bazel command embeds it)
so these files was not touched.
(leave it to bazel-bootstrap maintainer judge)
grep -ir "c++0x"
tools/cpp/cc_toolchain_config.bzl: flag_groups =
[flag_group(flags = ["-std=c++0x"])],
tools/cpp/cc_toolchain_config.bzl: flag_groups =
[flag_group(flags = ["-std=c++0x"])],
tools/cpp/cc_toolchain_config.bzl: flag_groups =
[flag_group(flags = ["-std=c++0x"])],
tools/cpp/cc_toolchain_config.bzl: flag_groups =
[flag_group(flags = ["-std=c++0x"])], tools/cpp/unix_cc_configure.bzl:
"-std=c++0x", tools/cpp/bsd_cc_toolchain_config.bzl:
flag_groups = [flag_group(flags = ["-std=c++0x"])],
Regards,
>From e7f756e9e328516517e7b14ad1070c41c5688d5a Mon Sep 17 00:00:00 2001
From: Kentaro Hayashi <kenhys@xxxxxxxxx>
Date: Sun, 2 Jun 2024 23:36:37 +0900
Subject: [PATCH] Fix FTBFS with std=c++0x (C++11)
It will fix the following error:
/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++
versions less than C++14 are not supported."
It seems that -std=c++0x (C++11) is explicitly given in debian/rules,
so newer absl library reject it.
ref. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068202
Signed-off-by: Kentaro Hayashi <kenhys@xxxxxxxxx>
---
debian/rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/rules b/debian/rules
index 629b9caf..5cfeba6a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,7 +22,7 @@ export https_proxy=127.0.0.1:9
# BAZEL_CXXOPTS and BAZEL_LINKOPTS take a list of flags seperated by colon
export space = $() $()
-export BAZEL_CXXOPTS = $(subst $(space),:,-std=c++0x ${CPPFLAGS} ${CXXFLAGS})
+export BAZEL_CXXOPTS = $(subst $(space),:,-std=c++14 ${CPPFLAGS} ${CXXFLAGS})
export BAZEL_LINKOPTS = $(subst $(space),:,-lstdc++ -lm ${LDFLAGS})
# Use the local JDK
--
2.45.1
Follow ups
References