Skip to content

Commit 838b2e4

Browse files
authored
feat: use ZooKeeper C Client v3.8.2 (#330)
* wip: use zookeeper-c-client v3.8.2 * fix: eslint import order * fix(ci): skip CMake on CI * Add prebuild for Windows and C Client v3.8.2 * fix(windows): build with extra CMAKE flags * fix(windows): apply patches is still needed * remove unused client version env * fix(patch): not needed * feat(mac os x): add prebuild for node 18 and C Client v3.8.2 * docs(prebuildify): update node version * feat(mac os x M1): add prebuild for node 18 and C Client v3.8.2 * bump version to 6.0.0 * docs: add changelog
1 parent 58382fd commit 838b2e4

19 files changed

+22
-30
lines changed

.circleci/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
run-on-windows:
4242
executor: win/default
4343
steps:
44-
- run: choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
4544
- checkout
4645
- nvminstall
4746
- deps

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#### v 6.0.0 (2023-08-07)
2+
* feat: use ZooKeeper C Client v3.8.2 and add prebuilds for Node.js v.18 (Mac OS X intel and M1, and Windows)
3+
4+
Drop support for Node.js 16 prebuilds.
5+
6+
Pull request [330](https://github.com/yfinkelstein/node-zookeeper/pull/330) by @davidvujic
7+
18
#### v 5.6.0 (2022-11-03)
29
* feat: add prebuilds for Node.js v.18 (Mac OS X intel and M1, and Windows)
310

deps/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
### Developer: updating the ZooKeeper Client C source code
22

33
This guide is extracted from the [official docs](https://github.com/apache/zookeeper/blob/master/zookeeper-client/zookeeper-client-c/README)
4+
and the as of today unresolved issue about outdated docs: https://issues.apache.org/jira/browse/ZOOKEEPER-4621
45

5-
1 Download the source code
6-
2 Navigate to the `zookeeper-jute` folder and run `mvn compile`
7-
3 Navigate to the zookeeper-client-c folder: run autoreconf -if
8-
4 compress the entire zookeeper-client-c folder and name it `zookeeper-client-c.tar.gz`
6+
1. Download the source code
7+
2. Navigate to the `zookeeper-jute` folder and run `mvn compile`
8+
3. Navigate to the zookeeper-client-c folder: run autoreconf -if
9+
4. compress the entire zookeeper-client-c folder and name it `zookeeper-client-c.tar.gz`
910
* On Mac OS X: `COPYFILE_DISABLE=1 tar -czvf zookeeper-client-c.tar.gz zookeeper-client-c`
10-
5 replace the existing compressed file in the deps folder
11+
5. replace the existing compressed file in the deps folder

deps/no-fipsmode.patch

-9
This file was deleted.

deps/zookeeper-client-c.tar.gz

20.8 KB
Binary file not shown.

lib/zookeeper.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// needed to not break the interface
22
/* eslint-disable camelcase */
3-
const { apply, waterfall } = require('async');
3+
const util = require('util');
44
const { EventEmitter } = require('events');
55
const { join, posix } = require('path');
6-
const util = require('util');
6+
const { apply, waterfall } = require('async');
77
const NativeZk = require('node-gyp-build')(join(__dirname, '..')).ZooKeeper;
88
const { isString, isFunction } = require('./helper');
99

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zookeeper",
33
"description": "apache zookeeper client (zookeeper async API v3.5.x - v3.8.x)",
4-
"version": "5.6.0",
4+
"version": "6.0.0",
55
"author": "Yuri Finkelstein <[email protected]>",
66
"license": "MIT",
77
"contributors": [

prebuilds/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ Each platform has prebuilds for Node.js 12 and 14.
88
Create prebuilds for Mac OS X:
99

1010
```bash
11-
npx prebuildify --arch x64 --platform darwin --target 16.17.0
11+
npx prebuildify --arch x64 --platform darwin --target 18.17.0
1212
```
1313

1414
Prebuilds for Mac OS X with the M1 processor:
1515
```bash
16-
npx prebuildify --arch arm64 --platform darwin --target 16.17.0
16+
npx prebuildify --arch arm64 --platform darwin --target 18.17.0
1717
```
1818

1919
Create prebuilds for Windows 10:
2020

2121
```bash
22-
npx prebuildify --arch x64 --platform win32 --target 16.17.0
22+
npx prebuildify --arch x64 --platform win32 --target 18.17.0
2323
```
19.6 KB
Binary file not shown.
-338 KB
Binary file not shown.

prebuilds/darwin-x64/node.abi108.node

19.4 KB
Binary file not shown.

prebuilds/darwin-x64/node.abi93.node

-319 KB
Binary file not shown.

prebuilds/win32-x64/node.abi108.node

3.5 KB
Binary file not shown.

prebuilds/win32-x64/node.abi93.node

-273 KB
Binary file not shown.

scripts/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ shell.cd(`${env.sourceFolder}`);
1616

1717
if (env.isWindows) {
1818
const output = env.isVerbose ? '' : ' > NUL';
19-
exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`);
19+
exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output} -DWITH_OPENSSL=OFF -DWITH_CYRUS_SASL=OFF`);
2020
exec(`cmake --build .${output}`);
2121
} else {
2222
const flags = '-w';

scripts/env.js

-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ function checkIfAlreadyBuilt(env) {
2121
const isWindows = process.platform.toLowerCase().includes('win32');
2222
const rootFolder = setRoot({ isWindows });
2323

24-
const zookeeperVersion = '3.5.8';
2524
const downloadedFolderName = 'zookeeper-client-c';
2625
const downloadedFileName = 'zookeeper-client-c.tar.gz';
2726

2827
const variables = {
2928
rootFolder,
3029
workFolder: `${rootFolder}/deps`,
3130
buildFolder: `${rootFolder}/build/zk`,
32-
zookeeperVersion,
3331
downloadedFolderName,
3432
sourceFolder: `${rootFolder}/deps/zookeeper-client-c`,
3533
downloadedFileName,

scripts/prepublish.js

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ function applyPatches() {
1818
shell.sed('-i', '#include "zookeeper_log.h"', '#include "zookeeper_log.h"\n#include "winport.h"\n', `${destination}/zk_log.c`);
1919
shell.sed('-i', '#include "zookeeper.h"', '#include "winport.h"\n#include "zookeeper.h"\n', `${destination}/zk_adaptor.h`);
2020
shell.sed('-i', '#include "zk_adaptor.h"', '#include "zk_adaptor.h"\n#include "winport.h"\n', `${destination}/zookeeper.c`);
21-
shell.sed('-i', /(FIPS_mode\(\) == 0)/, '0 == 0', `${destination}/zookeeper.c`);
22-
shell.sed('-i', /(FIPS mode is OFF)/, 'Disabled the FIPS check', `${destination}/zookeeper.c`);
23-
} else {
24-
shell.exec(`patch -d ${env.rootFolder} -p0 --forward < ${env.workFolder}/no-fipsmode.patch`);
2521
}
2622
}
2723

tests/unit/zookeeper/exportedconstantstest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const test = require('ava');
21
const { join } = require('path');
2+
const test = require('ava');
33
const NativeZk = require('node-gyp-build')(join(__dirname, '../../../')).ZooKeeper;
44
const constants = require('../../../lib/constants');
55
const ZooKeeper = require('../../../lib/zookeeper');

tests/unit/zookeeper/nativeobjecttest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const test = require('ava');
21
const { join } = require('path');
2+
const test = require('ava');
33
const NativeZk = require('node-gyp-build')(join(__dirname, '../../../')).ZooKeeper;
44
const ZooKeeper = require('../../../lib/zookeeper');
55

0 commit comments

Comments
 (0)