Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on warnings by default #277

Open
CodingCanuck opened this issue Mar 28, 2022 · 1 comment
Open

Turn on warnings by default #277

CodingCanuck opened this issue Mar 28, 2022 · 1 comment

Comments

@CodingCanuck
Copy link
Contributor

CodingCanuck commented Mar 28, 2022

We need to turn all warnings into errors (-Werror compiler option). It would make us fix all warnings except deprecated-declarations warning. For now we have warning about syscall, in future we are going to fix this too. You can see this issue on the screen below.
Screen Shot 2021-10-07 at 12 14 43 PM
Thus, with the help of the command below we will be able to clean our builds from warnings (again: except syscall warning):

bazel build --copt="-Werror" --copt="-Wno-error=deprecated-declarations" :grpc

(This issue is a recreation of 3rdparty/eventuals-grpc#34 now that the eventuals-grpc repo has been turned down)

@ArthurBandaryk FYI

@CodingCanuck
Copy link
Contributor Author

I tried building eventuals using the following command:

bazel build --config=clang --copt="-Werror" --copt="-Wno-error=deprecated-declarations" //...

Adding the --copt args results in errors configuring jemalloc that I don't understand:

$ bazel build --config=clang --copt="-Werror" --copt="-Wno-error=deprecated-declarations" //...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 06f09b5b-eecc-4301-8281-69cf13615c74
WARNING: /workspaces/respect/submodules/eventuals/BUILD.bazel:2:6: target '//:eventuals' is deprecated: Prefer //eventuals
WARNING: /workspaces/respect/submodules/eventuals/BUILD.bazel:10:6: target '//:grpc' is deprecated: Prefer //eventuals/grpc
INFO: Analyzed 25 targets (171 packages loaded, 22688 targets configured).
INFO: Found 25 targets...
ERROR: /home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/external/com_github_jemalloc_jemalloc/BUILD.bazel:18:23: Foreign Cc - Configure: Building jemalloc_preinstalled_make_ failed: (Exit 1): bash failed: error executing command 
  (cd /home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals && \
  exec env - \
    CC=clang \
    PATH=/home/vscode/.cache/bazelisk/downloads/bazelbuild/bazel-5.1.1-linux-x86_64/bin:/vscode/bin/linux-x64/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/bin/remote-cli:/home/vscode/miniconda3/bin:/home/vscode/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/python/bin:/home/vscode/.local/bin:/usr/local/py-utils/bin \
  /bin/bash -c bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make__foreign_cc/wrapper_build_script.sh)
# Configuration: 4eca12591fb56f9d4d97855f30e0476a62040ca2c5005b9121ca7f069ab83d5d
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
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 jemalloc_preinstalled_make_

Environment:______________
BUILD_SCRIPT=bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make__foreign_cc/build_script.sh
EXT_BUILD_ROOT=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals
BUILD_LOG=bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make__foreign_cc/Configure.log
PWD=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals
BUILD_WRAPPER_SCRIPT=bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make__foreign_cc/wrapper_build_script.sh
TMPDIR=/tmp
EXT_BUILD_DEPS=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_.ext_build_deps
BUILD_TMPDIR=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_.build_tmpdir
SHLVL=2
INSTALLDIR=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_
PATH=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals:/home/vscode/.cache/bazelisk/downloads/bazelbuild/bazel-5.1.1-linux-x86_64/bin:/vscode/bin/linux-x64/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/bin/remote-cli:/home/vscode/miniconda3/bin:/home/vscode/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/python/bin:/home/vscode/.local/bin:/usr/local/py-utils/bin
CC=clang
_=/usr/bin/env
__________________________
+ autoconf
+ mkdir -p /home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_.build_tmpdir/jemalloc_preinstalled_make_
+ ARFLAGS=rcsD
+ ASFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Werror -Wno-error=deprecated-declarations'
+ CFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Werror -Wno-error=deprecated-declarations'
+ CXXFLAGS='-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 -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Werror -Wno-error=deprecated-declarations -std=c++17'
+ LDFLAGS='-fuse-ld=/usr/lib/llvm-13/bin/ld.lld -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/lib/llvm-13/bin -lstdc++ -lm'
+ AR=/usr/bin/ar
+ CC=/usr/lib/llvm-13/bin/clang
+ CXX=/usr/lib/llvm-13/bin/clang
+ CPPFLAGS=
+ /home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_.build_tmpdir/configure --prefix=/home/vscode/.cache/bazel/_bazel_vscode/08c0069c780f6342645a87341bf9a372/sandbox/linux-sandbox/34/execroot/com_github_3rdparty_eventuals/bazel-out/k8-fastbuild-ST-dd44be474a39/bin/external/com_github_jemalloc_jemalloc/jemalloc_preinstalled_make_.build_tmpdir/jemalloc_preinstalled_make_
checking for xsltproc... false
checking for gcc... /usr/lib/llvm-13/bin/clang
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/lib/llvm-13/bin/clang accepts -g... yes
checking for /usr/lib/llvm-13/bin/clang option to accept ISO C89... none needed
checking whether compiler is cray... no
checking whether compiler supports -std=gnu11... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -Wextra... yes
checking whether compiler supports -Wshorten-64-to-32... yes
checking whether compiler supports -Wsign-compare... yes
checking whether compiler supports -Wundef... yes
checking whether compiler supports -Wno-format-zero-length... yes
checking whether compiler supports -pipe... yes
checking whether compiler supports -g3... yes
checking how to run the C preprocessor... /usr/lib/llvm-13/bin/clang -E
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/lib/llvm-13/bin/clang accepts -g... yes
checking whether /usr/lib/llvm-13/bin/clang supports C++14 features by default... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -Wextra... yes
checking whether compiler supports -g3... yes
checking whether libstdc++ linkage is compilable... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... no
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 byte ordering is bigendian... no
checking size of void *... 0
configure: error: Unsupported pointer size: 0

There are similar configuration errors with jemalloc when building with the default settings of gcc, rather than the --config=clang option:

[...]
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of intmax_t... 8
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether pause instruction is compilable... yes
checking number of significant virtual address bits... 48
checking for ar... /usr/bin/ar
checking for nm... nm
checking for gawk... no
checking for mawk... mawk
Missing VERSION file, and unable to generate it; creating bogus VERSION
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking whether malloc_usable_size definition can use const argument... no
checking for library containing log... no
configure: error: Missing math functions

I don't know why warning settings and/or compiler selection breaks jemalloc like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant