Skip to content

Commit c654699

Browse files
Fix PR Builder failing to start (#1231)
The PR builder [is failing to even start the tests](#1222) due to remote controller now requiring Java 17. This is non-trivial to fix, as several other things have _also_ broken in the meantime. ### Force-merge required: `.github/workflows/build-pr.yml` is configured to use use `pull_request_target`, rather than `pull_request` - to allow execution of the action _on the target repository/branch_, allowing it's secrets to be accessed. The problem with this is what when these scripts contain an issue, **even if modified in a PR, the _existing_ scripts will still be executed** - meaning it's **impossible** to get the PR builder to pass, whatever you modify. As such, I've executed this PR in a branch (over a fork) and amended this behavior, so that the execution of this PR build can be properly observed in a [test run on a previous revision](https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/10506067493). This PR will then require a force-merge. Ideally this behaviour should change, but out-of-scope for this PR. ### Changes: - Centralised configuration _where possible_ - Java version - Java distribution - Hazelcast version - Upgraded Java runtimes to Java 17 - Upgraded Hazelcast dependency from `5.3.0-SNAPSHOT` to `5.3.0` - the `SNAPSHOT` is no longer available - this is the nearest (although now outdated) direct replacement (can and should be upgraded - [separately](#1225)) - Explicitly install the right Java / Maven versions on the runners, in favour of the bundled (outdated) versions - Refactor use of `maven-dependency-plugin` to specify a version - Currently implicitly uses the version bundled with Maven - but this has broken following Maven upgrade - Picks a version (not the latest!) that supports a custom download destination and a custom repository _simultaneously_ - Fix permissions issue installing `boost` on OSX - Fix `error: unqualified call to 'std::move'` by qualifying call Fixes: #1222, #1229, #1207, #1226 --------- Co-authored-by: ihsan <[email protected]>
1 parent a79e606 commit c654699

File tree

18 files changed

+231
-109
lines changed

18 files changed

+231
-109
lines changed

.github/config.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
JAVA_VERSION=17
2+
JAVA_DISTRIBUTION=temurin
3+
MAVEN_VERSION=3.9.9
4+
HAZELCAST_VERSION=5.3.0

.github/workflows/build-pr.yml

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,29 @@ jobs:
113113
ref: ${{ needs.get-refs.outputs.ref }}
114114
token: ${{ secrets.GH_TOKEN }}
115115

116+
- name: Read Config
117+
run: cat .github/config.env >> $GITHUB_ENV
118+
116119
- name: Install Necessary Packages
117120
run: |
118121
sudo apt-get update
119122
sudo apt-get install -y net-tools libssl-dev gdb gcovr curl
120123
- name: Download hazelcast-enterprise-tests.jar
121124
run: |
122-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
125+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
123126
- name: Install Boost
124127
run: |
125128
sudo ./scripts/install-boost.sh ${{ env.boost_version }}
126129
- name: Install Thrift
127130
run: |
128131
sudo ./scripts/install-thrift.sh ${{ env.thrift_version }}
132+
133+
- name: Setup JDK
134+
uses: actions/setup-java@v4
135+
with:
136+
java-version: ${{ env.JAVA_VERSION }}
137+
distribution: ${{ env.JAVA_DISTRIBUTION }}
138+
129139
- name: Build
130140
env:
131141
BUILD_DIR: build
@@ -197,10 +207,23 @@ jobs:
197207
name: ubuntu-i386-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
198208

199209
steps:
210+
- name: Checkout Code
211+
uses: actions/checkout@v1
212+
with:
213+
ref: ${{ needs.get-refs.outputs.ref }}
214+
token: ${{ secrets.GH_TOKEN }}
215+
216+
- name: Read Config
217+
run: cat .github/config.env >> $GITHUB_ENV
218+
219+
# Install Java via `apt`, can't use the `setup-java` action on this image
220+
# `setup-java` is written in TypeScript and requires a compatible Node installation
221+
# Newest available version for this image is Node 8, which is too old for any version to run against
222+
# https://github.com/actions/setup-node/issues/922
200223
- name: Install Necessary Packages
201224
run: |
202225
apt-get update
203-
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-11-jre-headless gdb curl
226+
apt-get install -y build-essential cmake curl git libssl-dev net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl
204227
205228
- name: Make sure the target architecture is 32 bit
206229
run: |
@@ -215,9 +238,34 @@ jobs:
215238
ref: ${{ needs.get-refs.outputs.ref }}
216239
token: ${{ secrets.GH_TOKEN }}
217240

241+
- name: Read Config
242+
run: cat .github/config.env >> $GITHUB_ENV
243+
244+
# `apt-get` brings in `3.6` which is too old to be compatible with Java 17
245+
- name: Install Maven
246+
run: |
247+
install_dir="/opt/maven"
248+
mkdir ${install_dir}
249+
curl \
250+
--fail \
251+
--silent \
252+
--show-error \
253+
--location \
254+
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz |
255+
tar \
256+
--extract \
257+
--gzip \
258+
--strip-components=1 \
259+
--directory ${install_dir}
260+
echo "${install_dir}/bin" >> $GITHUB_PATH
261+
262+
- name: Test Maven
263+
run: |
264+
mvn --version
265+
218266
- name: Download hazelcast-enterprise-tests.jar
219267
run: |
220-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
268+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
221269
222270
- name: Install Boost
223271
run: |
@@ -295,9 +343,12 @@ jobs:
295343
ref: ${{ needs.get-refs.outputs.ref }}
296344
token: ${{ secrets.GH_TOKEN }}
297345

346+
- name: Read Config
347+
run: cat .github/config.env >> $GITHUB_ENV
348+
298349
- name: Download hazelcast-enterprise-tests.jar
299350
run: |
300-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
351+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
301352
302353
- name: Install Boost
303354
run: |
@@ -306,6 +357,12 @@ jobs:
306357
- name: Install Thrift
307358
run: |
308359
sudo ./scripts/install-thrift.sh ${{env.thrift_version}}
360+
361+
- name: Setup JDK
362+
uses: actions/setup-java@v4
363+
with:
364+
java-version: ${{ env.JAVA_VERSION }}
365+
distribution: ${{ env.JAVA_DISTRIBUTION }}
309366

310367
- name: Build & Install
311368
env:
@@ -372,11 +429,15 @@ jobs:
372429
ref: ${{ needs.get-refs.outputs.ref }}
373430
token: ${{ secrets.GH_TOKEN }}
374431

432+
- name: Read Config
433+
shell: bash
434+
run: cat .github/config.env >> $GITHUB_ENV
435+
375436
- name: Download hazelcast-enterprise-tests.jar
376437
shell: pwsh
377438
run: |
378439
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
379-
Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
440+
Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
380441
- name: Install SysInternals
381442
run: |
382443
Invoke-WebRequest `
@@ -427,6 +488,13 @@ jobs:
427488
mkdir C:\Thrift\bin
428489
cd ../..
429490
Remove-Item thrift-0.13.0 -Recurse -Force
491+
492+
- name: Setup JDK
493+
uses: actions/setup-java@v4
494+
with:
495+
java-version: ${{ env.JAVA_VERSION }}
496+
distribution: ${{ env.JAVA_DISTRIBUTION }}
497+
430498
- name: Build & Install
431499
env:
432500
BUILD_DIR: build
@@ -489,7 +557,7 @@ jobs:
489557

490558
runs-on: macos-latest
491559

492-
name: macOS-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }} ,${{ matrix.with_openssl.name }})
560+
name: macOS-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
493561
env:
494562
OPENSSL_ROOT_DIR: /usr/local/opt/openssl/
495563

@@ -499,13 +567,23 @@ jobs:
499567
ref: ${{ needs.get-refs.outputs.ref }}
500568
token: ${{ secrets.GH_TOKEN }}
501569

570+
- name: Read Config
571+
run: cat .github/config.env >> $GITHUB_ENV
572+
502573
- name: Install Dependencies
503574
run: |
504575
brew install [email protected] thrift curl
505-
./scripts/install-boost.sh ${{env.boost_version}}
576+
sudo ./scripts/install-boost.sh ${{env.boost_version}}
577+
578+
- name: Setup JDK
579+
uses: actions/setup-java@v4
580+
with:
581+
java-version: ${{ env.JAVA_VERSION }}
582+
distribution: ${{ env.JAVA_DISTRIBUTION }}
583+
506584
- name: Download hazelcast-enterprise-tests.jar
507585
run: |
508-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
586+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
509587
510588
- name: Build & Install
511589
env:

.github/workflows/coverage-report.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v2
1616

17+
- name: Read Config
18+
run: cat .github/config.env >> $GITHUB_ENV
19+
1720
- name: Install Necessary Packages
1821
run: |
1922
sudo apt-get update
2023
sudo apt-get install -y net-tools libssl-dev gdb gcovr curl
2124
2225
- name: Download hazelcast-enterprise-tests.jar
2326
run: |
24-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
27+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
2528
2629
- name: Install Boost
2730
run: |

.github/workflows/nightly-macos-x86_64.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ jobs:
4949
steps:
5050
- uses: actions/checkout@v2
5151

52+
- name: Read Config
53+
run: cat .github/config.env >> $GITHUB_ENV
54+
5255
- name: Install Dependencies
5356
run: |
5457
brew install [email protected] thrift curl
5558
./scripts/install-boost.sh ${{matrix.boost.version}}
5659
5760
- name: Download hazelcast-enterprise-tests.jar
5861
run: |
59-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
62+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
6063
6164
- name: Build & Install
6265
env:

.github/workflows/nightly-ubuntu-i386.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,19 @@ jobs:
4646
(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{matrix.boost.version}},${{ matrix.with_openssl.name }})
4747
4848
steps:
49+
- uses: actions/checkout@v1
50+
51+
- name: Read Config
52+
run: cat .github/config.env >> $GITHUB_ENV
53+
54+
# Install Java via `apt`, can't use the `setup-java` action on this image
55+
# `setup-java` is written in TypeScript and requires a compatible Node installation
56+
# Newest available version for this image is Node 8, which is too old for any version to run against
57+
# https://github.com/actions/setup-node/issues/922
4958
- name: Install Necessary Packages
5059
run: |
5160
apt-get update
52-
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-11-jre-headless gdb curl
61+
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl
5362
5463
- name: Make sure the target architecture is 32 bit
5564
run: |
@@ -58,11 +67,31 @@ jobs:
5867
./a
5968
rm a test.c
6069
61-
- uses: actions/checkout@v1
70+
# `apt-get` brings in `3.6` which is too old to be compatible with Java 17
71+
- name: Install Maven
72+
run: |
73+
install_dir="/opt/maven"
74+
mkdir ${install_dir}
75+
curl \
76+
--fail \
77+
--silent \
78+
--show-error \
79+
--location \
80+
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apa${{ env.MAVEN_VERSION }}n_version}-bin.tar.gz |
81+
tar \
82+
--extract \
83+
--gzip \
84+
--strip-components=1 \
85+
--directory ${install_dir}
86+
echo "${install_dir}/bin" >> $GITHUB_PATH
87+
88+
- name: Test Maven
89+
run: |
90+
mvn --version
6291
6392
- name: Download hazelcast-enterprise-tests.jar
6493
run: |
65-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
94+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
6695
6796
- name: Install Boost
6897
run: |

.github/workflows/nightly-ubuntu-x86_64.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ jobs:
5151
5252
- uses: actions/checkout@v2
5353

54+
- name: Read Config
55+
run: cat .github/config.env >> $GITHUB_ENV
56+
5457
- name: Download hazelcast-enterprise-tests.jar
5558
run: |
56-
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
59+
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
5760
5861
- name: Install Boost
5962
run: |

.github/workflows/nightly-windows.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ jobs:
7777
steps:
7878
- uses: actions/checkout@v2
7979

80+
- name: Read Config
81+
run: cat .github/config.env >> $GITHUB_ENV
82+
8083
- name: Download hazelcast-enterprise-tests.jar
8184
shell: pwsh
8285
run: |
8386
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
84-
Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
87+
Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
8588
8689
- name: Install SysInternals
8790
run: |

hazelcast/include/hazelcast/client/protocol/ClientMessage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ class HAZELCAST_API ClientMessage
952952

953953
fast_forward_to_end_frame();
954954

955-
return schema{ type_name, move(fields) };
955+
return schema{ type_name, std::move(fields) };
956956
}
957957

958958
/**

hazelcast/include/hazelcast/client/serialization/generic_record_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ class HAZELCAST_API generic_record_builder
15201520
pimpl::schema_writer& writer =
15211521
boost::get<pimpl::schema_writer>(writer_or_schema_);
15221522

1523-
writer.add_field(move(field_name), kind);
1523+
writer.add_field(std::move(field_name), kind);
15241524
}
15251525

15261526
return *this;

hazelcast/include/hazelcast/client/serialization/serialization.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ class HAZELCAST_API SerializationService : public util::Disposable
18581858
output.write_object<T>(object);
18591859

18601860
return { std::move(output).to_byte_array(),
1861-
move(output.schemas_will_be_replicated_) };
1861+
std::move(output.schemas_will_be_replicated_) };
18621862
}
18631863

18641864
template<typename T>
@@ -1876,7 +1876,7 @@ class HAZELCAST_API SerializationService : public util::Disposable
18761876
output.write_object<T>(object);
18771877

18781878
return { std::move(output).to_byte_array(),
1879-
move(output.schemas_will_be_replicated_) };
1879+
std::move(output.schemas_will_be_replicated_) };
18801880
}
18811881

18821882
template<typename T>

0 commit comments

Comments
 (0)