hibari / hibari

Hibari is a production-ready, distributed, ordered key-value, big data store. Hibari uses chain replication for strong consistency, high-availability, and durability. Hibari has excellent performance especially for read and large value operations.
Other
272 stars 29 forks source link

reltool command will fail to generate package due to broken symlinks created by repo command #47

Closed tatsuya6502 closed 9 years ago

tatsuya6502 commented 9 years ago

The initial run of repo sync command seems to create broken links in .git directories, and this behavior causes reltool command to fail.

$ make package
...
generating: hibari-0.1.11-dev-x86_64-unknown-linux-gnu-64 ...
./rebar generate
==> rel (generate)
ERROR: Unable to generate spec: read file info /home/user/projects/hibari-0.1.11/tmp/rel/../lib/cluster_info/.git/shallow failed
ERROR: Unexpected error: rebar_abort
ERROR: generate failed while processing /home/user/projects/hibari-0.1.11/tmp/rel: rebar_abort
make: *** [generate] Error 1

Workaround this by adding find command to the Makefile to find and delete such broken links.

tatsuya6502 commented 9 years ago

Workaround this by adding find command to the Makefile to find and delete such broken links.

Fixed this via https://github.com/hibari/hibari/commit/cbe0a30eb6e9bab07b0fd2d8245199f60ca957fd. It's on dev branch. I'll merge it into release-0.1.11 branch later.

Tested on Fedora 20 GNU/Linux x86_64.

Before Fix

/home/tatsuya/workhub/dev/hibari/hibari% cat /etc/os-release
NAME=Fedora
VERSION="20 (Heisenbug)"
ID=fedora
VERSION_ID=20
PRETTY_NAME="Fedora 20 (Heisenbug)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:20"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=20
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=20

/home/tatsuya/workhub/dev/hibari/hibari% repo --version
repo version v1.12.18
       (from https://gerrit.googlesource.com/git-repo)
repo launcher version 1.21
       (from /home/tatsuya/bin/repo)
git version 1.9.3
Python 2.7.5 (default, Nov  3 2014, 14:26:24) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-7)]

/home/tatsuya/workhub/dev/hibari/hibari% repo status
project hibari/                                 branch dev
 --     p.patch
project hibari-doc/                             branch dev
project hibari/lib/asciiedoc/                   branch dev
project hibari/lib/cluster_info/                branch dev
 -m     .rebar/erlcinfo
project hibari/lib/congestion_watcher/          branch dev
project hibari/lib/edown/                       branch dev
 --     .rebar/erlcinfo
project hibari/lib/gdss_admin/                  branch dev
project hibari/lib/gdss_brick/                  branch dev
project hibari/lib/gdss_client/                 branch dev
project hibari/lib/gdss_ubf_proto/              branch dev
project hibari/lib/gmt_util/                    branch dev
project hibari/lib/lager/                       branch dev
 --     .rebar/erlcinfo
project hibari/lib/meck/                        branch dev
project hibari/lib/partition_detector/          branch dev
project hibari/lib/qc/                          branch dev
project hibari/lib/ubf/                         branch upstream-master
project hibari/lib/ubf_thrift/                  branch upstream-master
project patches/                                branch dev

/home/tatsuya/workhub/dev/hibari/hibari% make package
...
generating: hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64 ...
./rebar generate
==> rel (generate)
ERROR: Unable to generate spec: read file info /home/tatsuya/workhub/dev/hibari/hibari/rel/../lib/cluster_info/.git/shallow failed
ERROR: Unexpected error: rebar_abort
ERROR: generate failed while processing /home/tatsuya/workhub/dev/hibari/hibari/rel: rebar_abort
make: *** [generate] Error 1

/home/tatsuya/workhub/dev/hibari/hibari% find . -type l -exec test ! -e {} \; -print
./lib/gmt_util/.git/shallow
./lib/partition_detector/.git/shallow
./lib/gdss_ubf_proto/.git/shallow
./lib/gdss_brick/.git/shallow
./lib/meck/.git/shallow
./lib/ubf_thrift/.git/shallow
./lib/ubf/priv/doc/src/bootstrap
./lib/ubf/priv/doc/src/asciidoc.js
./lib/ubf/.git/shallow
./lib/gdss_client/.git/shallow
./lib/lager/.git/shallow
./lib/congestion_watcher/.git/shallow
./lib/qc/.git/shallow
./lib/cluster_info/.git/shallow
./lib/edown/.git/shallow
./lib/asciiedoc/.git/shallow
./lib/gdss_admin/.git/shallow
./.git/shallow

After Fix

/home/tatsuya/workhub/dev/hibari/hibari% cat p.patch
diff --git a/Makefile b/Makefile
index ec534da..8eb06d0 100644
--- a/Makefile
+++ b/Makefile
@@ -98,6 +98,7 @@ generate: clean compile
    @echo "generating: $(RELPKG) ..."
    @find ./lib -name svn -type l | xargs rm -f
    @find ./lib -name rr-cache -type l | xargs rm -f
+   @find . -name shallow -type l -exec test ! -e {} \; -print | xargs rm -f
    ./rebar generate
    @perl -i -pe 's/%% (.* generated) at .*//g;' \
        rel/hibari/releases/*/*.rel \

/home/tatsuya/workhub/dev/hibari/hibari% git apply p.patch

/home/tatsuya/workhub/dev/hibari/hibari% make package
...

generating: hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64 ...
./rebar generate
==> rel (generate)
WARN:  'generate' command does not apply to directory /home/tatsuya/workhub/dev/hibari/hibari
packaging: hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64 ...
be2b527b21f647cb2131d12962d66c5d  hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64.tgz
-rw-rw-r-- 1 tatsuya tatsuya       83 Mar 10 21:13 hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64-md5sum.txt
-rw-rw-r-- 1 tatsuya tatsuya 20791641 Mar 10 21:13 hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64.tgz

/home/tatsuya/workhub/dev/hibari/hibari% make check-package
...
bootstrapping package: hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64 ...
make: [bootstrap-package] Error 127 (ignored)
tar -C ./tmp -xzf ../hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64.tgz
./tmp/hibari/bin/hibari start
./tmp/hibari/bin/hibari-admin bootstrap
ok
checking package: hibari-0.3.0-dev-x86_64-unknown-linux-gnu-64 ...
./tmp/hibari/bin/hibari-admin client-add hibari@127.0.0.1
ok
./tmp/hibari/bin/hibari-admin client-list
['hibari@127.0.0.1']
./tmp/hibari/bin/hibari-admin client-delete hibari@127.0.0.1
ok
./tmp/hibari/bin/hibari checkpoint
ok
./tmp/hibari/bin/hibari stop
ok