Closed zjingwang closed 1 year ago
root@4b7c9ca13f40:/tmp/differential-privacy-main/cc# ./postgres/install_extension.sh
+++ bazelisk info workspace
Starting local Bazel server and connecting to it...
++ WORKSPACE_DIR=/tmp/differential-privacy-main/cc
+++ bazelisk info -c opt bazel-bin
++ BIN_DIR=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin
+++ pg_config --pkglibdir
++ LIB_DIR=/usr/lib/postgresql/12/lib
+++ pg_config --sharedir
++ SHARE_DIR=/usr/share/postgresql/12
++ bazelisk build -c opt //postgres:anon_func.so
INFO: Analyzed target //postgres:anon_func.so (84 packages loaded, 8172 targets configured).
INFO: Found 1 target...
INFO: From Compiling src/google/protobuf/message_lite.cc [for tool]:
In file included from /usr/include/string.h:495,
from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
from external/com_google_protobuf/src/google/protobuf/stubs/common.h:48,
from external/com_google_protobuf/src/google/protobuf/message_lite.h:46,
from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
In function 'void* memcpy(void*, const void*, size_t)',
inlined from 'uint8_t* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, uint8_t*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:684:16,
inlined from 'virtual uint8_t* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(uint8_t*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:103:28,
inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:411:30:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INFO: From Compiling src/google/protobuf/message_lite.cc:
In file included from /usr/include/string.h:495,
from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
from external/com_google_protobuf/src/google/protobuf/stubs/common.h:48,
from external/com_google_protobuf/src/google/protobuf/message_lite.h:46,
from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
In function 'void* memcpy(void*, const void*, size_t)',
inlined from 'uint8_t* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, uint8_t*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:684:16,
inlined from 'virtual uint8_t* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(uint8_t*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:103:28,
inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:411:30:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: /root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/external/postgres/BUILD.bazel:35:15: Foreign Cc - Configure: Building postgres failed: (Exit 1): bash failed: error executing command (from target @postgres//:postgres) /bin/bash -c bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/wrapper_build_script.sh
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
rules_foreign_cc: Build failed!
rules_foreign_cc: Keeping temp build directory and dependencies directory for debug.
rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify --sandbox_debug Bazel command line flag.
rules_foreign_cc: Printing build logs:
_____ BEGIN BUILD LOGS _____
Bazel external C/C++ Rules. Building library postgres
Environment:______________
BUILD_SCRIPT=bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/build_script.sh
EXT_BUILD_ROOT=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy
BUILD_LOG=bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/Configure.log
PWD=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy
CXXFLAGS=-fPIC
BUILD_WRAPPER_SCRIPT=bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/wrapper_build_script.sh
TMPDIR=/tmp
EXT_BUILD_DEPS=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin/external/postgres/postgres.ext_build_deps
BUILD_TMPDIR=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin/external/postgres/postgres.build_tmpdir
SHLVL=2
INSTALLDIR=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin/external/postgres/postgres
PATH=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy:/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
CFLAGS=-fPIC
_=/usr/bin/env
__________________________
+ mkdir -p /root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin/external/postgres/postgres.build_tmpdir/postgres
+ ARFLAGS=rcsD
+ AR_FLAGS=rcsD
+ ASFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Wno-sign-compare'
+ CFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Wno-sign-compare -fPIC'
+ CXXFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++0x -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Wno-sign-compare -std=c++17 -fPIC'
+ LDFLAGS='-fuse-ld=gold -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,--gc-sections -lstdc++ -lm'
+ AR=/usr/bin/ar
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/gcc
+ RANLIB=:
+ CPPFLAGS=
+ /root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/external/postgres/configure --prefix=/root/.cache/bazel/_bazel_root/f858b8210fdfad55490e2c2b56b59667/sandbox/processwrapper-sandbox/187/execroot/com_google_cc_differential_privacy/bazel-out/k8-opt/bin/external/postgres/postgres.build_tmpdir/postgres
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking for /usr/bin/gcc option to accept ISO C99... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for gawk... no
checking for mawk... mawk
checking whether /usr/bin/gcc supports -Wdeclaration-after-statement, for CFLAGS... yes
checking whether /usr/bin/gcc supports -Werror=vla, for CFLAGS... yes
checking whether /usr/bin/gcc supports -Wendif-labels, for CFLAGS... yes
checking whether /usr/bin/gcc supports -Wendif-labels, for CXXFLAGS... yes
checking whether /usr/bin/gcc supports -Wmissing-format-attribute, for CFLAGS... yes
checking whether /usr/bin/gcc supports -Wmissing-format-attribute, for CXXFLAGS... yes
checking whether /usr/bin/gcc supports -Wformat-security, for CFLAGS... yes
checking whether /usr/bin/gcc supports -Wformat-security, for CXXFLAGS... yes
checking whether /usr/bin/gcc supports -fno-strict-aliasing, for CFLAGS... yes
checking whether /usr/bin/gcc supports -fno-strict-aliasing, for CXXFLAGS... yes
checking whether /usr/bin/gcc supports -fwrapv, for CFLAGS... yes
checking whether /usr/bin/gcc supports -fwrapv, for CXXFLAGS... yes
checking whether /usr/bin/gcc supports -fexcess-precision=standard, for CFLAGS... yes
checking whether /usr/bin/gcc supports -fexcess-precision=standard, for CXXFLAGS... no
checking whether /usr/bin/gcc supports -funroll-loops, for CFLAGS_VECTOR... yes
checking whether /usr/bin/gcc supports -ftree-vectorize, for CFLAGS_VECTOR... yes
checking whether /usr/bin/gcc supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... no
checking whether /usr/bin/gcc supports -Wformat-truncation, for NOT_THE_CFLAGS... yes
checking whether /usr/bin/gcc supports -Wstringop-truncation, for NOT_THE_CFLAGS... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for pkg-config... no
checking allow thread-safe client libraries... yes
checking whether to build with ICU support... no
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with BSD Authentication support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking whether to build with systemd support... no
checking whether to build with XML support... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for ranlib... :
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for tar... /usr/bin/tar
checking whether ln -s works... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for bison... no
configure: WARNING:
*** Without Bison you will not be able to build PostgreSQL from Git nor
*** change any of the parser definition files. You can obtain Bison from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this, because the Bison
*** output is pre-generated.)
checking for flex... no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files. You can obtain Flex from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.30.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether /usr/bin/gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether strerror_r returns int... no
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing clock_gettime... none required
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for library containing readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/k8-opt/bin/external/postgres/postgres_foreign_cc/Configure.log
Target //postgres:anon_func.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1285.146s, Critical Path: 100.02s
INFO: 346 processes: 17 internal, 329 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
apt-get install postgres postgresql-contrib
;git clone https://github.com/google/differential-privacy.git
;./postgres/install_extension.sh
.Can you please help me @dibakch ?
problem solved by apt install build-essential zlib1g-dev libreadline-dev bison flex
Hello team, I was tring to build postgres extension with
./postgres/install_extension.sh
and failed with some errors.Problems
Environments
How to reproduce the problem