Skip to content

Commit 61760ae

Browse files
authored
Put the test header after the boost includes to solve with SSL=OFF at Windows [HZ-5198 ] (hazelcast#1346)
Put the test header after the boost includes. Solves windows build problem with SSL=OFF. fixes hazelcast#1328 fixes HZ-5198 With the new Visual studio version, only Boost 1.80.0 and later can compile. Hence, changed the minimum tested boost version for Windows to 1.80.0 for windows nightly tests. Trying to test older Boost version than 1.80.0 on windows should not be needed unless a specific ask from a user. This should be acceptable since we still test older Boost version(1.73.0) at Linux anyway. Re-enabled the WITH_OPENSSL=OFF builds of windows for the PR builder. See an example test run as green in [this](https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/18808639485) build (had to use branch run due to workflow change).
1 parent a24e6b5 commit 61760ae

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

.github/actions/build-test/windows/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ runs:
9090
tar xzf ${{ inputs.BOOST_ARCHIVE_NAME }}
9191
rm ${{ inputs.BOOST_ARCHIVE_NAME }}
9292
cd ${{ inputs.BOOST_FOLDER_NAME }}
93-
.\bootstrap.bat
93+
$vcvars = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" -ErrorAction SilentlyContinue
94+
if (-not $vcvars) { $vcvars = Get-ChildItem "C:\Program Files\Microsoft Visual Studio" -Recurse -Filter "vcvarsall.bat" | Select-Object -First 1 }
95+
cmd /c "`"$($vcvars.FullName)`" x64 > nul 2>&1 && set" | ForEach-Object { if ($_ -match "^(.*?)=(.*)$") { [Environment]::SetEnvironmentVariable($matches[1], $matches[2]) } }
96+
.\bootstrap.bat msvc
9497
# Build the libs for:
9598
# - Thread - https://www.boost.org/libs/thread/
9699
# - Chrono - https://www.boost.org/libs/chrono/
97100
# - Atomic - https://www.boost.org/libs/atomic/
98-
.\b2 address-model=${{ inputs.ARCH_ADDRESS_MODEL }} --with-thread --with-chrono --with-atomic install
101+
.\b2 address-model=${{ inputs.ARCH_ADDRESS_MODEL }} toolset=msvc --with-thread --with-chrono --with-atomic install
99102
cd ..
100103
Remove-Item ${{ inputs.BOOST_FOLDER_NAME }} -Recurse -Force
101104

.github/workflows/build-pr.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ jobs:
216216
token: ${{ secrets.GH_TOKEN }}
217217

218218
- uses: ./.github/actions/build-test/windows
219-
if: ${{ matrix.with_openssl.toggle == 'ON' }}
220219
with:
221220
GH_TOKEN: ${{ secrets.GH_TOKEN }}
222221
BOOST_VERSION: ${{ env.boost_version }}

.github/workflows/nightly-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
vc_boost:
23-
- name: msvc-latest_boost_1730
23+
- name: msvc-latest_boost_1800
2424
image: 'windows-latest'
25-
boost_url: 'https://archives.boost.io/release/1.73.0/source/boost_1_73_0.tar.gz'
26-
boost_archive_name: 'boost_1_73_0.tar.gz'
27-
boost_folder_name: 'boost_1_73_0'
28-
boost_include_folder: 'C:\Boost\include\boost-1_73'
25+
boost_url: 'https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz'
26+
boost_archive_name: 'boost_1_80_0.tar.gz'
27+
boost_folder_name: 'boost_1_80_0'
28+
boost_include_folder: 'C:\Boost\include\boost-1_80'
2929
- name: msvc-latest_boost_1890
3030
image: 'windows-latest'
3131
boost_url: 'https://archives.boost.io/release/1.89.0/source/boost_1_89_0.tar.gz'

CMakeLists.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ install(
267267

268268
if (BUILD_TESTS)
269269
add_subdirectory(hazelcast/test)
270-
else()
271-
message(STATUS "BUILD_TESTS is disabled.")
272270
endif()
273271

274272
if (BUILD_EXAMPLES)
@@ -279,12 +277,12 @@ message(STATUS "Configuration summary:")
279277
if (NOT is_multi_config)
280278
message(STATUS " CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
281279
endif()
282-
message(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
283-
message(STATUS " WITH_OPENSSL = ${WITH_OPENSSL}")
284-
message(STATUS " DISABLE_LOGGING = ${DISABLE_LOGGING}")
285-
message(STATUS " CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
286-
message(STATUS " BUILD_TESTS = ${BUILD_TESTS}")
287-
message(STATUS " BUILD_EXAMPLES = ${BUILD_EXAMPLES}")
288-
message(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
289-
message(STATUS " CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}")
290-
message(STATUS " CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}")
280+
message(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
281+
message(STATUS " WITH_OPENSSL = ${WITH_OPENSSL}")
282+
message(STATUS " DISABLE_LOGGING = ${DISABLE_LOGGING}")
283+
message(STATUS " CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
284+
message(STATUS " BUILD_TESTS = ${BUILD_TESTS}")
285+
message(STATUS " BUILD_EXAMPLES = ${BUILD_EXAMPLES}")
286+
message(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
287+
message(STATUS " CMAKE_CXX_FLAGS_DEBUG = ${CMAKE_CXX_FLAGS_DEBUG}")
288+
message(STATUS " CMAKE_CXX_FLAGS_RELEASE = ${CMAKE_CXX_FLAGS_RELEASE}")

hazelcast/test/src/ClientTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
17-
#include "ClientTest.h"
18-
1916
#include <chrono>
2017
#include <thread>
2118

@@ -29,6 +26,8 @@
2926
#include "remote_controller_client.h"
3027
#include "TestHelperFunctions.h"
3128

29+
#include "ClientTest.h"
30+
3231
namespace hazelcast {
3332
namespace client {
3433
namespace test {

0 commit comments

Comments
 (0)