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."

2024-06-02 Thread Kentaro HAYASHI
FYI:

I've created MR for it.

https://salsa.debian.org/bazel-team/bazel-bootstrap/-/merge_requests/3



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."

2024-06-02 Thread Kentaro HAYASHI
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 
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 
---
 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



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."

2024-04-01 Thread Sebastian Ramacher
Source: bazel-bootstrap
Version: 4.2.3+ds-9
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramac...@debian.org

https://buildd.debian.org/status/fetch.php?pkg=bazel-bootstrap=amd64=4.2.3%2Bds-9%2Bb2=1711976723=0

  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall 
-Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g 
'-std=c++0x' -Wdate-time '-D_FORTIFY_SOURCE=2' -g -O2 
'-ffile-prefix-map=/<>=.' -fstack-protector-strong 
-fstack-clash-protection -Wformat '-Werror=format-security' -fcf-protection -MD 
-MF 
bazel-out/k8-dbg/bin/src/main/protobuf/_objs/command_server_cc_grpc/command_server.grpc.pb.pic.d
 
'-frandom-seed=bazel-out/k8-dbg/bin/src/main/protobuf/_objs/command_server_cc_grpc/command_server.grpc.pb.pic.o'
 -fPIC '-DGRPC_USE_PROTO_LITE=ON' -iquote . -iquote bazel-out/k8-dbg/bin 
-iquote external/debian_cc_deps -iquote 
bazel-out/k8-dbg/bin/external/debian_cc_deps -iquote external/debian_proto_deps 
-iquote bazel-out/k8-dbg/bin/external/debian_proto_deps 
-fno-canonical-system-headers -Wno-builtin-macro-redefined 
'-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c 
bazel-out/k8-dbg/bin/src/main/protobuf/command_server.grpc.pb.cc -o 
bazel-out/k8-dbg/bin/src/main/protobuf/_objs/command_server_cc_grpc/command_server.grpc.pb.pic.o)
Execution platform: //:default_host_platform
␛[32m[256 / 1,677]␛[0m 5 actions running
JavacBootstrap .../devtools/build/buildjar/libstarlark-deps.jar; 18s local
Compiling src/main/cpp/blaze.cc; 3s local
@debian_proto_deps//:descriptor_proto; 3s local
Compiling src/main/protobuf/command_server.pb.cc; 3s local
Compiling src/main/cpp/option_processor.cc; 1s local

␛[1A␛[K
␛[1A␛[K
␛[1A␛[K
␛[1A␛[K
␛[1A␛[K
␛[1A␛[KIn file included from /usr/include/absl/base/config.h:86,
 from /usr/include/absl/base/const_init.h:25,
 from /usr/include/absl/synchronization/mutex.h:67,
 from /usr/include/grpcpp/impl/codegen/sync.h:32,
 from /usr/include/grpcpp/client_context.h:46,
 from /usr/include/grpcpp/impl/call_op_set.h:29,
 from /usr/include/grpcpp/support/server_callback.h:27,
 from /usr/include/grpcpp/impl/codegen/server_callback.h:24,
 from 
/usr/include/grpcpp/impl/codegen/server_callback_handlers.h:25,
 from /usr/include/grpcpp/generic/async_generic_service.h:24,
 from 
bazel-out/k8-dbg/bin/src/main/protobuf/command_server.grpc.pb.h:31,
 from 
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."
  |  ^

Cheers
-- 
Sebastian Ramacher