-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug #33732838 Bundle the openssl command line binary into the test ar…
…chive & expose it in mtr For builds with "custom" OpenSSL: -DWITH_SSL=<path/to/custom/openssl> we now look for the 'openssl' binary, and copy it into the build tree. We don't want to install a binary called 'openssl' in a public bin/ directory, so we rename it to 'my_openssl'. 'my_openssl' is also INSTALLed as part of the Test component. Extend mysql-test-run.pl to look for my_openssl in the build/install directories, and set environment variable OPENSSL_EXECUTABLE. Use this variable in all mtr tests that need to invoke openssl. Fix regexps in check_openssl_version.inc. my $search_pattern_1= "0.9.*" matched '019' for ./bin/openssl version OpenSSL 1.1.1d 10 Sep 2019 and several tests were incorrectly skipped. Remove all usage of 'have_openssl_binary.inc'. Change-Id: Ib7f48acbc8f604e493cc84dcf9315f6c9abf1ea5
- Loading branch information
Tor Didriksen
committed
Mar 23, 2022
1 parent
81b729d
commit ab6239e
Showing
21 changed files
with
265 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License, version 2.0, | ||
# as published by the Free Software Foundation. | ||
# | ||
# This program is also distributed with certain software (including | ||
# but not limited to OpenSSL) that is licensed under separate terms, | ||
# as designated in a particular file or component or in included license | ||
# documentation. The authors of MySQL hereby grant you an additional | ||
# permission to link the program and your derivative works with the | ||
# separately licensed software that they have included with MySQL. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License, version 2.0, for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
SET(MSG_TXT | ||
"Copied OPENSSL_EXECUTABLE = ${executable_full_filename} to") | ||
IF(BUILD_IS_SINGLE_CONFIG) | ||
IF(EXISTS "${executable_name}") | ||
# MESSAGE(STATUS "${executable_name} already copied") | ||
RETURN() | ||
ENDIF() | ||
EXECUTE_PROCESS( | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
"${executable_full_filename}" "${executable_name}" | ||
) | ||
SET(MSG_TXT "${MSG_TXT} ${CWD}/${executable_name}") | ||
MESSAGE(STATUS "${MSG_TXT}") | ||
ELSE() | ||
IF(EXISTS "./${CMAKE_CFG_INTDIR}/${executable_name}") | ||
# MESSAGE(STATUS "${CMAKE_CFG_INTDIR}/${executable_name} already copied") | ||
RETURN() | ||
ENDIF() | ||
EXECUTE_PROCESS( | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
"${executable_full_filename}" "${CMAKE_CFG_INTDIR}/${executable_name}" | ||
) | ||
SET(MSG_TXT "${MSG_TXT} ${CWD}/${CMAKE_CFG_INTDIR}/${executable_name}") | ||
MESSAGE(STATUS "${MSG_TXT}") | ||
ENDIF() | ||
|
||
IF(LINUX) | ||
EXECUTE_PROCESS( | ||
COMMAND ${PATCHELF_EXECUTABLE} --version | ||
OUTPUT_VARIABLE PATCHELF_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
STRING(REPLACE "patchelf" "" PATCHELF_VERSION "${PATCHELF_VERSION}") | ||
|
||
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND | ||
PATCHELF_VERSION VERSION_LESS "0.14.5") | ||
SET(PATCHELF_PAGE_SIZE_ARGS --page-size ${CPU_PAGE_SIZE}) | ||
ENDIF() | ||
|
||
EXECUTE_PROCESS( | ||
COMMAND ${PATCHELF_EXECUTABLE} ${PATCHELF_PAGE_SIZE_ARGS} | ||
--set-rpath "$ORIGIN/../lib:$ORIGIN/../${INSTALL_PRIV_LIBDIR}" | ||
"./${executable_name}" | ||
) | ||
ENDIF(LINUX) | ||
|
||
IF(APPLE) | ||
MESSAGE(STATUS "CRYPTO_VERSION is ${CRYPTO_VERSION}") | ||
MESSAGE(STATUS "OPENSSL_VERSION is ${OPENSSL_VERSION}") | ||
EXECUTE_PROCESS( | ||
COMMAND otool -L ${CMAKE_CFG_INTDIR}/${executable_name} | ||
OUTPUT_VARIABLE OTOOL_OPENSSL_DEPS | ||
) | ||
|
||
STRING(REPLACE "\n" ";" DEPS_LIST ${OTOOL_OPENSSL_DEPS}) | ||
FOREACH(LINE ${DEPS_LIST}) | ||
IF(LINE MATCHES "libssl") | ||
STRING(REGEX MATCH "[ ]*([.a-zA-Z0-9/@_]+.dylib).*" UNUSED "${LINE}") | ||
MESSAGE(STATUS "dependency ${CMAKE_MATCH_1}") | ||
SET(LIBSSL_MATCH "${CMAKE_MATCH_1}") | ||
ENDIF() | ||
IF(LINE MATCHES "libcrypto") | ||
STRING(REGEX MATCH "[ ]*([.a-zA-Z0-9/@_]+.dylib).*" UNUSED "${LINE}") | ||
MESSAGE(STATUS "dependency ${CMAKE_MATCH_1}") | ||
SET(LIBCRYPTO_MATCH "${CMAKE_MATCH_1}") | ||
ENDIF() | ||
ENDFOREACH() | ||
|
||
IF(BUILD_IS_SINGLE_CONFIG) | ||
# install_name_tool -change old new file | ||
EXECUTE_PROCESS(COMMAND install_name_tool -change | ||
"${LIBSSL_MATCH}" "@loader_path/../lib/${OPENSSL_VERSION}" | ||
"./${executable_name}" | ||
) | ||
EXECUTE_PROCESS(COMMAND install_name_tool -change | ||
"${LIBCRYPTO_MATCH}" "@loader_path/../lib/${CRYPTO_VERSION}" | ||
"./${executable_name}" | ||
) | ||
EXECUTE_PROCESS( | ||
COMMAND chmod +w "./${executable_name}" | ||
) | ||
ELSE() | ||
# install_name_tool -change old new file | ||
EXECUTE_PROCESS(COMMAND install_name_tool -change | ||
"${LIBSSL_MATCH}" | ||
"@loader_path/../../lib/${CMAKE_CFG_INTDIR}/${OPENSSL_VERSION}" | ||
"./${CMAKE_CFG_INTDIR}/${executable_name}" | ||
) | ||
EXECUTE_PROCESS(COMMAND install_name_tool -change | ||
"${LIBCRYPTO_MATCH}" | ||
"@loader_path/../../lib/${CMAKE_CFG_INTDIR}/${CRYPTO_VERSION}" | ||
"./${CMAKE_CFG_INTDIR}/${executable_name}" | ||
) | ||
EXECUTE_PROCESS( | ||
COMMAND chmod +w "./${CMAKE_CFG_INTDIR}/${executable_name}" | ||
) | ||
ENDIF() | ||
ENDIF(APPLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.