Skip to content

Commit 5fd6fa7

Browse files
committed
Merge remote-tracking branch 'origin/candidate-10.0.x' into candidate-10.2.x
2 parents 1435d16 + 32464d1 commit 5fd6fa7

34 files changed

+522
-216
lines changed

.github/workflows/build-clienttools-windows-2022.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030
type: string
3131
description: 'CMake config options'
3232
required: false
33-
default: '-T host=x64 -A x64 -DUSE_OPTIONAL=OFF -DCLIENTTOOLS_ONLY=ON -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DUSE_PARQUET=OFF -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF'
33+
default: '-T host=x64 -A x64 -DUSE_OPTIONAL=OFF -DCLIENTTOOLS_ONLY=ON -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DUSE_PARQUET=OFF -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF -DDIGICERT_KEYPAIR_ALIAS=RIS_Data_Services_HPCC_Systems'
3434
cmake-build-options:
3535
type: string
3636
description: 'CMake build options'
@@ -66,19 +66,32 @@ jobs:
6666
submodules: recursive
6767
path: ./LN
6868

69-
- name: Setup Code Signing
69+
- name: Setup Certificate File
70+
- name: Setup Certificate File
7071
shell: "pwsh"
7172
run: |
72-
mkdir -p ./sign
73-
cd sign
74-
$pfxPath = "hpcc_code_signing.pfx"
75-
$encodedBytes = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
76-
$currentDirectory = Get-Location
77-
$certificatePath = Join-Path -Path $currentDirectory -ChildPath $pfxPath
78-
[IO.File]::WriteAllBytes("$certificatePath", $encodedBytes)
79-
$passphrasePath = Join-Path -Path $currentDirectory -ChildPath "passphrase.txt"
80-
Set-Content -Path $passphrasePath -Value "${{ secrets.SIGNING_CERTIFICATE_PASSPHRASE }}"
81-
CertUtil -p ${{ secrets.SIGNING_CERTIFICATE_PASSPHRASE }} hpcc_code_signing.pfx
73+
$base64 = "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
74+
if ([string]::IsNullOrEmpty($base64)) {
75+
Write-Error "Secret SM_CLIENT_CERT_FILE_B64 is empty or not set."
76+
exit 1
77+
}
78+
$bytes = [Convert]::FromBase64String($base64)
79+
$outDir = "$env:RUNNER_TEMP"
80+
$p12Path = Join-Path $outDir "sm_client_cert.p12"
81+
[IO.File]::WriteAllBytes($p12Path, $bytes)
82+
# Make sure the path is visible to subsequent steps
83+
"SM_CLIENT_CERT_FILE=$p12Path" | Out-File -FilePath $env:GITHUB_ENV -Append
84+
85+
- name: Setup Software Trust Manager
86+
uses: digicert/code-signing-software-trust-action@v1.0.1
87+
with:
88+
simple-signing-mode: true
89+
keypair-alias: "RIS_Data_Services_HPCC_Systems"
90+
env:
91+
SM_HOST: https://clientauth.one.digicert.com
92+
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
93+
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
94+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
8295

8396
- name: vcpkg bootstrap
8497
shell: "bash"
@@ -109,6 +122,7 @@ jobs:
109122
fi
110123
111124
- name: Build Clienttools
125+
id: build_clienttools
112126
shell: "bash"
113127
run: |
114128
mkdir -p ./build
@@ -118,6 +132,12 @@ jobs:
118132
else
119133
cmake --build ./build ${{ inputs.cmake-build-options }} --target SIGN
120134
fi
135+
env:
136+
SM_HOST: https://clientauth.one.digicert.com
137+
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
138+
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
139+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
140+
121141

122142
- name: Release Community Clienttools
123143
if: ${{ inputs.ln-ref == '' }}
@@ -127,7 +147,7 @@ jobs:
127147
generateReleaseNotes: false
128148
prerelease: ${{ contains(github.ref, '-rc') }}
129149
makeLatest: ${{ inputs.make-latest }}
130-
artifacts: "./build/hpccsystems-clienttools-community*.exe"
150+
artifacts: "${{ steps.build_clienttools.outputs.packages }}"
131151

132152
- name: Release Internal Clienttools to JFrog Repository
133153
if: ${{ inputs.ln-ref != '' && github.repository_owner == 'hpcc-systems' }}

.github/workflows/build-eclide.yml

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,32 @@ jobs:
154154
-username "${{ github.repository_owner }}" \
155155
-password "${{ secrets.GITHUB_TOKEN }}"
156156
157-
- name: Load code signing
157+
- name: Setup Certificate File
158+
- name: Setup Certificate File
158159
shell: "pwsh"
159160
run: |
160-
mkdir -p ./sign
161-
cd sign
162-
$pfxPath = "hpcc_code_signing.pfx"
163-
$encodedBytes = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}")
164-
$currentDirectory = Get-Location
165-
$certificatePath = Join-Path -Path $currentDirectory -ChildPath $pfxPath
166-
[IO.File]::WriteAllBytes("$certificatePath", $encodedBytes)
167-
$passphrasePath = Join-Path -Path $currentDirectory -ChildPath "passphrase.txt"
168-
Set-Content -Path $passphrasePath -Value "${{ secrets.SIGNING_CERTIFICATE_PASSPHRASE }}"
169-
CertUtil -p ${{ secrets.SIGNING_CERTIFICATE_PASSPHRASE }} hpcc_code_signing.pfx
161+
$base64 = "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
162+
if ([string]::IsNullOrEmpty($base64)) {
163+
Write-Error "Secret SM_CLIENT_CERT_FILE_B64 is empty or not set."
164+
exit 1
165+
}
166+
$bytes = [Convert]::FromBase64String($base64)
167+
$outDir = "$env:RUNNER_TEMP"
168+
$p12Path = Join-Path $outDir "sm_client_cert.p12"
169+
[IO.File]::WriteAllBytes($p12Path, $bytes)
170+
# Make sure the path is visible to subsequent steps
171+
"SM_CLIENT_CERT_FILE=$p12Path" | Out-File -FilePath $env:GITHUB_ENV -Append
172+
173+
- name: Setup Software Trust Manager
174+
uses: digicert/code-signing-software-trust-action@v1.0.1
175+
with:
176+
simple-signing-mode: true
177+
keypair-alias: "RIS_Data_Services_HPCC_Systems"
178+
env:
179+
SM_HOST: https://clientauth.one.digicert.com
180+
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
181+
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
182+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
170183

171184
- name: Check workspace
172185
shell: "bash"
@@ -179,17 +192,27 @@ jobs:
179192
cd ECLIDE
180193
mkdir -p ./build
181194
cd ./build
182-
cmake -A Win32 -S ../ -B .
195+
cmake -A Win32 -S ../ -B . -DDIGICERT_KEYPAIR_ALIAS=RIS_Data_Services_HPCC_Systems
183196
cmake --build . --config RelWithDebInfo --target SIGN --parallel $NUMBER_OF_PROCESSORS
197+
env:
198+
SM_HOST: https://clientauth.one.digicert.com
199+
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
200+
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
201+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
184202

185203
- name: Build Internal ECLIDE
186204
shell: "bash"
187205
run: |
188206
cd ECLIDE
189207
cd ./build
190208
rm -rf ./CMakeCache.txt ./CMakeFiles
191-
cmake -A Win32 -S ../ -B . -DHPCC_AUDIENCE=internal
209+
cmake -A Win32 -S ../ -B . -DHPCC_AUDIENCE=internal -DDIGICERT_KEYPAIR_ALIAS=RIS_Data_Services_HPCC_Systems
192210
cmake --build . --config RelWithDebInfo --target SIGN --parallel $NUMBER_OF_PROCESSORS
211+
env:
212+
SM_HOST: https://clientauth.one.digicert.com
213+
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
214+
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
215+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
193216

194217
- name: Upload Assets
195218
uses: ncipollo/release-action@v1.16.0

cmake_modules/codeSigning.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ function(configure_windows_signing target_name package_file_path)
1111
endif()
1212

1313
# Check for signing passphrase file
14-
if(EXISTS "${PROJECT_SOURCE_DIR}/../sign/passphrase.txt")
15-
file(STRINGS "${PROJECT_SOURCE_DIR}/../sign/passphrase.txt" PFX_PASSWORD LIMIT_COUNT 1)
16-
message("-- Using passphrase from file: ${PROJECT_SOURCE_DIR}/../sign/passphrase.txt")
14+
set(DO_CODE_SIGNING FALSE)
15+
if(NOT "${DIGICERT_KEYPAIR_ALIAS}" STREQUAL "")
16+
message("-- Using DIGICERT_KEYPAIR_ALIAS for code signing")
17+
set(DO_CODE_SIGNING TRUE)
1718
endif()
1819

19-
if(PFX_PASSWORD)
20+
if(DO_CODE_SIGNING)
2021
# Configure NSIS installer signing
21-
set(CPACK_NSIS_FINALIZE_CMD "signtool sign /f \\\"${PROJECT_SOURCE_DIR}/../sign/hpcc_code_signing.pfx\\\" /fd SHA256 /p \\\"${PFX_PASSWORD}\\\" /tr http://timestamp.digicert.com /td SHA256")
22+
set(CPACK_NSIS_FINALIZE_CMD "smctl sign --simple --keypair-alias \\\"${DIGICERT_KEYPAIR_ALIAS}\\\" --dynamic-auth --timestamp --verbose --exit-non-zero-on-fail --failfast --input")
2223

2324
set(CPACK_NSIS_DEFINES "
2425
!define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"${CPACK_PACKAGE_VENDOR}\\\\${version}\\\\${CPACK_NSIS_DISPLAY_NAME}\\\"
@@ -30,7 +31,7 @@ function(configure_windows_signing target_name package_file_path)
3031
# Create custom target for package signing
3132
message("-- Signing package: ${package_file_path}")
3233
add_custom_target(${target_name}
33-
COMMAND signtool sign /f "${PROJECT_SOURCE_DIR}/../sign/hpcc_code_signing.pfx" /fd "SHA256" /p "${PFX_PASSWORD}" /tr "http://timestamp.digicert.com" /td "SHA256" "${package_file_path}"
34+
COMMAND smctl sign --simple --input "${package_file_path}" --keypair-alias "${DIGICERT_KEYPAIR_ALIAS}" --dynamic-auth --timestamp --verbose --exit-non-zero-on-fail --failfast
3435
COMMENT "Digital Signature"
3536
)
3637
add_dependencies(${target_name} PACKAGE)
@@ -44,6 +45,6 @@ function(configure_windows_signing target_name package_file_path)
4445
!define MUI_FINISHPAGE_NOAUTOCLOSE
4546
" PARENT_SCOPE)
4647

47-
message(STATUS "Code signing passphrase not found - basic NSIS configuration applied")
48+
message(STATUS "Code signing keypair not found - basic NSIS configuration applied")
4849
endif()
4950
endfunction()

common/eventconsumption/eventiterator.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,15 @@ bool CPropertyTreeEvents::nextEvent(CEvent& event)
9292
return true;
9393
}
9494

95-
const char* CPropertyTreeEvents::queryFilename() const
95+
const EventFileProperties& CPropertyTreeEvents::queryFileProperties() const
9696
{
97-
return events->queryProp("@filename");
98-
}
99-
100-
uint32_t CPropertyTreeEvents::queryVersion() const
101-
{
102-
return uint32_t(events->getPropInt64("@version"));
103-
}
104-
105-
uint32_t CPropertyTreeEvents::queryBytesRead() const
106-
{
107-
return uint32_t(events->getPropInt64("@bytesRead"));
97+
return properties;
10898
}
10999

110100
CPropertyTreeEvents::CPropertyTreeEvents(const IPropertyTree& _events)
111101
: CPropertyTreeEvents(_events, true)
112102
{
103+
// delegating constructor
113104
}
114105

115106
CPropertyTreeEvents::CPropertyTreeEvents(const IPropertyTree& _events, bool _strictParsing)
@@ -119,15 +110,19 @@ CPropertyTreeEvents::CPropertyTreeEvents(const IPropertyTree& _events, bool _str
119110
{
120111
// enable the "next" event to populate from the first matching node
121112
(void)eventsIt->first();
113+
properties.path.set(events->queryProp("@filename"));
114+
properties.version = uint32_t(events->getPropInt64("@version"));
115+
properties.bytesRead = uint32_t(events->getPropInt("@bytesRead"));
122116
}
123117

124118
void visitIterableEvents(IEventIterator& iter, IEventVisitor& visitor)
125119
{
126120
CEvent event;
127-
visitor.visitFile(iter.queryFilename(), iter.queryVersion());
121+
const EventFileProperties& props = iter.queryFileProperties();
122+
visitor.visitFile(props.path, props.version);
128123
while (iter.nextEvent(event))
129124
visitor.visitEvent(event);
130-
visitor.departFile(iter.queryBytesRead());
125+
visitor.departFile(props.bytesRead);
131126
}
132127

133128
#ifdef _USE_CPPUNIT

common/eventconsumption/eventiterator.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,6 @@
2121
#include "jevent.hpp"
2222
#include "jptree.hpp"
2323

24-
// An abstraction enabling an event pulling model. Consumers control the pace of event
25-
// production by calling nextEvent() as needed.
26-
//
27-
// The interface is more simplistic than other iterators. A binary event file reader is considered
28-
// to be a potential event source.
29-
//
30-
// The query* methods are used to identify a source of events. The queried values coincide with
31-
// `IEventVisitor::visitFile` and `IEventVisitor::departFile` parameters.
32-
interface IEventIterator : extends IInterface
33-
{
34-
virtual bool nextEvent(CEvent& event) = 0;
35-
virtual const char* queryFilename() const = 0;
36-
virtual uint32_t queryVersion() const = 0;
37-
virtual uint32_t queryBytesRead() const = 0;
38-
};
39-
4024
// Implementation of IEventIterator that extracts event data from a property tree whose contents
4125
// conform to this format (shown here as YAML):
4226
//
@@ -62,15 +46,14 @@ class event_decl CPropertyTreeEvents : public CInterfaceOf<IEventIterator>
6246
{
6347
public:
6448
virtual bool nextEvent(CEvent& event) override;
65-
virtual const char* queryFilename() const override;
66-
virtual uint32_t queryVersion() const override;
67-
virtual uint32_t queryBytesRead() const override;
49+
virtual const EventFileProperties& queryFileProperties() const override;
6850
public:
6951
CPropertyTreeEvents(const IPropertyTree& events);
7052
CPropertyTreeEvents(const IPropertyTree& events, bool strictParsing);
7153
protected:
7254
Linked<const IPropertyTree> events;
7355
Owned<IPropertyTreeIterator> eventsIt;
56+
EventFileProperties properties;
7457
bool strictParsing{true};
7558
};
7659

dali/base/dafdesc.cpp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,36 +2812,41 @@ static void loadDefaultBases()
28122812
ldbDone = true;
28132813

28142814
SessionId mysessid = myProcessSession();
2815+
Owned<IPropertyTree> dirs;
2816+
// If connected to dali, then use the configuration from there, otherwise fall back to using the local config file)
28152817
if (mysessid)
28162818
{
28172819
Owned<IRemoteConnection> conn = querySDS().connect("/Environment/Software/Directories", mysessid, RTM_LOCK_READ, SDS_CONNECT_TIMEOUT);
2818-
if (conn) {
2819-
IPropertyTree* dirs = conn->queryRoot();
2820-
for (unsigned groupType = 0; groupType < __grp_size; groupType++)
2821-
{
2822-
const char *component = componentNames[groupType];
2823-
for (unsigned replicationLevel = 0; replicationLevel < MAX_REPLICATION_LEVELS; replicationLevel++)
2824-
{
2825-
StringBuffer dirout;
2826-
const char *dirType = dirTypeNames[replicationLevel];
2827-
if (replicationLevel==1 && groupType!=grp_roxie)
2828-
dirType = "mirror";
2829-
if (getConfigurationDirectory(dirs, dirType, component,
2830-
"dummy", // NB this is dummy value (but actually hopefully not used anyway)
2831-
dirout))
2832-
unixBaseDirectories[groupType][replicationLevel].set(dirout.str());
2833-
}
2834-
}
2820+
if (conn)
2821+
dirs.set(conn->queryRoot());
2822+
}
2823+
2824+
for (unsigned groupType = 0; groupType < __grp_size; groupType++)
2825+
{
2826+
const char *component = componentNames[groupType];
2827+
for (unsigned replicationLevel = 0; replicationLevel < MAX_REPLICATION_LEVELS; replicationLevel++)
2828+
{
2829+
StringBuffer dirout;
2830+
const char *dirType = dirTypeNames[replicationLevel];
2831+
if (replicationLevel==1 && groupType!=grp_roxie)
2832+
dirType = "mirror";
2833+
if (getConfigurationDirectory(dirs, dirType, component,
2834+
"dummy", // NB this is dummy value (but actually hopefully not used anyway)
2835+
dirout))
2836+
unixBaseDirectories[groupType][replicationLevel].set(dirout.str());
28352837
}
28362838
}
2839+
28372840
for (unsigned groupType = 0; groupType < __grp_size; groupType++)
2841+
{
28382842
for (unsigned replicationLevel = 0; replicationLevel < MAX_REPLICATION_LEVELS; replicationLevel++)
28392843
{
28402844
if (unixBaseDirectories[groupType][replicationLevel].isEmpty())
28412845
unixBaseDirectories[groupType][replicationLevel].set(defaultUnixBaseDirectories[groupType][replicationLevel]);
28422846
if (windowsBaseDirectories[groupType][replicationLevel].isEmpty())
28432847
windowsBaseDirectories[groupType][replicationLevel].set(defaultWindowsBaseDirectories[groupType][replicationLevel]);
28442848
}
2849+
}
28452850
}
28462851

28472852

0 commit comments

Comments
 (0)