diff --git a/.circleci/config.yml b/.circleci/config.yml index 197f9af8..71b04465 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,6 @@ jobs: run-on-windows: executor: win/default steps: - - run: choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System' - checkout - nvminstall - deps diff --git a/CHANGELOG.md b/CHANGELOG.md index d1b9458c..11c46404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +#### v 6.0.0 (2023-08-07) +* feat: use ZooKeeper C Client v3.8.2 and add prebuilds for Node.js v.18 (Mac OS X intel and M1, and Windows) + + Drop support for Node.js 16 prebuilds. + + Pull request [330](https://github.com/yfinkelstein/node-zookeeper/pull/330) by @davidvujic + #### v 5.6.0 (2022-11-03) * feat: add prebuilds for Node.js v.18 (Mac OS X intel and M1, and Windows) diff --git a/deps/README.md b/deps/README.md index 8e983a31..c271aa83 100644 --- a/deps/README.md +++ b/deps/README.md @@ -1,10 +1,11 @@ ### Developer: updating the ZooKeeper Client C source code This guide is extracted from the [official docs](https://github.com/apache/zookeeper/blob/master/zookeeper-client/zookeeper-client-c/README) +and the as of today unresolved issue about outdated docs: https://issues.apache.org/jira/browse/ZOOKEEPER-4621 -1 Download the source code -2 Navigate to the `zookeeper-jute` folder and run `mvn compile` -3 Navigate to the zookeeper-client-c folder: run autoreconf -if -4 compress the entire zookeeper-client-c folder and name it `zookeeper-client-c.tar.gz` +1. Download the source code +2. Navigate to the `zookeeper-jute` folder and run `mvn compile` +3. Navigate to the zookeeper-client-c folder: run autoreconf -if +4. compress the entire zookeeper-client-c folder and name it `zookeeper-client-c.tar.gz` * On Mac OS X: `COPYFILE_DISABLE=1 tar -czvf zookeeper-client-c.tar.gz zookeeper-client-c` -5 replace the existing compressed file in the deps folder +5. replace the existing compressed file in the deps folder diff --git a/deps/no-fipsmode.patch b/deps/no-fipsmode.patch deleted file mode 100644 index 712f8788..00000000 --- a/deps/no-fipsmode.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -ur -p0 deps/zookeeper-client-c/src/zookeeper.c deps-patched/zookeeper-client-c/src/zookeeper.c ---- deps/zookeeper-client-c/src/zookeeper.c 2022-09-10 16:36:21.122958700 +0200 -+++ deps-patched/zookeeper-client-c/src/zookeeper.c 2022-09-10 16:32:05.092796200 +0200 -@@ -2595,5 +2594,0 @@ static int init_ssl_for_socket(zsock_t * -- if (FIPS_mode() == 0) { -- LOG_INFO(LOGCALLBACK(zh), "FIPS mode is OFF "); -- } else { -- LOG_INFO(LOGCALLBACK(zh), "FIPS mode is ON "); -- } diff --git a/deps/zookeeper-client-c.tar.gz b/deps/zookeeper-client-c.tar.gz index 08a3457f..9675cd14 100644 Binary files a/deps/zookeeper-client-c.tar.gz and b/deps/zookeeper-client-c.tar.gz differ diff --git a/lib/zookeeper.js b/lib/zookeeper.js index e42f1495..57aee9b1 100644 --- a/lib/zookeeper.js +++ b/lib/zookeeper.js @@ -1,9 +1,9 @@ // needed to not break the interface /* eslint-disable camelcase */ -const { apply, waterfall } = require('async'); +const util = require('util'); const { EventEmitter } = require('events'); const { join, posix } = require('path'); -const util = require('util'); +const { apply, waterfall } = require('async'); const NativeZk = require('node-gyp-build')(join(__dirname, '..')).ZooKeeper; const { isString, isFunction } = require('./helper'); diff --git a/package.json b/package.json index acea6a18..b897cc74 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zookeeper", "description": "apache zookeeper client (zookeeper async API v3.5.x - v3.8.x)", - "version": "5.6.0", + "version": "6.0.0", "author": "Yuri Finkelstein <yurif2003@yahoo.com>", "license": "MIT", "contributors": [ diff --git a/prebuilds/README.md b/prebuilds/README.md index 4313b97a..86f2d212 100644 --- a/prebuilds/README.md +++ b/prebuilds/README.md @@ -8,16 +8,16 @@ Each platform has prebuilds for Node.js 12 and 14. Create prebuilds for Mac OS X: ```bash -npx prebuildify --arch x64 --platform darwin --target 16.17.0 +npx prebuildify --arch x64 --platform darwin --target 18.17.0 ``` Prebuilds for Mac OS X with the M1 processor: ```bash -npx prebuildify --arch arm64 --platform darwin --target 16.17.0 +npx prebuildify --arch arm64 --platform darwin --target 18.17.0 ``` Create prebuilds for Windows 10: ```bash -npx prebuildify --arch x64 --platform win32 --target 16.17.0 +npx prebuildify --arch x64 --platform win32 --target 18.17.0 ``` diff --git a/prebuilds/darwin-arm64/node.abi108.node b/prebuilds/darwin-arm64/node.abi108.node index c8dd97d4..56a97a66 100755 Binary files a/prebuilds/darwin-arm64/node.abi108.node and b/prebuilds/darwin-arm64/node.abi108.node differ diff --git a/prebuilds/darwin-arm64/node.abi93.node b/prebuilds/darwin-arm64/node.abi93.node deleted file mode 100755 index b819d4f7..00000000 Binary files a/prebuilds/darwin-arm64/node.abi93.node and /dev/null differ diff --git a/prebuilds/darwin-x64/node.abi108.node b/prebuilds/darwin-x64/node.abi108.node index b55e54c3..1d5ce0b4 100755 Binary files a/prebuilds/darwin-x64/node.abi108.node and b/prebuilds/darwin-x64/node.abi108.node differ diff --git a/prebuilds/darwin-x64/node.abi93.node b/prebuilds/darwin-x64/node.abi93.node deleted file mode 100755 index 33d1e734..00000000 Binary files a/prebuilds/darwin-x64/node.abi93.node and /dev/null differ diff --git a/prebuilds/win32-x64/node.abi108.node b/prebuilds/win32-x64/node.abi108.node index e1d60c2a..f82e0e34 100644 Binary files a/prebuilds/win32-x64/node.abi108.node and b/prebuilds/win32-x64/node.abi108.node differ diff --git a/prebuilds/win32-x64/node.abi93.node b/prebuilds/win32-x64/node.abi93.node deleted file mode 100644 index 7fdd79b2..00000000 Binary files a/prebuilds/win32-x64/node.abi93.node and /dev/null differ diff --git a/scripts/build.js b/scripts/build.js index bdd03597..0e5ab34d 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -16,7 +16,7 @@ shell.cd(`${env.sourceFolder}`); if (env.isWindows) { const output = env.isVerbose ? '' : ' > NUL'; - exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`); + exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output} -DWITH_OPENSSL=OFF -DWITH_CYRUS_SASL=OFF`); exec(`cmake --build .${output}`); } else { const flags = '-w'; diff --git a/scripts/env.js b/scripts/env.js index 1c1ee2ea..c0543478 100644 --- a/scripts/env.js +++ b/scripts/env.js @@ -21,7 +21,6 @@ function checkIfAlreadyBuilt(env) { const isWindows = process.platform.toLowerCase().includes('win32'); const rootFolder = setRoot({ isWindows }); -const zookeeperVersion = '3.5.8'; const downloadedFolderName = 'zookeeper-client-c'; const downloadedFileName = 'zookeeper-client-c.tar.gz'; @@ -29,7 +28,6 @@ const variables = { rootFolder, workFolder: `${rootFolder}/deps`, buildFolder: `${rootFolder}/build/zk`, - zookeeperVersion, downloadedFolderName, sourceFolder: `${rootFolder}/deps/zookeeper-client-c`, downloadedFileName, diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 4ac12399..c08b1fb3 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -18,10 +18,6 @@ function applyPatches() { shell.sed('-i', '#include "zookeeper_log.h"', '#include "zookeeper_log.h"\n#include "winport.h"\n', `${destination}/zk_log.c`); shell.sed('-i', '#include "zookeeper.h"', '#include "winport.h"\n#include "zookeeper.h"\n', `${destination}/zk_adaptor.h`); shell.sed('-i', '#include "zk_adaptor.h"', '#include "zk_adaptor.h"\n#include "winport.h"\n', `${destination}/zookeeper.c`); - shell.sed('-i', /(FIPS_mode\(\) == 0)/, '0 == 0', `${destination}/zookeeper.c`); - shell.sed('-i', /(FIPS mode is OFF)/, 'Disabled the FIPS check', `${destination}/zookeeper.c`); - } else { - shell.exec(`patch -d ${env.rootFolder} -p0 --forward < ${env.workFolder}/no-fipsmode.patch`); } } diff --git a/tests/unit/zookeeper/exportedconstantstest.js b/tests/unit/zookeeper/exportedconstantstest.js index f7a16d26..46d0d62f 100644 --- a/tests/unit/zookeeper/exportedconstantstest.js +++ b/tests/unit/zookeeper/exportedconstantstest.js @@ -1,5 +1,5 @@ -const test = require('ava'); const { join } = require('path'); +const test = require('ava'); const NativeZk = require('node-gyp-build')(join(__dirname, '../../../')).ZooKeeper; const constants = require('../../../lib/constants'); const ZooKeeper = require('../../../lib/zookeeper'); diff --git a/tests/unit/zookeeper/nativeobjecttest.js b/tests/unit/zookeeper/nativeobjecttest.js index 38561846..2ef3cb5d 100644 --- a/tests/unit/zookeeper/nativeobjecttest.js +++ b/tests/unit/zookeeper/nativeobjecttest.js @@ -1,5 +1,5 @@ -const test = require('ava'); const { join } = require('path'); +const test = require('ava'); const NativeZk = require('node-gyp-build')(join(__dirname, '../../../')).ZooKeeper; const ZooKeeper = require('../../../lib/zookeeper');