From d4f11d23ff28fb4c0192b354b20056a9daa36d58 Mon Sep 17 00:00:00 2001 From: rik prohaska Date: Wed, 8 Apr 2020 16:53:56 -0400 Subject: [PATCH 1/3] glibc 2.30 defines the gettid system call, which conflicts with the tokuft test version. rename tokuft test version to avoid conflict. --- portability/tests/test-xid.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portability/tests/test-xid.cc b/portability/tests/test-xid.cc index 9ee68906b..6143d3b58 100644 --- a/portability/tests/test-xid.cc +++ b/portability/tests/test-xid.cc @@ -54,7 +54,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // since we implement the same thing here as in toku_os_gettid, this test // is pretty pointless -static int gettid(void) { +static int test_gettid(void) { #if defined(__NR_gettid) return syscall(__NR_gettid); #elif defined(SYS_gettid) @@ -68,6 +68,6 @@ static int gettid(void) { int main(void) { assert(toku_os_getpid() == getpid()); - assert(toku_os_gettid() == gettid()); + assert(toku_os_gettid() == test_gettid()); return 0; } From afc4d07f44f11e082afbe85585466bc3bcfa68aa Mon Sep 17 00:00:00 2001 From: rik prohaska Date: Fri, 22 May 2020 17:57:54 -0400 Subject: [PATCH 2/3] Build with gcc-10.0.1 (unbuntu 20.04). When cmake is probing for language specific flag support by the compiler, the probe needs to turn warnings into errors. Performing C++ SOURCE FILE Test HAVE_STDCXX0X failed with the following output: Change Dir: /home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_7c189/fast && /usr/bin/make -f CMakeFiles/cmTC_7c189.dir/build.make CMakeFiles/cmTC_7c189.dir/build make[1]: Entering directory '/home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_7c189.dir/src.cxx.o /usr/bin/g++-10 -Wall -Werror -Wcast-align -Wmissing-format-attribute -Wshadow -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wno-missing-noreturn -Wbad-function-cast -Wextra -fno-omit-frame-pointer -Wpacked -Wno-error=nonnull-compare -fno-exceptions -fno-rtti -Wlogical-op -Wtrampolines -Wswitch -Winit-self -Wstrict-null-sentinel -Wno-missing-field-initializers -Wno-address-of-packed-member -fexceptions -DHAVE_STDCXX0X -std=c++0x -o CMakeFiles/cmTC_7c189.dir/src.cxx.o -c /home/rfp/projects/tokuft-Debug-gcc-10/CMakeFiles/CMakeTmp/src.cxx cc1plus: error: command-line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [-Werror] cc1plus: error: command-line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [-Werror] cc1plus: error: command-line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [-Werror] --- cmake_modules/TokuSetupCompiler.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_modules/TokuSetupCompiler.cmake b/cmake_modules/TokuSetupCompiler.cmake index 92897b88f..4a6100ffe 100644 --- a/cmake_modules/TokuSetupCompiler.cmake +++ b/cmake_modules/TokuSetupCompiler.cmake @@ -2,6 +2,10 @@ function(add_c_defines) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ARGN}) endfunction(add_c_defines) +## always want these +set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") + if (APPLE) add_c_defines(DARWIN=1 _DARWIN_C_SOURCE) endif () @@ -170,10 +174,6 @@ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang) prepend_cflags_if_supported(-Wcast-align) endif () -## always want these -set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}") - # pick language dialect set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}") check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11) From 53bc86c4163613fdbbe1d107d79a305b6782f1d5 Mon Sep 17 00:00:00 2001 From: rik prohaska Date: Fri, 22 May 2020 19:23:35 -0400 Subject: [PATCH 3/3] Fix ydb tests that fail due to loose file permissions. Note that file permissions were changed in commit 5aca29f. --- src/tests/test_memcmp_magic.cc | 2 +- src/tests/xa-bigtxn-discard-abort.cc | 4 ++-- src/tests/xa-bigtxn-discard-commit.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/test_memcmp_magic.cc b/src/tests/test_memcmp_magic.cc index 8b56e716a..21e131bc0 100644 --- a/src/tests/test_memcmp_magic.cc +++ b/src/tests/test_memcmp_magic.cc @@ -103,7 +103,7 @@ static void test_memcmp_magic_sort_order(void) { DB_ENV *env; r = db_env_create(&env, 0); CKERR(r); r = env->set_default_bt_compare(env, comparison_function_unused); CKERR(r); - r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_INIT_TXN, 0); CKERR(r); + r = env->open(env, TOKU_TEST_FILENAME, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL+DB_INIT_TXN, S_IRUSR+S_IWUSR); CKERR(r); const int magic = 49; diff --git a/src/tests/xa-bigtxn-discard-abort.cc b/src/tests/xa-bigtxn-discard-abort.cc index 9f1b904df..4163d9918 100644 --- a/src/tests/xa-bigtxn-discard-abort.cc +++ b/src/tests/xa-bigtxn-discard-abort.cc @@ -62,7 +62,7 @@ static void populate_foo(DB_ENV *env, DB_TXN *txn) { DB *db = nullptr; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); for (int i = 0; i < test_nrows; i++) { @@ -81,7 +81,7 @@ static void check_foo(DB_ENV *env, DB_TXN *txn) { DB *db; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); DBC *c = nullptr; diff --git a/src/tests/xa-bigtxn-discard-commit.cc b/src/tests/xa-bigtxn-discard-commit.cc index ecbfa18bd..733df036e 100644 --- a/src/tests/xa-bigtxn-discard-commit.cc +++ b/src/tests/xa-bigtxn-discard-commit.cc @@ -59,7 +59,7 @@ static void populate_foo(DB_ENV *env, DB_TXN *txn) { DB *db = nullptr; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); for (int i = 0; i < test_nrows; i++) { @@ -78,7 +78,7 @@ static void check_foo(DB_ENV *env, DB_TXN *txn) { DB *db; r = db_create(&db, env, 0); CKERR(r); - r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, 0); + r = db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU); CKERR(r); DBC *c = nullptr;