Percona-Lab / mongodb_consistent_backup

A tool for performing consistent backups of MongoDB Clusters or Replica Sets
https://www.percona.com
Apache License 2.0
276 stars 81 forks source link

build script error #119

Closed peterhenryfirst closed 7 years ago

peterhenryfirst commented 7 years ago

Hi,

When I try to build the project, I received an error from the scripts/build.sh file in line:

${venvdir}/bin/python2.7 ${venvdir}/bin/pip install --download-cache=${pipdir} pex requests

I changed to the pip install option:

--cache-dir

And build process finished correctly.

Should be your pip version is too old? My current version of python is 2.7.13 and pip version is 9.0.1

I do not know if the build script is correct or not.

timvaillancourt commented 7 years ago

Thanks @peterhenryfirst, I can confirm --download-cache seems to no longer exist as a flag for pip, at least for my version: 8.1.2. I'm guessing it existed earlier in this tool's development. My pip version throws no error about it, however.

Out of curiosity, could you provide the error you get?

I'll update the flag to use --cache-dir in an upcoming release, for now I suggest you do the workaround you mention. Thanks!

peterhenryfirst commented 7 years ago

Hi @timvaillancourt,

Of course, this is the log when I execute the build script:

[vagrant@mongobackupboxcentos mgbackup_master]$ PYTHON_BIN=/usr/local/bin/python2.7 make
PYTHON_BIN=/usr/local/bin/python2.7 VIRTUALENV_BIN= bash scripts/build.sh
+ name=mongodb-consistent-backup
+ mod_name=mongodb_consistent_backup
+++ dirname scripts/build.sh
++ readlink -f scripts/..
+ rootdir=/home/vagrant/mgbackup_master
+ srcdir=/home/vagrant/mgbackup_master/mongodb_consistent_backup
+ bindir=/home/vagrant/mgbackup_master/bin
+ builddir=/home/vagrant/mgbackup_master/build
+ tmpdir=/home/vagrant/mgbackup_master/tmp
+ pexdir=/home/vagrant/mgbackup_master/tmp/pex
+ pipdir=/home/vagrant/mgbackup_master/tmp/pip
+ venvdir=/home/vagrant/mgbackup_master/build/venv
+ output_file=/home/vagrant/mgbackup_master/bin/mongodb-consistent-backup
+ require_file=/home/vagrant/mgbackup_master/build/requirements.txt
+ version_file=/home/vagrant/mgbackup_master/build/VERSION
+ python_bin=/usr/local/bin/python2.7
+ '[' -z /usr/local/bin/python2.7 ']'
+ '[' -z /usr/local/bin/python2.7 ']'
+ '[' '!' -x /usr/local/bin/python2.7 ']'
++ /usr/local/bin/python2.7 --version
++ awk '{print $2}'
++ cut -d . -f1-2
+ '[' '!' 2.7 = 2.7 ']'
+ virtualenv_bin=
+ '[' -z '' ']'
++ uname
+ [[ Linux =~ Darwin ]]
++ whereis -b virtualenv
++ tr ' ' '\n'
++ egrep '/virtualenv$'
++ head -1
+ virtualenv_bin=/usr/local/bin/virtualenv
+ '[' -z /usr/local/bin/virtualenv ']'
+ '[' '!' -x /usr/local/bin/virtualenv ']'
+ '[' -d /home/vagrant/mgbackup_master/mongodb_consistent_backup ']'
+ '[' -e /home/vagrant/mgbackup_master/build ']'
+ mkdir -p /home/vagrant/mgbackup_master/build
+ cp -dpR /home/vagrant/mgbackup_master/mongodb_consistent_backup /home/vagrant/mgbackup_master/build/mongodb_consistent_backup
+ cp -dp /home/vagrant/mgbackup_master/setup.py /home/vagrant/mgbackup_master/requirements.txt /home/vagrant/mgbackup_master/README.rst /home/vagrant/mgbackup_master/VERSION /home/vagrant/mgbackup_master/build
+ find /home/vagrant/mgbackup_master/build -type f -name '*.pyc' -delete
+ '[' -f /home/vagrant/mgbackup_master/build/VERSION ']'
++ cat /home/vagrant/mgbackup_master/build/VERSION
+ version=1.0.1
+ '[' -z 1.0.1 ']'
+ sed -i -e s@#.#.#@1.0.1@g /home/vagrant/mgbackup_master/build/setup.py
+ sed -i -e s@#.#.#@1.0.1@g /home/vagrant/mgbackup_master/build/mongodb_consistent_backup/__init__.py
++ git show
++ awk 'NR==1{print $2}'
+ git_commit=d84c041c3abdf3ca4228bb88b892353bc71fefc6
+ '[' -z d84c041c3abdf3ca4228bb88b892353bc71fefc6 ']'
+ sed -i -e s@GIT_COMMIT_HASH@d84c041c3abdf3ca4228bb88b892353bc71fefc6@g /home/vagrant/mgbackup_master/build/mongodb_consistent_backup/__init__.py
+ /usr/local/bin/python2.7 /usr/local/bin/virtualenv -p /usr/local/bin/python2.7 /home/vagrant/mgbackup_master/build/venv
Already using interpreter /usr/local/bin/python2.7
New python executable in /home/vagrant/mgbackup_master/build/venv/bin/python2.7
Also creating executable in /home/vagrant/mgbackup_master/build/venv/bin/python
Installing setuptools, pip, wheel...done.
+ '[' 0 -gt 0 ']'
+ source /home/vagrant/mgbackup_master/build/venv/bin/activate
++ deactivate nondestructive
++ unset -f pydoc
++ '[' -z '' ']'
++ '[' -z '' ']'
++ '[' -n /bin/bash ']'
++ hash -r
++ '[' -z '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/home/vagrant/mgbackup_master/build/venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin
++ PATH=/home/vagrant/mgbackup_master/build/venv/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin
++ export PATH
++ '[' -z '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' x '!=' x ']'
+++ basename /home/vagrant/mgbackup_master/build/venv
++ PS1='(venv) '
++ export PS1
++ alias pydoc
++ '[' -n /bin/bash ']'
++ hash -r
+ '[' '!' -d /home/vagrant/mgbackup_master/tmp/pip ']'
+ mkdir -p /home/vagrant/mgbackup_master/tmp/pip
+ /home/vagrant/mgbackup_master/build/venv/bin/python2.7 /home/vagrant/mgbackup_master/build/venv/bin/pip install --download-cache=/home/vagrant/mgbackup_master/tmp/pip pex requests

Usage:
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --download-cache
+ '[' 2 -gt 0 ']'
+ echo 'Failed to install pex utility for building!'
Failed to install pex utility for building!
+ exit 1
make: *** [bin/mongodb-consistent-backup] Error 1
[vagrant@mongobackupboxcentos mgbackup_master]$
timvaillancourt commented 7 years ago

Thanks @peterhenryfirst, I suppose Pip 9.x throws the error you see for this while Pip 8.x (what we've tested on) ignores the error.

This fix will be in 1.0.2. Thanks!

timvaillancourt commented 7 years ago

This fix is available in this branch until release: https://github.com/Percona-Lab/mongodb_consistent_backup/tree/1.0.2

peterhenryfirst commented 7 years ago

Hi @timvaillancourt,

The fix works perfectly!

Could I close the issue?

Thanks.

timvaillancourt commented 7 years ago

Great, closing this one.