Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror
@ 2020-10-20 15:40 Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c* Alexander V. Tikhonov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexander V. Tikhonov @ 2020-10-20 15:40 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: tarantool-patches

To implement default compiler build with Werror decided to use
gcc-4.8.5 on CentOS 7. Also decided to use packages build process
for it. 'ENABLE_WERROR' flag was added to packages build options spec
file to enable Werror in packages builds. Also fixed issue with
test/unit tests build which was found building with Werror flag.
    
Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
Issue: https://github.com/tarantool/tarantool/issues/4941

Alexander V. Tikhonov (3):
  build: fix Werror warning in test/unit:fiber*.c*
  build: add Werror flag on packages builds
  gitlab-ci: test default gcc on CentOS 7

 .gitlab-ci.yml           | 7 +++++++
 .gitlab.mk               | 2 +-
 rpm/tarantool.spec       | 1 +
 test/unit/CMakeLists.txt | 4 ----
 4 files changed, 9 insertions(+), 5 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c*
  2020-10-20 15:40 [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Alexander V. Tikhonov
@ 2020-10-20 15:40 ` Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 2/3] build: add Werror flag on packages builds Alexander V. Tikhonov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander V. Tikhonov @ 2020-10-20 15:40 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: tarantool-patches

Building with gcc-4.8.5 on CentOS 7 found issue:

cd /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit && /usr/bin/g++ ... -Wp,-D_FORTIFY_SOURCE=2 ... -O2 ... -O0 -o CMakeFiles/fiber.test.dir/fiber.cc.o -c /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit/fiber.cc
In file included from /usr/include/inttypes.h:25:0,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/src/lib/small/small/region.h:34,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/src/lib/core/memory.h:33,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit/fiber.cc:1:
/usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
 # warning _FORTIFY_SOURCE requires compiling with optimization (-O)

It happened because _FORTIFY_SOURCE=2 flag needed -O[1|2] optimization,
but latest set in command was -O0. To fix it removed not needed '-O0'
optimization from test/unit/CmakeLists.txt file. This optimization
became unneeded after the commit:

  aa78a941430a196e24d146734cd1f64bd9735e4f ("test/uint: fiber")

when the test was completely rewritten.

Needed for #4941
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
Issue: https://github.com/tarantool/tarantool/issues/4941

 test/unit/CMakeLists.txt | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index aace8cf50..e05466473 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -75,13 +75,9 @@ add_executable(decimal.test decimal.c)
 target_link_libraries(decimal.test core unit)
 add_executable(mp_error.test mp_error.cc core_test_utils.c)
 target_link_libraries(mp_error.test box_error core unit)
-
 add_executable(fiber.test fiber.cc core_test_utils.c)
-set_source_files_properties(fiber.cc PROPERTIES COMPILE_FLAGS -O0)
 target_link_libraries(fiber.test core unit)
-
 add_executable(fiber_stack.test fiber_stack.c core_test_utils.c)
-set_source_files_properties(fiber_stack.c PROPERTIES COMPILE_FLAGS -O0)
 target_link_libraries(fiber_stack.test core unit)
 
 if (NOT ENABLE_GCOV)
-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Tarantool-patches] [PATCH v1 2/3] build: add Werror flag on packages builds
  2020-10-20 15:40 [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c* Alexander V. Tikhonov
@ 2020-10-20 15:40 ` Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 3/3] gitlab-ci: test default gcc on CentOS 7 Alexander V. Tikhonov
  2020-11-01  8:48 ` [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander V. Tikhonov @ 2020-10-20 15:40 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: tarantool-patches

Added ENABLE_WERROR flag to build options to enable Werror.

Part of #4941
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
Issue: https://github.com/tarantool/tarantool/issues/4941

 rpm/tarantool.spec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec
index eedc0312c..04d41a418 100644
--- a/rpm/tarantool.spec
+++ b/rpm/tarantool.spec
@@ -160,6 +160,7 @@ C and Lua/C modules.
          -DSYSTEMD_UNIT_DIR:PATH=%{_unitdir} \
          -DSYSTEMD_TMPFILES_DIR:PATH=%{_tmpfilesdir} \
 %endif
+         -DENABLE_WERROR:BOOL=ON \
          -DENABLE_DIST:BOOL=ON
 make %{?_smp_mflags}
 
-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Tarantool-patches] [PATCH v1 3/3] gitlab-ci: test default gcc on CentOS 7
  2020-10-20 15:40 [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c* Alexander V. Tikhonov
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 2/3] build: add Werror flag on packages builds Alexander V. Tikhonov
@ 2020-10-20 15:40 ` Alexander V. Tikhonov
  2020-11-01  8:48 ` [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander V. Tikhonov @ 2020-10-20 15:40 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: tarantool-patches

Sometimes it is convenient to use default compiler on CentOS 7.
Added test job which uses for compiling default compiler files:

  CC=/usr/bin/gcc
  CXX=/usr/bin/g++

Closes #4941
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
Issue: https://github.com/tarantool/tarantool/issues/4941

 .gitlab-ci.yml | 7 +++++++
 .gitlab.mk     | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dc58888b6..daa76d07f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -277,6 +277,13 @@ jepsen:
       - jepsen-tests-prefix/src/jepsen-tests/store
     expire_in: 6 month
 
+default_gcc_centos_7:
+  <<: *pack_test_definition
+  variables:
+    PACKPACK_EXTRA_DOCKER_RUN_PARAMS: '-e CC=/usr/bin/gcc -e CXX=/usr/bin/g++'
+    OS: 'el'
+    DIST: '7'
+
 # ####
 # Perf
 # ####
diff --git a/.gitlab.mk b/.gitlab.mk
index e1a83ac07..c1fc80320 100644
--- a/.gitlab.mk
+++ b/.gitlab.mk
@@ -116,7 +116,7 @@ deploy_prepare:
 	rm -rf build
 
 package: deploy_prepare
-	PACKPACK_EXTRA_DOCKER_RUN_PARAMS='--network=host' ./packpack/packpack
+	PACKPACK_EXTRA_DOCKER_RUN_PARAMS="--network=host ${PACKPACK_EXTRA_DOCKER_RUN_PARAMS}" ./packpack/packpack
 
 deploy: package
 	echo ${GPG_SECRET_KEY} | base64 -d | gpg --batch --import || true
-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror
  2020-10-20 15:40 [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Alexander V. Tikhonov
                   ` (2 preceding siblings ...)
  2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 3/3] gitlab-ci: test default gcc on CentOS 7 Alexander V. Tikhonov
@ 2020-11-01  8:48 ` Kirill Yukhin
  3 siblings, 0 replies; 5+ messages in thread
From: Kirill Yukhin @ 2020-11-01  8:48 UTC (permalink / raw)
  To: Alexander V. Tikhonov; +Cc: tarantool-patches

Hello,

On 20 окт 18:40, Alexander V. Tikhonov wrote:
> To implement default compiler build with Werror decided to use
> gcc-4.8.5 on CentOS 7. Also decided to use packages build process
> for it. 'ENABLE_WERROR' flag was added to packages build options spec
> file to enable Werror in packages builds. Also fixed issue with
> test/unit tests build which was found building with Werror flag.
>     
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old
> Issue: https://github.com/tarantool/tarantool/issues/4941

LGTM.
I've checked your patchset into 1.10, 2.5, 2.6 and master.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-01  8:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 15:40 [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Alexander V. Tikhonov
2020-10-20 15:40 ` [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c* Alexander V. Tikhonov
2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 2/3] build: add Werror flag on packages builds Alexander V. Tikhonov
2020-10-20 15:40 ` [Tarantool-patches] [PATCH v1 3/3] gitlab-ci: test default gcc on CentOS 7 Alexander V. Tikhonov
2020-11-01  8:48 ` [Tarantool-patches] [PATCH v1 0/3] implement default compiler build with Werror Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox