From user-return-12236-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Oct 14 08:15:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D48A6180648 for ; Mon, 14 Oct 2019 10:15:02 +0200 (CEST) Received: (qmail 35425 invoked by uid 500); 14 Oct 2019 08:14:59 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 35413 invoked by uid 99); 14 Oct 2019 08:14:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2019 08:14:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0D42AC0463 for ; Mon, 14 Oct 2019 08:14:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.601 X-Spam-Level: X-Spam-Status: No, score=0.601 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=0.1] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VTk30nueThX0 for ; Mon, 14 Oct 2019 08:14:52 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::542; helo=mail-ed1-x542.google.com; envelope-from=szalay.beko.mate@gmail.com; receiver= Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 15FFF7F5E2 for ; Mon, 14 Oct 2019 08:14:52 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id r9so13980723edl.10 for ; Mon, 14 Oct 2019 01:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IcEai7/6Lhwv6HS95I1gxMQw6iqofzi4507iJZwZ5Qs=; b=lxeQH8bhsahMuPQhSlPCF7nM6Ad3cd1d0prYsi4/LBV4HiV5af2Ir9wAQMPDnur60d LElvjonyfBVvsFdoULW8gjMRKcMiQivCu8nkxHb7dWO1Env+efWRgzTJ0rkmovW6Jh/Q YBNOiEjhg9HIsRjDLWgCn8nr8H7rmr1MeQQL4qmsM9uamHzyCLZfDA3tkyHJLeW9Me/g 4LeWfGELJzkLBAtcvxIzfN/v+s/HdOqaQCeT0BsCMttQSAi/Iskz/syJXQZ4b2M4SvvE sRZbG/9VRXPWQp4TxqQGKsS6keuG6WHXtI1XpgRgvbDgIrSXN2w43h2xalX++036Tqd4 a4sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IcEai7/6Lhwv6HS95I1gxMQw6iqofzi4507iJZwZ5Qs=; b=Kb8V0At8c6mKdiJz9Gchpn524eSmaR9KzWfEYYA5LrEE3P+u2qyAdggVT4acanuWJY vhHRxxvJ0yDz1/jr5T8hzB4a1KJAHeQTf0mMzBLv/siPIhMD1pZ61e8wyNkbm6322c7n fVg0wVh9Eb1L/6Tybms0rDyApbgWS8Zz5DgqZryUMpt32a8Ajrpcte44CO9zql3pdncB CE8lhb37znavFLu8pirDi/Cn5THZeXWYPQY9Q87r29h0ekmzZDKItDOViy3GGEMUaOLF QZEr1yXVAQxufFi9/m1viIGQeG4UhEJAJW7VbEZ3iDTr3kEsne80oJyDFC8uN+Nu1jK7 732g== X-Gm-Message-State: APjAAAVmtz5F14yjkmDu+aZGGubUzrDjgBuHx8MBbvLt2NZM6eoe/UqY xvanVrQHowO5Uy/tpaUJ4hJM6Nt3x2Dv3bn8BLSXdK95wA== X-Google-Smtp-Source: APXvYqwvh9rV0keNJiJCAOoGJv2x2Ja74kPpVEnYkG0R8Lf0Xm1cN/E3Fpf4MOxdQUGRiAgZXHiNZEvTnKaGCPEyr74= X-Received: by 2002:a17:906:7fd3:: with SMTP id r19mr27823579ejs.46.1571040891334; Mon, 14 Oct 2019 01:14:51 -0700 (PDT) MIME-Version: 1.0 References: <1570797375697-0.post@n2.nabble.com> In-Reply-To: From: =?UTF-8?B?U3phbGF5LUJla8WRIE3DoXTDqQ==?= Date: Mon, 14 Oct 2019 10:14:39 +0200 Message-ID: Subject: Re: Compilation issues with ZkTreeUtil in v3.5.5 To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="0000000000004174150594da76c8" --0000000000004174150594da76c8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Guys! I had to do compilations of the C-client on different platforms with different zookeeper versions recently, and usually it was a different challenge all the time :) I know it is possible to compile the C code without ant / maven, but I try to stick to the maven-way of the build below. I think that should be the 'official' way. But it is a bit buggy for 3.5.5... I recorded the following steps to build the 3.5.5 C-client in Ubuntu 18.4 using docker: First, just start the docker image (I mount /tmp of the host machine to make it easier to copy the results later) docker run --volume /tmp:/root/host_tmp -it --rm ubuntu:18.04 /bin/bash then we install some additional packages, download the zookeeper source code and set a few environment variables needed for the build: apt update && apt install -y libcppunit-dev maven default-jdk-headless autoconf libtool g++ make software-properties-common pkg-config wget git cd /root wget https://archive.apache.org/dist/zookeeper/zookeeper-3.5.5/apache-zookeeper-= 3.5.5.tar.gz tar xzvf apache-zookeeper-3.5.5.tar.gz export JAVA_HOME=3D/usr/lib/jvm/java-11-openjdk-amd64/ export ACLOCAL=3D"aclocal -I /usr/share/aclocal" cd apache-zookeeper-3.5.5/ with the g++ 7.4.0 we have in ubuntu 18.4, we get some compilation errors, so we have to apply patch for ZOOKEEPER-3539.patch wget https://github.com/apache/zookeeper/commit/44911cfb3f04af09947d51403d55418d= 422e5c41.patch -O ZOOKEEPER-3539.patch git apply ./ZOOKEEPER-3539.patch Now it gets a bit dirty... before ZOOKEEPER-3436, it is not possible to compile the C-client with maven without tests. If you would simply compile the code now, you would get some permission problems when the tests get started, what you can fix by: chmod +x /root/apache-zookeeper-3.5.5/zookeeper-client/zookeeper-client-c/../../zook= eeper-client/zookeeper-client-c/tests/zkServer.sh The line above will help you to start the tests. Now the compilation should work. But some tests can fail (might be flaky?). I just saw e.g. the testcase testReadOnly to fail. I remember I also had some problems with this test in ZOOKEEER-2122, where I eventually I fixed it, (this PR is still open) but it might be unrelated. I haven't investigated why this fails for me on 3.5.5. So I simply choose to disable the tests here. We could skip the tests with ZOOKEEPER-3436, but this patch unfortunately can not be applied on 3.5.5 simply, so I did the following hack, which will skip the test execution: sed -i -e 's/clean check/clean install/g' zookeeper-client/zookeeper-client-c/pom.xml And now finally you can start the build using maven: mvn clean install -Pfull-build -DskipTests And you can find / save the compiled C-client code from docker to your host machine in the following way. (I also have an open PR which will help you with this, but it is not merged yet: ZOOKEEPER-3530) cp -R zookeeper-client/zookeeper-client-c/target/c/bin /root/host_tmp/zookeeper-c-client/ cp -R zookeeper-client/zookeeper-client-c/target/c/lib /root/host_tmp/zookeeper-c-client/ cp -R zookeeper-client/zookeeper-client-c/target/c/include /root/host_tmp/zookeeper-c-client/ I hope it helps... Mate On Fri, Oct 11, 2019 at 7:51 PM Enrico Olivelli wrote= : > Can you try with 3.5.6 release candidate 4? > > Enrico > > Il ven 11 ott 2019, 18:28 rajsura ha scritto: > > > I have used multiple versions of GCC and the issue exists in both the > cases > > (gcc-4.8.5 and gcc-7.3.1). > > > > I have followed the instructions given in README.txt. Also, due to > > restructuring in 3.5.5, I had to update ZOOKEEPER_PATH in configure.ac > as > > below: > > > > # Zookeeper C client > > ZOOKEEPER_PATH=3D${BUILD_PATH}/../../zookeeper-client/zookeeper-client-= c > > > > I am encountering these errors during "make" phase: > > > > $ make > > make all-recursive > > make[1]: Entering directory > > > > > '/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-z= ktreeutil' > > Making all in src > > make[2]: Entering directory > > > > > '/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-z= ktreeutil/src' > > g++ -DHAVE_CONFIG_H -I. -I.. > > > > > -I/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contrib-= zktreeutil/../../zookeeper-client/zookeeper-client-c/include > > -I/tmp/bar2/zookeeper-3.5.5-SNAPSHOT/zookeeper-contrib/zookeeper-contri > > b-zktreeutil/../../zookeeper-client/zookeeper-client-c/generated > > -I../include -I/usr/local/include -I/usr/include -I/usr/include/libxml2 > -g > > -O2 -MT ZkAdaptor.o -MD -MP -MF .deps/ZkAdaptor.Tpo -c -o ZkAdaptor.o > > ZkAdaptor.cc > > ZkAdaptor.cc: In member function =E2=80=98bool > > zktreeutil::ZooKeeperAdapter::createNode(const string&, const string&, > int, > > bool)=E2=80=99: > > ZkAdaptor.cc:276:18: error: =E2=80=98zoo_create=E2=80=99 was not declar= ed in this scope > > rc =3D zoo_create( mp_zkHandle, > > ^~~~~~~~~~ > > ZkAdaptor.cc:276:18: note: suggested alternative: =E2=80=98zoo_acreate= =E2=80=99 > > rc =3D zoo_create( mp_zkHandle, > > ^~~~~~~~~~ > > zoo_acreate > > ZkAdaptor.cc: At global scope: > > ZkAdaptor.cc:334:26: warning: dynamic exception specifications are > > deprecated in C++11 [-Wdeprecated] > > int version) throw(ZooKeeperException) > > ^~~~~ > > ZkAdaptor.cc: In member function =E2=80=98bool > > zktreeutil::ZooKeeperAdapter::deleteNode(const string&, bool, int)=E2= =80=99: > > ZkAdaptor.cc:344:18: error: =E2=80=98zoo_delete=E2=80=99 was not declar= ed in this scope > > rc =3D zoo_delete( mp_zkHandle, path.c_str(), version ); > > ^~~~~~~~~~ > > ZkAdaptor.cc:344:18: note: suggested alternative: =E2=80=98zoo_adelete= =E2=80=99 > > rc =3D zoo_delete( mp_zkHandle, path.c_str(), version ); > > ^~~~~~~~~~ > > zoo_adelete > > ZkAdaptor.cc: At global scope: > > ZkAdaptor.cc:383:77: warning: dynamic exception specifications are > > deprecated in C++11 [-Wdeprecated] > > vector< string > ZooKeeperAdapter::getNodeChildren (const string > > &path) > > throw (ZooKeeperException) > > > > ^~~~~ > > ZkAdaptor.cc: In member function =E2=80=98std::vector > > > > zktreeutil::ZooKeeperAdapter::getNodeChildren(const string&)=E2=80=99: > > ZkAdaptor.cc:395:18: error: =E2=80=98zoo_get_children=E2=80=99 was not = declared in this > > scope > > rc =3D zoo_get_children( mp_zkHandle, > > ^~~~~~~~~~~~~~~~ > > ZkAdaptor.cc:395:18: note: suggested alternative: =E2=80=98zoo_aget_chi= ldren=E2=80=99 > > rc =3D zoo_get_children( mp_zkHandle, > > ^~~~~~~~~~~~~~~~ > > zoo_aget_children > > > > Its weird because, "zookeeper.h" is accessible and these are still > defined > > in there. > > > > Am I missing something here? Thanks! > > > > > > > > > > > > -- > > Sent from: http://zookeeper-user.578899.n2.nabble.com/ > > > --0000000000004174150594da76c8--