Commit graph

1503 commits

Author SHA1 Message Date
Anel Husakovic
7eed97ed9f MDEV-25777: JAVA_INCLUDE_PATH and JAVA_INCLUDE_PATH2 not found with out of source configuration and Ninja generator
- As solution `PLUGIN_CONNECT=NO` use early check to disable plugin:
  Solution suggested by wlad@mariadb.com
- `JNI_FOUND` is a internal result variable and should be set with
cached library and header variables (like `JAVA_INCLUDE_PATH`) defined.
  * Note: wrapper cmake/FindJNI.cmake runs first time and cmake native Find<module> returns only cached variable, like `JAVA_INCLUDE_PATH`, results variable are not cached).

Reviewed by: serg@mariadb.com
2021-06-04 10:52:18 +02:00
Marko Mäkelä
1864a8ea93 Merge 10.2 into 10.3 2021-05-24 09:38:49 +03:00
Sergei Golubchik
f70b11c8c9 cmake: fewer Build-Depends in SRPM
don't require tar/gtar, git, getconf, groff/nroff, and ruby.
2021-05-22 21:56:51 +02:00
Sergei Golubchik
9d0fde3ba1 cmake: silence repeated git searches too 2021-05-22 21:56:51 +02:00
Sergei Golubchik
f9f8cae9fe cmake: fix FindJava/FindJNI wrappers for cmake re-runs
when cmake is re-run and include(FindJAVA) is skipped,
JAVA_FOUND should still be set. Same for JNI.
2021-05-22 21:56:51 +02:00
Sergei Golubchik
681918a849 MDEV-24996 file conflict in rpm packages 2021-05-22 21:56:51 +02:00
Marko Mäkelä
98e6159892 Merge 10.2 into 10.3 2021-05-10 09:09:50 +03:00
Sergei Golubchik
e1bf1aea5c force jemalloc to be used in release rpm/deb builds
unless explicitly overruled with -DWITH_JEMALLOC=no
2021-05-08 18:02:34 +02:00
Oleksandr Byelkin
4f143a88bc Fix of ppc64 by Wlad 2021-05-05 17:21:05 +02:00
Marko Mäkelä
ef26a30486 Merge 10.2 into 10.3 2021-04-14 07:54:43 +03:00
Sergei Golubchik
55a7682a30 -DMYSQL_MAINTAINER_MODE=NO
also add =WARN as an alias for =OFF
and clarify the help text
2021-04-13 17:13:44 +02:00
Vladislav Vaintroub
453bac08c2 CMake - when searching bison, look also for win_bison
win_bison belongs winflexbison project, which is Windows most up-to-date
bison distro.
2021-03-31 14:26:10 +02:00
Marko Mäkelä
d6d3d9ae2f Merge 10.2 into 10.3 2021-03-31 08:01:03 +03:00
Vladislav Vaintroub
add24e7889 Windows - suppress nonsensical(for this OS) system check.
Amends 48141f3c17
2021-03-30 16:15:24 +11:00
Marko Mäkelä
19052b6deb Merge 10.2 into 10.3 2021-03-18 12:34:48 +02:00
Vladislav Vaintroub
f2c79eda4b MDEV-24554 Windows authenticode signing stopped working
Change the default timestamping URL, again
http://timestamp.globalsign.com/?signature=sha2 seems to work fine atm
2021-03-16 00:15:34 +01:00
Vicențiu Ciorbaru
13f0e1e139 Merge branch '10.2' into 10.3 2021-02-23 21:43:05 +02:00
Vicențiu Ciorbaru
9e259d58c2 Remove race condition during make dist
Introduced by 85828b8f22

This is running 2 git processes in parallel, which, if unlucky can cause
either of them to fail with "File already exists" error.
2021-02-23 17:26:08 +02:00
Marko Mäkelä
5a1a714187 Merge 10.2 into 10.3 (except MDEV-17556)
The fix of MDEV-17556 (commit e25623e78a
and commit 61a362c949) has been
omitted due to conflicts and will have to be applied separately later.
2021-01-11 09:41:54 +02:00
Vladislav Vaintroub
3b548d3bbf MDEV-24554 Do not use verisign server for authenticode timestamping 2021-01-09 18:34:28 +01:00
Marko Mäkelä
c7f322c91f Merge 10.2 into 10.3 2020-11-02 15:48:47 +02:00
Sergei Golubchik
c790218612 Fix RPM packaging on cmake 3.18+
cmake has caught up and since version 3.18 it started supporting
CPACK_RPM_POST_TRANS_SCRIPT_FILE, something we've supported for
two years and cmake 2.8.11. Both implementation add %posttrans tag
and rpmbuild gets confused.

Disable our implementation for cmake 3.18+
2020-10-30 10:32:59 +01:00
Sergei Golubchik
6cefe7d31e cleanup: use predefined CMAKE_DL_LIBS
instead of, say, MY_SEARCH_LIBS(dlopen dl LIBDL)
2020-10-23 13:37:26 +02:00
Marko Mäkelä
e3d692aa09 Merge 10.2 into 10.3 2020-10-22 08:26:28 +03:00
Marko Mäkelä
620ea816ad Merge 10.1 into 10.2 2020-10-21 14:02:04 +03:00
Daniel Black
b4c225ac35 MDEV-23887: check_linker_flags correct for old cmake compatibility
It was only from CMake-3.14.0 that CMAKE_REQUIRED_LINK_OPTIONS
was used in CHECK_CXX_SOURCE_COMPILES. Without this, it could be
the case (as was on OSX) that a flag was never checked in
CHECK_CXX_SOURCE_COMPILES, the CHECK successfully passed, but
failed at link time.

As such we use CMAKE_REQUIRED_LIBRARIES to include the flags to check
as its compatible enough with the cmake versions for non-Windows
compilers/linkers.

Tested on x86_64 with:
* 3.11.4
* 3.17.4

Corrects: 7473e1841c

In the future:
* cmake >=3.14.0 can use CMAKE_REQUIRED_LINK_OPTIONS
* cmake >=3.18.0 can use CHECK_LINKER_FLAG (with policy CMP0057 NEW)
(e.g: commit c7ac2deff9a2c965887dcc67cbf2a3a7c3e0123d)

CMAKE_REQUIRED_LIBRARIES suggested by serg@mariadb.com

Reviewed-by: anel@mariadb.org
2020-10-21 19:11:02 +11:00
Oleksandr Byelkin
c32f71af7e Merge branch '10.2' into 10.3 2020-08-03 13:41:29 +02:00
Oleksandr Byelkin
ef7cb0a0b5 Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
Karthik Kamath
e6cb263ef3 MDEV-15961: Fix stacktraces under FreeBSD (aarch64)
Largely based on MySQL commit
75271e51d6

MySQL Ref:
    BUG#24566529: BACKPORT BUG#23575445 TO 5.6

    (cut)
    Also, the PTR_SANE macro which tries to check if a pointer
    is invalid (used when printing pointer values in stack traces)
    gave false negatives on OSX/FreeBSD. On these platforms we
    now simply check if the pointer is non-null. This also removes
    a sbrk() deprecation warning when building on OS X. (It was
    before only disabled with building using XCode).

Removed execinfo path of MySQL patch that was already included.

sbrk doesn't exist on FreeBSD aarch64.

Removed HAVE_BSS_START based detection and replaced with __linux__
as it doesn't exist on OSX, Solaris or Windows.  __bss_start
exists on mutiple Linux architectures.

Tested on FreeBSD and Linux x86_64. Being in FreeBSD ports for 2
years implies a good testing there on all FreeBSD architectures there
too. MySQL-8.0.21 code is functionally identical to original commit.
2020-07-28 11:10:25 +10:00
Marko Mäkelä
acc58fd835 Merge 10.2 into 10.3 2020-07-20 15:11:59 +03:00
Marko Mäkelä
ca9276e37e Merge 10.1 into 10.2 2020-07-20 14:53:24 +03:00
Daniel Black
7473e1841c check_linker_flag: use for linker flags
-Wl,-z,relro,-z,now are linker flags and should
be checked as such.

TODO: perform module, exe shared checks separately
rather than a pure linker check.
2020-07-15 09:23:53 +03:00
Marko Mäkelä
8a0944080c Merge 10.2 into 10.3 2020-07-14 22:59:19 +03:00
Marko Mäkelä
646a6005e7 Merge 10.1 into 10.2 2020-07-14 15:10:59 +03:00
Vicențiu Ciorbaru
f18c5a7ed7 MDEV-23114 AUTH_PAM plugin can not be disabled when using mysql_release config
When setting the PLUGIN_AUTH_PAM variable, mark it as a "CACHE" variable
so it can be overridden by the user.
2020-07-07 17:59:47 +03:00
Marko Mäkelä
1df1a63924 Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
Marko Mäkelä
ea2bc974dc Merge 10.1 into 10.2 2020-07-01 12:03:55 +03:00
Sergei Golubchik
6d3747a294 make rocksdb cmake checks less verbose on repeat
* fix FindLZ4 to follow convention (LIBRARIES, not LIBRARY)
* remove redundant checks from rocksdb/CMakeLists.txt
* put all checks through the same macro that uniformly
  checks for a package, prints the message, adds definition
2020-07-01 09:21:23 +02:00
Otto Kekäläinen
2ed415765a Fix RocksDB detection of ZSTD
The library finder needs to have capitals in its name so that FIND_PACKAGE
will load the correct finder and actually detect that libzstd is available.

Without this change the CMake would just always silently skip ZSTD since
it would never find it.

Simplify Debian autopkgtest RocksDB part and make it more verbose so that
future regressions like this are easier to debug.

Also remove QUIET from the RocksDB FIND_PACKAGE call so that it is easier
to read in build logs what libraries were detected. Also add missing
underscores to error messages.
2020-07-01 09:21:23 +02:00
Daniel Black
37c88445e3 mtr: use env for perl
On FreeBSD, perl isn't in /usr/bin, its in /usr/local/bin or
elsewhere in the path.

Like storage/{maria/unittest/,}ma_test_* , we use /usr/bin/env to
find perl and run it.
2020-06-23 03:24:46 +02:00
Vladislav Vaintroub
b1b9803cb8 Disable dtrace probes on Windows.
Apparently, in Win10, dtrace is avaialable, but it does not work with
MariaDB user probes
2020-06-20 01:02:05 +02:00
Marko Mäkelä
8300f639a1 Merge 10.2 into 10.3 2020-06-02 10:25:11 +03:00
Sergei Golubchik
4832b751ad cmake: quieter 2020-05-31 11:29:43 +02:00
Marko Mäkelä
e9aaa10c11 Merge 10.2 into 10.3 2020-05-29 22:21:19 +03:00
Sergei Golubchik
2c9c9acbfc bintars should use bundled PCRE 2020-05-27 15:56:40 +02:00
Sergei Golubchik
04726f2920 get rid of cmake warning 2020-05-27 15:56:40 +02:00
Sergei Golubchik
8cf589218f optimize performance of the build in a fresh clone
don't fetch the complete history of all submodules, it's rarely needed
2020-05-27 15:56:40 +02:00
Sergei Golubchik
39c141b4ae don't include .git files in source packages
the existing ".git/" rule only filters out .git directories,
but as we have submodules now, we have to filter out .git files too.
2020-05-27 15:56:40 +02:00
Sergei Golubchik
607467bd63 Merge branch '10.2' into 10.3 2020-05-09 20:20:02 +02:00
Sergei Golubchik
7337abd2f7 MDEV-22123 On RHEL8 mariadb-server is not provided
setup alternative name for rhel8/centos8

use correct C/C version when providing mariadb-connector-c
and other changes for installation over distro packages to work:

  dnf install mariadb-server
  dnf install --allowerasing MariaDB-{server,common,client,shared}*.rpm
2020-05-09 20:06:10 +02:00
Oleksandr Byelkin
985f63cce1 Merge branch '10.1' into 10.2 2020-05-08 13:38:36 +02:00
Sergei Golubchik
9c5d06a6d3 MDEV-21437 MariaDB's SUSE/SLES packages don't "provide" all of the same capabilities as the platform's default packages 2020-05-05 19:37:01 +02:00
Marko Mäkelä
1fbdcada73 Merge 10.2 into 10.3 2020-04-28 22:29:13 +03:00
Sergei Golubchik
01f8f33b43 MDEV-21913 Add pam_user_map.so file to binary tarball package 2020-04-28 17:51:38 +02:00
Marko Mäkelä
c06845d6f0 Merge 10.1 into 10.2 2020-04-27 13:28:13 +03:00
Sergei Golubchik
f462fbac61 MDEV-22078 MariaDB-compat missing from MariaDB 10.4 CentOS 8 Yum Repo
Backport INSALL_SYMLINK cmake macro from 10.3.
It'll make libmysqlclient_r.* symlinks to link to the actual
shared library file, not to another symlink.

As a bonus it'll fix cmake warning about deprecated LOCATION property
2020-04-27 09:11:29 +02:00
Marko Mäkelä
84db10f27b Merge 10.2 into 10.3 2020-04-15 09:56:03 +03:00
Marko Mäkelä
ccaec18b39 Merge 10.1 into 10.2 2020-04-14 16:13:35 +03:00
Marko Mäkelä
31eaa2029f MDEV-19740: Have MYSQL_MAINTAINER_MODE only enable -Werror
Let us enable all GCC and clang warnings independently of the
MYSQL_MAINTAINER_MODE setting for both Debug and RelWithDebInfo
builds, and have MYSQL_MAINTAINER_MODE only enable -Werror.

The default setting of MYSQL_MAINTAINER_MODE=AUTO will continue
to apply the -Werror only to CMAKE_BUILD_TYPE=Debug. To build
a debug version without -Werror, MYSQL_MAINTAINER_MODE=OFF can
be used.
2020-04-01 15:16:11 +03:00
Vicențiu Ciorbaru
1d99e4d674 Merge branch '10.2' into 10.3 2020-03-08 11:02:55 +02:00
Daniel Black
6610532170 Update install layout to account for multi-arch setup
Cleanup install_layout to account for multi-arch setup and remove
redundant defines in debian rules.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2020-03-08 09:25:22 +02:00
Oleksandr Byelkin
440452628d Merge branch '10.2' into 10.3 2020-03-06 23:28:26 +01:00
Alexey Bychko
8382f10691 MENT-606 Error while setting value 'aes_ctr' to 'file-key-management-encryption-algorithm'
cmake cannot detect openssl headers on Mac during checks.
the solution is to add path to openssl includes to
CMAKE_REQUIRED_INCLUDES before checks.
2020-02-26 07:48:05 +01:00
Daniel Black
f6b9a29820 MDEV-16662: cmake remove empty INSTALL_DEBUG_TARGET
No adverse effects since this was made a null function in
6b53f9d781.

This function had the last remaining cmake CMP0026 violation.
2020-02-25 08:11:20 +01:00
Daniel Black
c749eb2b41 MDEV-16662: cmake: CMP0026 compatible for dtrace
cmake enabling -DENABLE_DTRACE=ON is particularlly noisy with CMP0026
errors.

Fixed in the same way as 6b53f9d781
2020-02-25 08:10:17 +01:00
Anel Husakovic
0d1dd2e79d Clean wrong cherry-pick from previous commit
- Delete variable HAVE_PTHREAD_CONDATTR_SETCLOCK and check
- Delete second HAVE_PTHREAD_KEY_DELETE
2020-02-20 09:25:11 +01:00
Daniel Black
fb01cc3766 my_getncpus based on threads available
Detecting the cpus based on sysconf of the online CPUs can significantly
over estimate the number of cpus available.

Wheither via numactl, cgroups, taskset, systemd constraints, docker
containers and probably other mechanisms, the number of threads mysqld
can be run on can be quite less.

As such we use the pthread_getaffinity_np function on Linux and FreeBSD
(identical API) to get the number of CPUs.

The number of CPUs is the default for the thread_pool_size and a too
high default will resulting in large memory usage and high context
switching overhead.

Closes PR #922
2020-02-20 08:44:20 +01:00
Oleksandr Byelkin
58b70dc136 Merge branch '10.2' into 10.3 2020-02-10 20:34:16 +01:00
Anel Husakovic
235d7c6f54 Ignore /lib64 for rpm 2020-02-10 14:32:10 +01:00
Aurélien LEQUOY
236aed3f5f MDEV-21656: Wrong directory for pam_user_map.so
JIRA:https://jira.mariadb.org/browse/MDEV-17292

Closes #1443
2020-02-06 07:48:37 +01:00
Oleksandr Byelkin
ceda5f724f Merge branch '10.2' into 10.3 2020-01-24 14:16:20 +01:00
Sergei Golubchik
8870f18e1d MDEV-17292 Package the pam_user_map module 2020-01-21 10:56:47 +01:00
Sergei Golubchik
42049f9d39 cleanup: simplify install_layout.cmake 2020-01-21 10:56:47 +01:00
Sergei Golubchik
dc7d0b5030 RPM packaging fixes for FC31
Obsoletes: cannot contain (x86-64) anymore

Python shebang must be specific
2019-11-28 16:01:02 +01:00
Vlad Lesin
6718d3bc32 MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOS
The fix consists of three commits backported from 10.3:

1) Cleanup isnan() portability checks

(cherry picked from commit 7ffd7fe962)

2) Cleanup isinf() portability checks

Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2
build would cache undefined HAVE_ISINF from 10.2, whereas it is expected
to be 1 in 10.3.

std::isinf() seem to be available on all supported platforms.
(cherry picked from commit bc469a0bdf)

3) Use std::isfinite in C++ code

This is addition to parent revision fixing build failures.

(cherry picked from commit 54999f4e75)
2019-11-19 16:28:15 +03:00
Vladislav Vaintroub
73c864b5d1 Fix clang-cl build on Windows 2019-10-30 12:25:07 +01:00
Alexander Barkov
b6bb64e54a Merge remote-tracking branch 'origin/10.2' into 10.3 2019-09-24 23:05:09 +04:00
Alexander Barkov
0a359d7627 Merge remote-tracking branch 'origin/10.1' into 10.2 2019-09-24 19:19:25 +04:00
Alexander Barkov
5f118b26c8 Merge remote-tracking branch 'origin/5.5' into 10.1 2019-09-24 11:18:39 +04:00
Marko Mäkelä
c016ea660e Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
Ryan Coe
f541d3f18e MDEV-20596 Configure fails with newer CMake
Fix build error with newer cmake

Fixes the following build error:

CMake Error at cmake/os/Linux.cmake:29 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:101 (INCLUDE)

CMake Error at cmake/os/Linux.cmake:29 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:101 (INCLUDE)

The error happens when CMAKE_SHARED_LINKER_{LANG}_FLAGS is not set.
Force the variable to be set to "" as input to prevent this.

Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2019-09-20 06:39:39 +03:00
Vladislav Vaintroub
99ecb33389 MDEV-20570 : Packaging fails "The specified timestamp server either could not be reached"
On  Windows, during packaging step, if signing fails, retry
signtool again without timestamp parameter.

Fixes sporadic (rare) failures on buildbot
2019-09-12 15:15:33 +02:00
Marko Mäkelä
da9201dd5b Merge 10.2 into 10.3 2019-09-10 09:25:20 +03:00
Vladislav Vaintroub
879c9ddce7 MDEV-20542 Windows enable/d2OptimizeHugeFunctions 2019-09-09 19:57:25 +02:00
Vladislav Vaintroub
a895c68c58 On Windows, treat linker warnings as errors, if
MYSQL_MAINTAINER_MODE is ERR
2019-09-09 13:52:30 +02:00
Sergei Golubchik
f80e02e043 Merge branch '10.2' into 10.3 2019-09-06 16:58:39 +02:00
Sergei Golubchik
39e5b76ef1 use a shorter name for sources in debuginfo rpms
have the same path as in source rpms, don't build them differently
2019-09-06 16:35:56 +02:00
Marko Mäkelä
1a3c365953 Merge 10.2 into 10.3 2019-08-29 12:00:12 +03:00
Marko Mäkelä
5f35e103ee Merge 10.1 into 10.2 2019-08-28 15:23:21 +03:00
Marko Mäkelä
32ec5fb979 Merge 10.2 into 10.3 2019-08-21 15:23:45 +03:00
Sergei Golubchik
91fdb931fa ensure that pam plugin is present in release packages 2019-08-20 15:38:58 +02:00
Sergei Golubchik
62cc991bc8 really make CPACK_RPM_DEBUGINFO_PACKAGE configurable 2019-08-20 15:38:58 +02:00
Marko Mäkelä
68e6c2d768 MDEV-20377: Introduce cmake -DWITH_MSAN:BOOL=ON
MemorySanitizer is a compile-time instrumentation layer in clang and GCC.
Together with AddressSanitizer mostly makes the run-time instrumentation
of Valgrind redundant. It is a little more tricky to set up, because
running with uninstrumented libraries will lead into false positives.

You will need an instrumented libc++, and you should use
-stdlib=libc++ instead of the default libstdc++. To build the
instrumented library, you can refer to
https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo
or you can adapt these steps that worked for me, for clang-8 version 8.0.1:

cd /mariadb
sudo apt source libc++-8-dev
cd llvm-toolchain-8-8.0.1
mkdir libc++msan; cd libc++msan
cmake ../libcxx -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory \
-DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8

Then, in your MariaDB build directory, you have to compile with
libc++ and bundled libraries, such as WITH_SSL=bundled, WITH_ZLIB=bundled.
For uninstrumented system libraries, you will get false positives for
uninitialized values. Like this:

cmake -DWITH_MSAN=ON -DWITH_SSL=bundled -DWITH_ZLIB=bundled \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' ..

Note: you should also add -O2 to the compiler options, or you may
get crashes due to stack overflow.

Finally, to run tests, you must replace libc++ with the instrumented one:

LD_LIBRARY_PATH=/mariadb/llvm-toolchain-8-8.0.1/libc++msan/lib \
MSAN_OPTIONS=abort_on_error=1 \
./mtr --big-test --parallel=auto --force --retry=0

Failure to do so will report numerous false positives related to
operations on std::string and the like.

This is work in progress. Some issues will still have to be fixed
for WITH_MSAN to be usable. See MDEV-20377 for details.
2019-08-19 20:56:26 +03:00
Aleksey Midenkov
6dd3f24090 MDEV-19740 Debug build of 10.3.15 FTBFS
* Replace LINT_INIT for non-struct types with ctor initializers;
* Check BUILD_DEPS list is not empty so REMOVE_DUPLICATES won't throw
  error.
2019-08-19 10:38:24 +03:00
Eugene Kosov
0f83c8878d Merge 10.2 into 10.3 2019-07-16 18:39:21 +03:00
Sergei Golubchik
ab3a6ca670 cleanup: CPACK_RPM_* package description
add cmake helper macro SET_IF_UNSET()
and use it for CPACK_* variables
2019-07-10 09:02:10 +02:00
Eugene Kosov
26c389b7b7 Merge 10.1 into 10.2 2019-07-09 13:22:22 +03:00
Sergei Golubchik
971bef89ab MDEV-19481 mariadb-10.3.15-linux-systemd-x86_64/bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' and 'GLIBCXX_3.4.21' not found
don't ignore LIBSYSTEMD_LDFLAGS when trying out systemd

(and put them in LIBSYSTEMD, because MYSQLD_LINK_FLAGS has stuff like
-lmtmalloc and is used only for mysqld, not for, say, explain_filename-t)

LIBSYSTEMD_LDFLAGS come from libsystemd.pc via pkg-config
2019-07-04 18:19:52 +02:00
Oleksandr Byelkin
4a3d51c76c Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
Marko Mäkelä
4bbd8be482 Merge 10.1 into 10.2 2019-06-12 10:30:01 +03:00