Solaris.build fix #3843 and #3643 (#3939)

* try fix compilation for solaris

* this commit for issue #3843 and #3643
changes in Types.h allow ignore problem with declaration of std::int8_t. int8_t can be defined as char or signed char. IMHO we need strong types for Poco::Int's

Envelop.cpp contains initializer for EVP_CIPHER_CTX_init, because this function prototype depends on openssl version.

Application.cpp contains includes especial for SOLARIS, for ioctl support

ClassLoaderTest.cpp and SharedLibraryTest.cpp contains changes because loadlibrary(dlopen) doesn't load library from current directory by default

LocalDateTimeTest.cpp contains changes because SOLARIS use std::tm without tm_gmtoff

* fix : define of SOLARIOS OS in LocalDateTimeTest

* remove unnecessary wrapper

* fix output dir for windows build with multi-config build

* try to fix bug with unixodbc version in linux-builds
[read here](https://github.com/microsoft/linux-package-repositories/issues/36)

* try to fix bug with unixodbc version in linux-builds
[read here](https://github.com/microsoft/linux-package-repositories/issues/36)

* fix : warning in main cmake for if-condition for multi-config build
fix : error for linux-gcc-make-cxx20, use --allow-downgrades for unixodbc

* fix : warning for cmake windows builds
revert changes for linux-gcc-make-cxx20

* revert ci.yml, remove unixodbc version

* try re-run build

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
This commit is contained in:
Alexander B 2023-03-18 09:28:47 +03:00 committed by GitHub
parent 66e93f98cc
commit 3852a6b6c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 29 deletions

View File

@ -153,7 +153,7 @@ jobs:
CPPUNIT_IGNORE: class CppUnit::TestCaller<class PathTest>.testFind,class CppUnit::TestCaller<class ICMPSocketTest>.testSendToReceiveFrom,class CppUnit::TestCaller<class ICMPClientTest>.testPing,class CppUnit::TestCaller<class ICMPClientTest>.testBigPing,class CppUnit::TestCaller<class ICMPSocketTest>.testMTU,class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy,class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
steps:
- uses: actions/checkout@v2
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON -DCMAKE_CXX_FLAGS="/MP /EHsc" -DCMAKE_C_FLAGS=/MP
- run: cmake --build cmake-build --config Release
- run: >-
cd cmake-build;
@ -197,7 +197,7 @@ jobs:
CPPUNIT_IGNORE: class CppUnit::TestCaller<class PathTest>.testFind,class CppUnit::TestCaller<class ICMPSocketTest>.testSendToReceiveFrom,class CppUnit::TestCaller<class ICMPClientTest>.testPing,class CppUnit::TestCaller<class ICMPClientTest>.testBigPing,class CppUnit::TestCaller<class ICMPSocketTest>.testMTU,class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy,class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
steps:
- uses: actions/checkout@v2
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON -DCMAKE_CXX_FLAGS="/MP /EHsc" -DCMAKE_C_FLAGS=/MP
- run: cmake --build cmake-build --config Release
- run: >-
cd cmake-build;

View File

@ -21,6 +21,14 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Windows DLLs are "runtime" for CMake. Output them to "bin" like the Visual Studio projects do.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Reset output dirs for multi-config builds
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
endforeach(OUTPUTCONFIG)
# Append our module directory to CMake
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

View File

@ -20,12 +20,13 @@
#include "Poco/Foundation.h"
#include <cstdint>
#include <type_traits>
namespace Poco {
using Int8 = std::int8_t;
using Int8 = std::conditional<std::is_same<signed char, std::int8_t>::value, std::int8_t, signed char>::type;
using UInt8 = std::uint8_t;
using Int16 = std::int16_t;
using UInt16 = std::uint16_t;
@ -49,7 +50,7 @@ using UIntPtr = std::uintptr_t;
#if defined(__LP64__)
#define POCO_PTR_IS_64_BIT 1
#define POCO_LONG_IS_64_BIT 1
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_AIX || POCO_OS == POCO_OS_QNX
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_AIX || POCO_OS == POCO_OS_QNX || POCO_OS == POCO_OS_SOLARIS
#define POCO_INT64_IS_LONG 1
#endif
#endif

View File

@ -14,6 +14,7 @@
#include "Poco/ClassLoader.h"
#include "Poco/Manifest.h"
#include "Poco/Exception.h"
#include "Poco/Path.h"
#include "TestPlugin.h"
@ -39,14 +40,15 @@ void ClassLoaderTest::testClassLoader1()
{
std::string path = "TestLibrary";
path.append(SharedLibrary::suffix());
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
ClassLoader<TestPlugin> cl;
assertTrue (cl.begin() == cl.end());
assertNullPtr (cl.findClass("PluginA"));
assertNullPtr (cl.findManifest(path));
assertNullPtr (cl.findManifest(libraryPath.toString()));
assertTrue (!cl.isLibraryLoaded(path));
assertTrue (!cl.isLibraryLoaded(libraryPath.toString()));
try
{
@ -63,7 +65,7 @@ void ClassLoaderTest::testClassLoader1()
try
{
const ClassLoader<TestPlugin>::Manif& POCO_UNUSED manif = cl.manifestFor(path);
const ClassLoader<TestPlugin>::Manif& POCO_UNUSED manif = cl.manifestFor(libraryPath.toString());
fail("not found - must throw exception");
}
catch (NotFoundException&)
@ -80,22 +82,23 @@ void ClassLoaderTest::testClassLoader2()
{
std::string path = "TestLibrary";
path.append(SharedLibrary::suffix());
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
ClassLoader<TestPlugin> cl;
cl.loadLibrary(path);
cl.loadLibrary(libraryPath.toString());
assertTrue (cl.begin() != cl.end());
assertNotNullPtr (cl.findClass("PluginA"));
assertNotNullPtr (cl.findClass("PluginB"));
assertNotNullPtr (cl.findClass("PluginC"));
assertNotNullPtr (cl.findManifest(path));
assertNotNullPtr (cl.findManifest(libraryPath.toString()));
assertTrue (cl.isLibraryLoaded(path));
assertTrue (cl.manifestFor(path).size() == 3);
assertTrue (cl.isLibraryLoaded(libraryPath.toString()));
assertTrue (cl.manifestFor(libraryPath.toString()).size() == 3);
ClassLoader<TestPlugin>::Iterator it = cl.begin();
assertTrue (it != cl.end());
assertTrue (it->first == path);
assertTrue (it->first == libraryPath.toString());
assertTrue (it->second->size() == 3);
++it;
assertTrue (it == cl.end());
@ -162,7 +165,7 @@ void ClassLoaderTest::testClassLoader2()
meta2.destroy(pPlugin);
assertTrue (!meta2.isAutoDelete(pPlugin));
cl.unloadLibrary(path);
cl.unloadLibrary(libraryPath.toString());
}
@ -170,23 +173,24 @@ void ClassLoaderTest::testClassLoader3()
{
std::string path = "TestLibrary";
path.append(SharedLibrary::suffix());
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
ClassLoader<TestPlugin> cl;
cl.loadLibrary(path);
cl.loadLibrary(path);
cl.unloadLibrary(path);
cl.loadLibrary(libraryPath.toString());
cl.loadLibrary(libraryPath.toString());
cl.unloadLibrary(libraryPath.toString());
assertTrue (cl.manifestFor(path).size() == 3);
assertTrue (cl.manifestFor(libraryPath.toString()).size() == 3);
ClassLoader<TestPlugin>::Iterator it = cl.begin();
assertTrue (it != cl.end());
assertTrue (it->first == path);
assertTrue (it->first == libraryPath.toString());
assertTrue (it->second->size() == 3);
++it;
assertTrue (it == cl.end());
cl.unloadLibrary(path);
assertNullPtr (cl.findManifest(path));
cl.unloadLibrary(libraryPath.toString());
assertNullPtr (cl.findManifest(libraryPath.toString()));
}

View File

@ -477,7 +477,11 @@ void LocalDateTimeTest::testTimezone2()
std::time_t t = ldt.timestamp().epochTime();
std::tm then;
then = *std::localtime(&t);
#if POCO_OS == POCO_OS_SOLARIS
assertTrue((mktime(&then)-t) * 1000 == ldt.tzd());
#else
assertTrue (then.tm_gmtoff == ldt.tzd());
#endif
}
unsetenv("TZ");
}

View File

@ -13,6 +13,7 @@
#include "CppUnit/TestSuite.h"
#include "Poco/SharedLibrary.h"
#include "Poco/Exception.h"
#include "Poco/Path.h"
using Poco::SharedLibrary;
@ -38,10 +39,12 @@ void SharedLibraryTest::testSharedLibrary1()
{
std::string path = "TestLibrary";
path.append(SharedLibrary::suffix());
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
SharedLibrary sl;
assertTrue (!sl.isLoaded());
sl.load(path);
assertTrue (sl.getPath() == path);
sl.load(libraryPath.toString());
assertTrue (sl.getPath() == libraryPath.toString());
assertTrue (sl.isLoaded());
assertTrue (sl.hasSymbol("pocoBuildManifest"));
assertTrue (sl.hasSymbol("pocoInitializeLibrary"));
@ -72,8 +75,10 @@ void SharedLibraryTest::testSharedLibrary2()
{
std::string path = "TestLibrary";
path.append(SharedLibrary::suffix());
SharedLibrary sl(path);
assertTrue (sl.getPath() == path);
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
SharedLibrary sl(libraryPath.toString());
assertTrue (sl.getPath() == libraryPath.toString());
assertTrue (sl.isLoaded());
GimmeFiveFunc gimmeFive = (GimmeFiveFunc) sl.getSymbol("gimmeFive");
@ -105,12 +110,14 @@ void SharedLibraryTest::testSharedLibrary3()
path = "TestLibrary";
path.append(SharedLibrary::suffix());
sl.load(path);
Poco::Path libraryPath = Poco::Path::current();
libraryPath.append(path);
sl.load(libraryPath.toString());
assertTrue (sl.isLoaded());
try
{
sl.load(path);
sl.load(libraryPath.toString());
failmsg("library already loaded - must throw exception");
}
catch (LibraryAlreadyLoadedException&)

View File

@ -42,6 +42,10 @@
#include "Poco/SignalHandler.h"
#include <stdio.h>
#include <sys/ioctl.h>
#if POCO_OS == POCO_OS_SOLARIS
#include <stropts.h>
#include <termios.h>
#endif
#endif
#include "Poco/UnicodeConverter.h"