Skip to content

Commit

Permalink
Merge pull request #226 from DavidVujic/zookeeper_3_5_6
Browse files Browse the repository at this point in the history
Zookeeper 3.5.6 and rollback for Windows client (3.4.14)
  • Loading branch information
DavidVujic authored Nov 5, 2019
2 parents 5a8f20f + 6147cd8 commit b53615c
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 146 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- "8"
- "10"
- "12"
os:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.node
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:12

WORKDIR /app

Expand Down
Binary file removed deps/apache-zookeeper-3.5.5.tar.gz
Binary file not shown.
Binary file added deps/apache-zookeeper-3.5.6.tar.gz
Binary file not shown.
38 changes: 0 additions & 38 deletions example.js

This file was deleted.

3 changes: 1 addition & 2 deletions patches/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ set(zookeeper_sources
src/recordio.c
generated/zookeeper.jute.c
src/zk_log.c
src/zk_hashtable.c
src/addrvec.c)
src/zk_hashtable.c)

list(APPEND zookeeper_sources src/st_adaptor.c)

Expand Down
40 changes: 0 additions & 40 deletions patches/ZOOKEEPER-3078.patch

This file was deleted.

11 changes: 3 additions & 8 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,14 @@ if (env.isVerbose) {
shell.cd(`${env.sourceFolder}`);

if (env.isWindows) {
let flags = '-DWANT_SYNCAPI=OFF ';
let output = '';

if (!env.isVerbose) {
flags = '';
output = ' > NUL';
}
exec(`cmake ${flags}-DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`);
const output = env.isVerbose ? '' : ' > NUL';
exec(`cmake -DWANT_SYNCAPI=OFF -DCMAKE_GENERATOR_PLATFORM=${process.arch} .${output}`);
exec(`cmake --build .${output}`);
} else {
const flags = '-w';
let configureCmd = `./configure CFLAGS='${flags}' --without-syncapi --disable-shared --with-pic --without-cppunit`;
let makeCmd = 'make';

if (!env.isVerbose) {
configureCmd += ' --enable-silent-rules --quiet';
makeCmd += ' --no-print-directory --quiet';
Expand Down
23 changes: 16 additions & 7 deletions scripts/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ const isWindows = process.platform.toLowerCase().includes('win32');
const isSunOs = process.platform.toLowerCase().includes('sunos');
const rootFolder = setRoot({ isWindows });

// Don't forget to also update the sha1sum variable when upgrading the Zookeeper version
const zookeeperVersion = '3.5.5';
const downloadedFolderName = `apache-zookeeper-${zookeeperVersion}`;
let zookeeperVersion;
let downloadedFolderName;
let sha512sum;
const suffix = '.tar.gz';
const downloadedFileName = `${downloadedFolderName}${suffix}`;

// Update the checksum when upgrading the Zookeeper version
const sha512sum = `4e22df899a83ca3cc15f6d94daadb1a8631fb4108e67b4f56d1f4fcf95f10f89c8ff1fb8a7c84799a3856d8803a8db1e1f2f3fe1b7dc0d6cedf485ef90fd212d ${downloadedFileName}`;
let downloadedFileName;

if (isWindows) {
zookeeperVersion = '3.4.14';
downloadedFolderName = `zookeeper-${zookeeperVersion}`;
downloadedFileName = `${downloadedFolderName}${suffix}`;
sha512sum = `b2e03d95f8cf18b97a46e2f53871cef5a5da9d5d80b97009375aed7fb35368c440ca944c7e8b64efabbc065f6fb98bb86239f7c1491f0490efc71876d5a7f424 ${downloadedFileName}`;
} else {
zookeeperVersion = '3.5.6';
downloadedFolderName = `apache-zookeeper-${zookeeperVersion}`;
downloadedFileName = `${downloadedFolderName}${suffix}`;
sha512sum = `7f45817cbbc42aec5a7817fa2ae99656128e666dc58ace23d86bcfc5ca0dc49e418d1a7d1f082ad80ccb916f9f1b490167d16f836886af1a56fbcf720ad3b9d0 ${downloadedFileName}`;
}

const variables = {
rootFolder,
Expand Down
4 changes: 1 addition & 3 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function validateFile(fileName) {
}

if (res !== env.sha512sum) {
throw new Error(`Wrong sha512 for ${fileName}! Expected "${env.sha512sum}", got "${res}".`);
throw new Error(`Wrong sha for ${fileName}! Expected "${env.sha512sum}", got "${res}".`);
}
}

Expand Down Expand Up @@ -89,8 +89,6 @@ function applyPatches() {
shell.cp(`${env.patchesFolder}/${cmakeFile}`, `${env.sourceFolder}/${cmakeFile}`);
}
} else {
exec(`patch -p0 < ${env.patchesFolder}/ZOOKEEPER-3078.patch`);

decompress(`${env.patchesFolder}/autoreconf.tar.gz`, `${env.patchesFolder}`, {
plugins: [
decompressTargz(),
Expand Down
Loading

0 comments on commit b53615c

Please sign in to comment.