commons icon indicating copy to clipboard operation
commons copied to clipboard

DistributionNotFound: PythonRequirement() on Raspberry Pi (armhf)

Open neutrinus opened this issue 10 years ago • 2 comments

I try to build our application on Raspberry PI (http://www.raspberrypi.org/) with python pants. Actually I'm doing this in raspbian run in qemu (http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/) - this is the easiest way to reproduce it without having a raspberry pi hardware.

(deploy)pi@raspberrypi ~/wh-monit/src $ pants --version
0.0.11
(deploy)pi@raspberrypi ~/wh-monit/src $ pip search twitter.pants
twitter.pants             - Twitter's pants build tool.
  INSTALLED: 0.0.14-dev2 (latest)
(deploy)pi@raspberrypi ~/wh-monit/src $ PANTS_VERBOSE=1 PYTHON_VERBOSE=2 pants build :agent
twitter.common.python: Installing /tmp/tmprKyccE: 7718.0ms
twitter.common.python: Installing /tmp/tmp14nUtZ: 6309.7ms
twitter.common.python: Installing /tmp/tmpgU_Qgl: 6415.6ms
Build operating on targets: OrderedSet([PythonBinary(BUILD:agent)])
Building PythonBinary PythonBinary(BUILD:agent):
Building PythonBinary PythonBinary(BUILD:agent):
  Dumping library: PythonLibrary(BUILD:agent-lib)
  Dumping library: PythonLibrary(BUILD:common-lib-deps)
  Dumping library: PythonLibrary(BUILD:common-lib-agent)
  Dumping library: PythonBinary(BUILD:agent)
  Dumping requirement: requests==1.2.3
  Dumping requirement: sh==1.09
  Dumping requirement: RPi.GPIO==0.5.3a
  Dumping requirement: procname==0.3
  Dumping requirement: psutil==1.1.0
  Dumping requirement: pyOpenSSL==0.13.1
  Dumping requirement: python-dateutil==2.1
  Dumping requirement: dicts==0.3.1
  Dumping requirement: nanotime==0.5.2
  Dumping requirement: pytz==2013b
  Dumping requirement: blist==1.3.4
  Dumping requirement: websocket-client==0.12.0
  Dumping requirement: furl==0.3.4
  Dumping requirement: voluptuous==0.8.0
  Dumping requirement: pyyaml
twitter.common.python: Obtaining PythonRequirement(pyyaml): 6.9ms
Failed to find distribute in sys.path!nRequirement(pyyaml) :: Distilling PyYAML
Failed to find distribute in sys.path!nRequirement(pyyaml) :: Distilling PyYAML
twitter.common.python: Obtaining PythonRequirement(pyyaml): 8599.5ms           
twitter.common.python:   Installing PyYAML: 4.3ms
twitter.common.python:   Distilling PyYAML: 3.4ms
twitter.common.python:   Installing PyYAML: 3.8ms
twitter.common.python:   Distilling PyYAML: 2.7ms
Problem executing PythonBuilder for targets OrderedSet([PythonBinary(BUILD:agent)]): Traceback (most recent call last):
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/commands/build.py", line 126, in _python_build
    conn_timeout=self.options.conn_timeout)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/python_builder.py", line 57, in build
    conn_timeout=conn_timeout).run()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/binary_builder.py", line 56, in run
    env = self.chroot.dump()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/python_chroot.py", line 190, in dump
    platforms=platforms)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/resolver.py", line 117, in resolve_multi
    distributions[platform] = working_set.resolve(requirements, env=env, installer=installer)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
DistributionNotFound: PythonRequirement(pyyaml)


Usage: 
  pants build (options) [spec] (build args)
  pants build (options) [spec]... -- (build args)

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --no-pantsrc          Specifies that pantsrc files should be ignored.
  --log-exit            Log an exit message on success or failure.
  -t CONN_TIMEOUT, --timeout=CONN_TIMEOUT
                        Number of seconds to wait for http connections.
  -i INTERPRETER, --interpreter=INTERPRETER
                        The interpreter requirement for this chroot.
  -v, --verbose         Show verbose output.

Builds the specified python target(s).

It's not about pyyaml, when I remove this dependency it would fail on voluptuous, then furl etc. Installing those packets via pip works perfectly:

(deploy)pi@raspberrypi ~/wh-monit/src $ pip install pyyaml
Downloading/unpacking pyyaml
  Downloading PyYAML-3.10.tar.gz (241Kb): 241Kb downloaded
  Running setup.py egg_info for package pyyaml

Installing collected packages: pyyaml
  Running setup.py install for pyyaml
    checking if libyaml is compilable
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c build/temp.linux-armv6l-2.7/check_libyaml.c -o build/temp.linux-armv6l-2.7/check_libyaml.o
    checking if libyaml is linkable
    gcc -pthread build/temp.linux-armv6l-2.7/check_libyaml.o -lyaml -o build/temp.linux-armv6l-2.7/check_libyaml
    building '_yaml' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c ext/_yaml.c -o build/temp.linux-armv6l-2.7/ext/_yaml.o
    In file included from ext/_yaml.c:223:0:
    ext/_yaml.h:6:0: warning: "PyUnicode_FromString" redefined [enabled by default]
    /usr/include/python2.7/unicodeobject.h:281:0: note: this is the location of the previous definition
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_get_version_string’:
    ext/_yaml.c:1145:17: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_7CParser___init__’:
    ext/_yaml.c:2074:38: warning: passing argument 2 of ‘yaml_parser_set_input’ from incompatible pointer type [enabled by default]
    /usr/include/yaml.h:1367:1: note: expected ‘int (*)(void *, unsigned char *, size_t,  size_t *)’ but argument is of type ‘int (*)(void *, char *, int,  int *)’
    ext/_yaml.c:2272:45: warning: pointer targets in passing argument 2 of ‘yaml_parser_set_input_string’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:1341:1: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__token_to_object’:
    ext/_yaml.c:3705:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:3705:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:3718:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:3718:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4285:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4285:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4339:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4339:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4393:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4393:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4406:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4406:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:4493:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__event_to_object’:
    ext/_yaml.c:5909:9: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:5909:9: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:5922:9: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:5922:9: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6088:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6088:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6163:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6163:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6200:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6200:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6216:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6520:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6520:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6557:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6557:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6747:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6747:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6784:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:6784:7: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_node’:
    ext/_yaml.c:8064:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8064:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8284:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8284:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8315:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8315:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8346:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:8346:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_scalar_node’:
    ext/_yaml.c:8861:3: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:9019:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:9019:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_sequence_node’:
    ext/_yaml.c:9461:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:9461:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_7CParser__compose_mapping_node’:
    ext/_yaml.c:9998:5: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
    /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c:9998:5: warning: pointer targets in passing argument 1 of ‘PyUnicodeUCS4_DecodeUTF8’ differ in signedness [-Wpointer-sign]
    /usr/include/python2.7/unicodeobject.h:750:23: note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_8CEmitter___init__’:
    ext/_yaml.c:11065:38: warning: passing argument 2 of ‘yaml_emitter_set_output’ from incompatible pointer type [enabled by default]
    /usr/include/yaml.h:1829:1: note: expected ‘int (*)(void *, unsigned char *, size_t)’ but argument is of type ‘int (*)(void *, char *, int)’
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_8CEmitter__object_to_event’:
    ext/_yaml.c:12199:44: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
    ext/_yaml.c:12300:44: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
    ext/_yaml.c:12563:5: warning: pointer targets in passing argument 2 of ‘yaml_alias_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:553:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13168:5: warning: pointer targets in passing argument 2 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13168:5: warning: pointer targets in passing argument 3 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13168:5: warning: pointer targets in passing argument 4 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13521:5: warning: pointer targets in passing argument 2 of ‘yaml_sequence_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:601:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13521:5: warning: pointer targets in passing argument 3 of ‘yaml_sequence_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:601:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13874:5: warning: pointer targets in passing argument 2 of ‘yaml_mapping_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:633:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:13874:5: warning: pointer targets in passing argument 3 of ‘yaml_mapping_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:633:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c: In function ‘__pyx_pf_5_yaml_8CEmitter_6serialize’:
    ext/_yaml.c:15082:42: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
    ext/_yaml.c:15183:42: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
    ext/_yaml.c: In function ‘__pyx_f_5_yaml_8CEmitter__serialize_node’:
    ext/_yaml.c:15863:5: warning: pointer targets in passing argument 2 of ‘yaml_alias_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:553:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:16500:7: warning: pointer targets in passing argument 2 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:16500:7: warning: pointer targets in passing argument 3 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:16500:7: warning: pointer targets in passing argument 4 of ‘yaml_scalar_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:578:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:16790:7: warning: pointer targets in passing argument 2 of ‘yaml_sequence_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:601:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:16790:7: warning: pointer targets in passing argument 3 of ‘yaml_sequence_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:601:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:17193:7: warning: pointer targets in passing argument 2 of ‘yaml_mapping_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:633:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    ext/_yaml.c:17193:7: warning: pointer targets in passing argument 3 of ‘yaml_mapping_start_event_initialize’ differ in signedness [-Wpointer-sign]
    /usr/include/yaml.h:633:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-armv6l-2.7/ext/_yaml.o -lyaml -o build/lib.linux-armv6l-2.7/_yaml.so

Successfully installed pyyaml
Cleaning up...
(deploy)pi@raspberrypi ~/wh-monit/src $ python
Python 2.7.3 (default, Jan 13 2013, 11:20:46) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> 
(deploy)pi@raspberrypi ~/wh-monit/src $ 

I know that I can build locally eggs and then pass them to pants, but it's very inconvenient.

neutrinus avatar Feb 28 '14 08:02 neutrinus

out of curiosity, when you do ./pants py -v, does it list more than one interpreter? it's possible you have a good interpreter and a bad interpreter (when it comes to correctly building C extensions) and pants is picking the bad one.

wickman avatar Feb 28 '14 17:02 wickman

Looks like I have four interpreters:

(deploy)pi@raspberrypi ~/wh-monit/src $ PANTS_VERBOSE=1 PYTHON_VERBOSE=2 pants py -v
Found interpreter /home/pi/.virtualenvs/deploy/bin/python: CPython-2.7.3 (cached)
Found interpreter /usr/bin/pypy: PyPy-2.7.3 (cached)
Found interpreter /usr/bin/python2.6: CPython-2.6.8 (cached)
Found interpreter /usr/bin/python3.2: CPython-3.2.3 (cached)
No valid target specified!
...

As I'm using virtualenv, it should use the one from virtualenv:

(deploy)pi@raspberrypi ~/wh-monit/src $ python --version
Python 2.7.3
(deploy)pi@raspberrypi ~/wh-monit/src $ 

I tried to tell pants which interpreter to use, but I failed:

(deploy)pi@raspberrypi ~/wh-monit/src $ PANTS_VERBOSE=1 PYTHON_VERBOSE=2 pants build --interpreter="/home/pi/.virtualenvs/deploy/bin/python" :agent
Traceback (most recent call last):
  File "/home/pi/.virtualenvs/deploy/bin/pants", line 9, in <module>
    load_entry_point('twitter.pants==0.0.14-dev2', 'console_scripts', 'pants')()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/bin/pants_exe.py", line 165, in main
    _run()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/bin/pants_exe.py", line 146, in _run
    command = command_class(root_dir, parser, command_args)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/commands/build.py", line 62, in __init__
    if self.options.interpreter else [''])))
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/interpreter_cache.py", line 122, in matches
    if any(interpreter.identity.matches(filt) for filt in filters):
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/interpreter_cache.py", line 122, in <genexpr>
    if any(interpreter.identity.matches(filt) for filt in filters):
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/common/python/interpreter.py", line 134, in matches
    raise self.UnknownRequirement(str(e))
twitter.common.python.interpreter.UnknownRequirement: Unknown requirement string: /home/pi/.virtualenvs/deploy/bin/python
(deploy)pi@raspberrypi ~/wh-monit/src $ 
(deploy)pi@raspberrypi ~/wh-monit/src $ PANTS_VERBOSE=1 PYTHON_VERBOSE=2 pants build --interpreter="CPython-2.7.3" :agent
Unable to detect suitable interpreter.
...
eploy)pi@raspberrypi ~/wh-monit/src $ 

Then I found a "-v" flag, and used it :)

(deploy)pi@raspberrypi ~/wh-monit/src $ PANTS_VERBOSE=1 PYTHON_VERBOSE=2 pants build -v :agent
Found interpreter /home/pi/.virtualenvs/deploy/bin/python: CPython-2.7.3 (cached)
Found interpreter /usr/bin/pypy: PyPy-2.7.3 (cached)
Found interpreter /usr/bin/python2.6: CPython-2.6.8 (cached)
Found interpreter /usr/bin/python3.2: CPython-3.2.3 (cached)
Selected PythonInterpreter('/home/pi/.virtualenvs/deploy/bin/python', PythonIdentity('CPython', 2, 7, 3), None)
Build operating on targets: OrderedSet([PythonBinary(BUILD:agent)])
Building PythonBinary PythonBinary(BUILD:agent):
Building PythonBinary PythonBinary(BUILD:agent):
  Dumping library: PythonLibrary(BUILD:agent-lib)
  Dumping library: PythonLibrary(BUILD:common-lib-deps)
  Dumping library: PythonLibrary(BUILD:common-lib-agent)
  Dumping library: PythonBinary(BUILD:agent)
  Dumping requirement: requests==1.2.3
  Dumping requirement: sh==1.09
  Dumping requirement: RPi.GPIO==0.5.3a
  Dumping requirement: procname==0.3
  Dumping requirement: psutil==1.1.0
  Dumping requirement: pyOpenSSL==0.13.1
  Dumping requirement: python-dateutil==2.1
  Dumping requirement: dicts==0.3.1
  Dumping requirement: nanotime==0.5.2
  Dumping requirement: pytz==2013b
  Dumping requirement: blist==1.3.4
  Dumping requirement: websocket-client==0.12.0
  Dumping requirement: furl==0.3.4
  Dumping requirement: voluptuous==0.8.0
  Dumping requirement: pyyaml
twitter.common.python: Obtaining PythonRequirement(pyyaml): 11.4ms
Failed to find distribute in sys.path!nRequirement(pyyaml) :: Distilling PyYAML
Failed to find distribute in sys.path!nRequirement(pyyaml) :: Distilling PyYAML
twitter.common.python: Obtaining PythonRequirement(pyyaml): 4496.2ms           
twitter.common.python:   Installing PyYAML: 4.2ms
twitter.common.python:   Distilling PyYAML: 2.8ms
twitter.common.python:   Installing PyYAML: 3.6ms
twitter.common.python:   Distilling PyYAML: 2.7ms
Problem executing PythonBuilder for targets OrderedSet([PythonBinary(BUILD:agent)]): Traceback (most recent call last):
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/commands/build.py", line 126, in _python_build
    conn_timeout=self.options.conn_timeout)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/python_builder.py", line 57, in build
    conn_timeout=conn_timeout).run()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/binary_builder.py", line 56, in run
    env = self.chroot.dump()
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/python_chroot.py", line 190, in dump
    platforms=platforms)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/twitter/pants/python/resolver.py", line 117, in resolve_multi
    distributions[platform] = working_set.resolve(requirements, env=env, installer=installer)
  File "/home/pi/.virtualenvs/deploy/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
DistributionNotFound: PythonRequirement(pyyaml)


Usage: 
  pants build (options) [spec] (build args)
  pants build (options) [spec]... -- (build args)

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --no-pantsrc          Specifies that pantsrc files should be ignored.
  --log-exit            Log an exit message on success or failure.
  -t CONN_TIMEOUT, --timeout=CONN_TIMEOUT
                        Number of seconds to wait for http connections.
  -i INTERPRETER, --interpreter=INTERPRETER
                        The interpreter requirement for this chroot.
  -v, --verbose         Show verbose output.

Builds the specified python target(s).
(deploy)pi@raspberrypi ~/wh-monit/src $ 

So I believe pants use proper interpreter (the one from virtualenv), so probably it's not the case.

Do you have any other clues that would help to trace this issue?

neutrinus avatar Mar 01 '14 09:03 neutrinus