The error in full looks like (as pip install finishes inside the build):
Running setup.py install for <module> ... done
Successfully installed <module>-<version>
api: Writing configuration
api: Writing service management scripts
api: Using run hook /src/habitat/hooks/run
api: Stripping unneeded symbols from binaries and libraries
strip: /hab/pkgs/<origin>/<package>/2.0.0/20161125203757/lib/python2.7/site-packages/.libs_cffi_backend/stkCxH1R: Not enough room for program headers, try linking with -N
strip:/hab/pkgs/<origin>/<package>/2.0.0/20161125203757/lib/python2.7/site-packages/.libs_cffi_backend/stkCxH1R[.note.gnu.build-id]: Bad value
I'm seeing this on macOS El Capitan when building a fairly complex Python app inside the Studio. While I can't share the source code, I _can_ share edited requirements.txt and plan.sh content:
$ cat plan.sh
pkg_name=<pkgname>
pkg_version=2.0.0
pkg_maintainer=""
pkg_license=("All Rights Reserved")
pkg_source=""
pkg_origin="<origin>"
pkg_deps=(
bixu/hdf5
core/libffi
core/postgresql
core/python2
)
pkg_build_deps=(
core/cacerts
core/gcc
core/git
core/openssl
)
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)
pkg_include_dirs=(include)
pkg_expose=(8080)
do_download(){
return 0
}
do_verify(){
return 0
}
do_unpack(){
return 0
}
do_prepare(){
export LD_LIBRARY_PATH=$(hab pkg path core/gcc)/lib
export SSL_CERT_FILE=$(hab pkg path core/cacerts)/ssl/cert.pem
export HOME=/src
pip install --upgrade pip virtualenv
virtualenv "$pkg_prefix"
source "$pkg_prefix/bin/activate"
}
do_build(){
return 0
}
do_install(){
# we have to pre-install some modules in a certain order to get around `pip` dep problems
pip install $(grep numpy /src/requirements.txt)
pip install $(grep numexpr /src/requirements.txt)
pip install $(grep Cython /src/requirements.txt)
pip install -r /src/requirements.dev.txt
pip install /src # here we are installing our internal python module
}
$ cat requirements.txt
astroid==1.4.8
cov-core==1.15.0
coverage==4.2
execnet==1.4.1
ipdb==0.10.1
ipython==5.1.0
logilab-common==1.2.2
mock==2.0.0
nose==1.3.7
pdbpp==0.8.3
py==1.4.30
pytest==3.0.3
pytest-catchlog==1.2.2
pytest-mock==1.3.0
pytest-cov==2.4.0
pytest-cache==1.0
pytest-pep8==1.0.6
pytest-random==0.02
pytest-watch==4.1.0
pytest-pylint==0.6.0
pytest-timeout==1.0.0
pep8==1.7.0
pylint==1.6.4
Sphinx==1.5a2
sqlalchemy-schemadisplay==1.2
WTForms==2.1
Babel==2.2.0
backports.ssl-match-hostname==3.5.0.1
Cython==0.25.1
Flask-Autodoc==0.1.2
Flask-SQLALchemy==2.1
Flask==0.11.1
ftputil==3.3.1
Jinja2==2.7.3
Mako==1.0.1
MarkupSafe==0.23
SQLAlchemy==1.1.4
Werkzeug==0.11.11
alembic==0.8.8
ansible==1.8.2
argparse==1.2.1
bcrypt==2.0.0
blinker==1.4
boto3==1.2.2
boto==2.38.0
bugsnag==2.5.2
celery==3.1.23
click==6.2
greenlet==0.4.7
itsdangerous==0.24
newrelic==2.66.0.49
numexpr==2.6.1
numpy==1.11.1
pandas==0.18.1
pdfkit==0.5.0
perfmetrics==2.0
prettytable==0.7.2
psycopg2==2.6.2
python-dateutil==2.4.0
python-redis-lock==3.1.0
pytz==2016.6.1
requests[security]==2.7.0
redis==2.10.5
scikit-learn==0.15.2
scipy==0.18.0
setuptools==17.1
six==1.10.0
structlog==16.1.0
termcolor==1.1.0
uwsgi==2.0.11.2
wsgiref==0.1.2
I have no custom HAB environment variables set.
Hi there!
If the default behavior of stripping ELF binaries isn't working for you, do adding a
do_strip() {
return 0
}
help you out? Not every Plan works with this default, but we hypothesize that the vast majority benefit from this (similar to most other Linux distribution packaging systems).
Yes that does work :)
Sent from my iPhone
On 27 Nov 2016, at 19:05, Fletcher Nichol notifications@github.com wrote:
Hi there!
If the default behavior of stripping ELF binaries isn't working for you, do adding a
do_strip() {
return 0
}
help you out? Not every Plan works with this default, but we hypothesize that the vast majority benefit from this (similar to most other Linux distribution packaging systems).—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Ran into this today. I didn't like the answer of not stripping your binaries.
Pythoners like to include pre-built binaries inside their module. You have the option to ignore these pre-built things and always build from source.
pip install --no-binary :all: <package> or pip install --no-binary :all: -r requirements.txt will force pip to build from source. Be prepared to add more dependencies other than just core/python, as you’ll need core/gcc and any other libraries needed.
ref: http://serverfault.com/questions/774546/linux-binary-strip-error-when-using-pip-install-not-enough-room-for-program-hea
ref: https://github.com/numpy/numpy/issues/7570
now i can use the default do_strip() without any stubs.
@eeyun, perhaps @bdangit's advice (I think I remember @georgemarshall saying the same thing) should be part of core/scaffolding-python?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.