Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cant get build to work at all #75

Open
cschertz opened this Issue · 13 comments

3 participants

@cschertz

I have tried to invoke several targets on several machines types. Linux Mint, CentOS 6 in all cases I get the same result

cschertz@CraigLinuxMint ~/depot/twitter/commons $ ./pants goal
Build operating on targets: OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)])
Building PythonBinary PythonBinary(src/python/twitter/pants/BUILD:pants):

schertz@CraigLinuxMint ~/depot/twitter/commons $ ./pants src/java/com/twitter/common/thrift
Build operating on targets: OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)])
Building PythonBinary PythonBinary(src/python/twitter/pants/BUILD:pants):

All examples end up in this same spot

Any help would be great

@wickman
Collaborator

Could you run:

PANTS_VERBOSE=1 PEX_VERBOSE=1 ./pants

and paste the output? Looks like pants is failing to bootstrap itself.

@cschertz

Below is the output from the request but i also get a different result running the same commands today

schertz@CraigLinuxMint ~/depot/twitter/commons $ ./pants src/java/com/twitter/common/thrift
Build operating on targets: OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)])
Building PythonBinary PythonBinary(src/python/twitter/pants/BUILD:pants):
Failed to install stdout:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/psutil
copying psutil/error.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/psmswindows.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/compat.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/__init
.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
running build_ext
building '_psutil_linux' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psutil
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o

Failed to install stderr:
psutil/_psutil_linux.c:11:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

Failed to install psutil
Failed to resolve psutil, your installation may not work properly.
Problem executing PythonBuilder for targets OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)]): Traceback (most recent call last):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/commands/build.py", line 136, in _python_build
return executor.build(targets, self.build_args)
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_builder.py", line 56, in build
rv = PythonBinaryBuilder(binary_target, args, self.root_dir).run()
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/binary_builder.py", line 57, in run
env = self.chroot.dump()
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_chroot.py", line 187, in dump
ignore_errors=self._builder.info().ignore_errors):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_chroot.py", line 71, in resolve
for dist in resolver.resolve(requirements, ignore_errors=ignore_errors):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/common/python/resolver.py", line 132, in resolve
distributions = self._ws.resolve([req], env=self)
File "/home/cschertz/depot/twitter/commons/.python/bootstrap/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
DistributionNotFound: psutil

Output from requested command

Build operating on targets: OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)])
Resolver: Calling environment super => 0.021ms
Building PythonBinary PythonBinary(src/python/twitter/pants/BUILD:pants):
Building PythonBinary PythonBinary(src/python/twitter/pants/BUILD:pants):
Dumping library: PythonLibrary(src/python/twitter/pants/BUILD:pants-lib) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/BUILD:common) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/collections/BUILD:collections) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/config/BUILD:config) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/lang/BUILD:lang) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/contextutil/BUILD:contextutil) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/decorators/BUILD:decorators) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/log/BUILD:log) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/options/BUILD:options) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/dirutil/BUILD:dirutil) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/quantity/BUILD:quantity) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/app/BUILD:app) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/util/BUILD:util) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/app/modules/BUILD:modules) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/confluence/BUILD:confluence) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/common/python/BUILD:python) [relative module: ]
Dumping library: PythonLibrary(src/python/twitter/pants/BUILD:pants-deps) [relative module: ]
Dumping requirement: pip
Dumping requirement: distribute
Dumping requirement: elementtree
Dumping requirement: mako
Dumping requirement: markdown
Dumping requirement: psutil
Dumping requirement: pygments
Dumping requirement: pylint
Dumping requirement: pytest
Dumping requirement: python-daemon
Resolver: Calling environment super => 0.009ms
Resolver: Activating cache /home/cschertz/depot/twitter/commons/3rdparty/python => 57.632ms
Resolver: Activating cache /home/cschertz/depot/twitter/commons/.pants.d/.python.install.cache => 0.139ms
Resolver: Fetching pip => 2338.090ms
Resolver: Building pip => 271.278ms
Resolver: Distilling pip => 174.737ms
Resolver: Constructing distribution pip => 0.855ms
Resolver: Resolved pip => 2843.829ms
Resolver: Fetching distribute => 2515.985ms
Resolver: Building distribute => 258.408ms
Resolver: Distilling distribute => 385.846ms
Resolver: Constructing distribution distribute => 1.015ms
Resolver: Resolved distribute => 3162.356ms
Resolver: Fetching elementtree => 3000.821ms
Resolver: Building elementtree => 109.809ms
Resolver: Distilling elementtree => 51.309ms
Resolver: Constructing distribution elementtree => 0.589ms
Resolver: Resolved elementtree => 3163.487ms
Resolver: Fetching mako => 5077.740ms
Resolver: Building mako => 164.530ms
Resolver: Distilling mako => 154.332ms
Resolver: Constructing distribution mako => 0.741ms
Resolver: Fetching MarkupSafe>=0.9.2 => 6159.424ms
Resolver: Building MarkupSafe>=0.9.2 => 202.285ms
Resolver: Distilling MarkupSafe>=0.9.2 => 14.652ms
Resolver: Constructing distribution MarkupSafe>=0.9.2 => 0.502ms
Resolver: Resolved mako => 11776.394ms
Resolver: Fetching markdown => 7252.410ms
Resolver: Building markdown => 403.020ms
Resolver: Distilling markdown => 127.507ms
Resolver: Constructing distribution markdown => 0.813ms
Resolver: Resolved markdown => 7784.866ms
Resolver: Fetching psutil => 2163.696ms
Failed to install stdout:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/psutil
copying psutil/error.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/psmswindows.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/compat.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/__init
.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
running build_ext
building '_psutil_linux' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psutil
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o

Failed to install stderr:
psutil/_psutil_linux.c:11:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

Failed to install psutil
Resolver: Building psutil => 89.414ms
Failed to resolve psutil, your installation may not work properly.
Resolver: Failed to resolve psutil
Problem executing PythonBuilder for targets OrderedSet([PythonBinary(src/python/twitter/pants/BUILD:pants)]): Traceback (most recent call last):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/commands/build.py", line 136, in _python_build
return executor.build(targets, self.build_args)
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_builder.py", line 56, in build
rv = PythonBinaryBuilder(binary_target, args, self.root_dir).run()
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/binary_builder.py", line 57, in run
env = self.chroot.dump()
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_chroot.py", line 187, in dump
ignore_errors=self._builder.info().ignore_errors):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/pants/python/python_chroot.py", line 71, in resolve
for dist in resolver.resolve(requirements, ignore_errors=ignore_errors):
File "/home/cschertz/depot/twitter/commons/src/python/twitter/common/python/resolver.py", line 132, in resolve
distributions = self._ws.resolve([req], env=self)
File "/home/cschertz/depot/twitter/commons/.python/bootstrap/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
DistributionNotFound: psutil

@cschertz

Also here is the result i get from running PANTS_VERBOSE=1 PEX_VERBOSE=1 ./pants tests/java/com/twitter/common:all-tests! On CentOS 6 today. The previous result are from LinuxMint 13

-bash-4.1$ PANTS_VERBOSE=1 PEX_VERBOSE=1 ./pants tests/java/com/twitter/common:all-tests!
PEX: Calling environment super => 0.007ms
PEX: Using prescribed entry point: pants_exe
PEX: Inspecting path element: /usr/lib64/python2.6/site-packages
PEX: Inspecting path element: /usr/lib/python2.6/site-packages
PEX: Inspecting path element: /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info
PEX: Scrubbing from site-packages: /usr/lib64/python2.6/site-packages
PEX: Scrubbing from site-packages: /usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg
PEX: Scrubbing from site-packages: /usr/lib/python2.6/site-packages
PEX: Scrubbing from site-packages: /usr/lib/python2.6/site-packages/WebOb-1.0.8-py2.6.egg
PEX: Activating cache ./pants.pex/.deps => 65.047ms
PEX: Resolved pip => 65.342ms
PEX: Locally caching pip 1.2.1 => 0.902ms
PEX: Activated pip 1.2.1 => 0.988ms
PEX: Resolved distribute => 0.190ms
PEX: Locally caching distribute 0.6.28 => 0.649ms
PEX: Activated distribute 0.6.28 => 0.733ms
PEX: Resolved elementtree => 0.182ms
PEX: Activated elementtree 1.2.7-20070827-preview => 2.801ms
PEX: Resolved mako => 0.922ms
PEX: Locally caching Mako 0.4.0 => 0.821ms
PEX: Activated Mako 0.4.0 => 0.904ms
PEX: Locally caching MarkupSafe 0.15 => 0.848ms
PEX: Activated MarkupSafe 0.15 => 0.933ms
PEX: Resolved markdown => 0.179ms
PEX: Activated Markdown 2.1.1 => 3.736ms
PEX: Resolved psutil => 0.170ms
PEX: Locally caching psutil 0.4.1 => 0.828ms
PEX: Activated psutil 0.4.1 => 0.910ms
PEX: Resolved pygments => 0.193ms
PEX: Locally caching Pygments 1.4 => 0.827ms
PEX: Activated Pygments 1.4 => 0.910ms
PEX: Resolved pylint => 2.273ms
PEX: Locally caching pylint 0.24.0 => 0.719ms
PEX: Activated pylint 0.24.0 => 0.802ms
PEX: Locally caching logilab-astng 0.22.0 => 4.151ms
PEX: Activated logilab-astng 0.22.0 => 4.238ms
PEX: Locally caching logilab-common 0.56.0 => 1.184ms
PEX: Activated logilab-common 0.56.0 => 1.274ms
PEX: Locally caching unittest2 0.5.1 => 0.881ms
PEX: Activated unittest2 0.5.1 => 0.967ms
PEX: Resolved pytest => 0.838ms
PEX: Locally caching pytest 2.2.0 => 0.905ms
PEX: Activated pytest 2.2.0 => 0.988ms
PEX: Locally caching py 1.4.5 => 0.878ms
PEX: Activated py 1.4.5 => 0.961ms
PEX: Resolved python-daemon => 0.899ms
PEX: Locally caching python-daemon 1.6 => 1.078ms
PEX: Activated python-daemon 1.6 => 1.161ms
PEX: Activated lockfile 0.9.1 => 2.894ms
PEX: Locally caching distribute 0.6.28 => 0.442ms
PEX: Activated distribute 0.6.28 => 0.523ms
PEX: PYTHONPATH now /home/cschertz/depot/commons/pants.pex/.bootstrap:/home/cschertz/depot/commons/pants.pex:/usr/lib64/python26.zip:/usr/lib64/python2.6:/usr/lib64/python2.6/plat-linux2:/usr/lib64/python2.6/lib-tk:/usr/lib64/python2.6/lib-old:/usr/lib64/python2.6/lib-dynload:/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info:/home/cschertz/.pex/install/pip-1.2.1-py2.6.egg:/home/cschertz/.pex/install/distribute-0.6.28-py2.6.egg:/home/cschertz/depot/commons/pants.pex/.deps/elementtree-1.2.7_20070827_preview-py2.6.egg:/home/cschertz/.pex/install/Mako-0.4.0-py2.6.egg:/home/cschertz/.pex/install/MarkupSafe-0.15-py2.6-linux-x86_64.egg:/home/cschertz/depot/commons/pants.pex/.deps/Markdown-2.1.1-py2.6.egg:/home/cschertz/.pex/install/psutil-0.4.1-py2.6-linux-x86_64.egg:/home/cschertz/.pex/install/Pygments-1.4-py2.6.egg:/home/cschertz/.pex/install/pylint-0.24.0-py2.6.egg:/home/cschertz/.pex/install/logilab_astng-0.22.0-py2.6.egg:/home/cschertz/.pex/install/logilab_common-0.56.0-py2.6.egg:/home/cschertz/.pex/install/unittest2-0.5.1-py2.6.egg:/home/cschertz/.pex/install/pytest-2.2.0-py2.6.egg:/home/cschertz/.pex/install/py-1.4.5-py2.6.egg:/home/cschertz/.pex/install/python_daemon-1.6-py2.6.egg:/home/cschertz/depot/commons/pants.pex/.deps/lockfile-0.9.1-py2.6.egg
Build operating on targets: OrderedSet([JarLibrary(tests/java/com/twitter/common/BUILD:all-tests!)])
Traceback (most recent call last):
File "/usr/lib64/python2.6/runpy.py", line 122, in run_module_as_main
"__main_
", fname, loader, pkg_name)
File "/usr/lib64/python2.6/runpy.py", line 34, in run_code
exec code in run_globals
File "./pants.pex/__main_
.py", line 29, in
File "/home/cschertz/depot/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 101, in execute
File "/home/cschertz/depot/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 128, in execute_entry
File "/home/cschertz/depot/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 133, in execute_module
File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
fname, loader, pkg_name)
File "/usr/lib64/python2.6/runpy.py", line 34, in run_code
exec code in run_globals
File "/home/cschertz/depot/commons/pants.pex/pants_exe.py", line 174, in
File "/home/cschertz/depot/commons/pants.pex/pants_exe.py", line 168, in main
File "/home/cschertz/depot/commons/pants.pex/pants_exe.py", line 157, in run
File "twitter/pants/commands/__init
.py", line 103, in run
File "twitter/pants/commands/build.py", line 97, in execute
File "twitter/pants/init.py", line 154, in extract_jvm_targets
File "twitter/pants/init.py", line 134, in is_jvm
TypeError: has_label() takes exactly 1 argument (2 given)

@wickman
Collaborator

on LinuxMint, it looks like your Python environment is not set up to allow for C extensions to be built. you probably need to install the development package for Python, i.e. headers and the like.

the has_label issue I believe was fixed by Benjy. is this a fresh clone off master?

@cschertz

This was all cloned yesterday. I did a pull and a clean clone just to make sure this morning.

Will update the Mint machine

@cschertz

Installed python-dev on Mint machine and the following is the result. Seems better but .....

cschertz@CraigLinuxMint ~/depot/twitter/commons $ PANTS_VERBOSE=1 PEX_VERBOSE=1 ./pants tests/java/com/twitter/common:all-tests!
PEX: Calling environment super => 0.005ms
PEX: Using prescribed entry point: pants_exe
PEX: Inspecting path element: /usr/lib/python2.7/dist-packages
PEX: Inspecting path element: /usr/lib/python2.7/dist-packages/PIL
PEX: Inspecting path element: /usr/lib/python2.7/dist-packages/gst-0.10
PEX: Inspecting path element: /usr/lib/python2.7/dist-packages/gtk-2.0
PEX: Scrubbing from site-packages: /usr/lib/python2.7/dist-packages
PEX: Scrubbing from site-packages: /usr/lib/python2.7/dist-packages/PIL
PEX: Activating cache ./pants.pex/.deps => 156.890ms
PEX: Resolved pip => 157.113ms
PEX: Locally caching pip 1.2.1 => 0.612ms
PEX: Activated pip 1.2.1 => 0.669ms
PEX: Resolved distribute => 0.119ms
PEX: Locally caching distribute 0.6.28 => 0.464ms
PEX: Activated distribute 0.6.28 => 0.519ms
PEX: Resolved elementtree => 0.107ms
PEX: Activated elementtree 1.2.7-20070827-preview => 2.307ms
PEX: Resolved mako => 0.528ms
PEX: Activated Mako 0.7.2 => 3.038ms
PEX: Activated MarkupSafe 0.15 => 1.954ms
PEX: Resolved markdown => 0.114ms
PEX: Activated Markdown 2.2.0 => 3.027ms
PEX: Resolved psutil => 0.106ms
PEX: Activated psutil 0.6.1 => 2.772ms
PEX: Resolved pygments => 0.123ms
PEX: Locally caching Pygments 1.5 => 0.570ms
PEX: Activated Pygments 1.5 => 0.627ms
PEX: Resolved pylint => 1.000ms
PEX: Locally caching pylint 0.25.2 => 0.539ms
PEX: Activated pylint 0.25.2 => 0.595ms
PEX: Locally caching logilab-astng 0.24.0 => 3.401ms
PEX: Activated logilab-astng 0.24.0 => 3.460ms
PEX: Locally caching logilab-common 0.58.1 => 0.793ms
PEX: Activated logilab-common 0.58.1 => 0.856ms
PEX: Resolved pytest => 0.486ms
PEX: Locally caching pytest 2.2.4 => 0.595ms
PEX: Activated pytest 2.2.4 => 0.653ms
PEX: Activated py 1.4.9 => 3.690ms
PEX: Resolved python-daemon => 0.518ms
PEX: Activated python-daemon 1.6 => 2.387ms
PEX: Activated lockfile 0.9.1 => 2.235ms
PEX: Locally caching distribute 0.6.28 => 0.376ms
PEX: Activated distribute 0.6.28 => 0.433ms
PEX: PYTHONPATH now /home/cschertz/depot/twitter/commons/pants.pex/.bootstrap:/home/cschertz/depot/twitter/commons/pants.pex:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/gst-0.10:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7:/home/cschertz/.pex/install/pip-1.2.1-py2.7.egg:/home/cschertz/.pex/install/distribute-0.6.28-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/elementtree-1.2.7_20070827_preview-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/Mako-0.7.2-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/MarkupSafe-0.15-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/Markdown-2.2.0-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/psutil-0.6.1-py2.7-linux-x86_64.egg:/home/cschertz/.pex/install/Pygments-1.5-py2.7.egg:/home/cschertz/.pex/install/pylint-0.25.2-py2.7.egg:/home/cschertz/.pex/install/logilab_astng-0.24.0-py2.7.egg:/home/cschertz/.pex/install/logilab_common-0.58.1-py2.7.egg:/home/cschertz/.pex/install/pytest-2.2.4-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/py-1.4.9-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/python_daemon-1.6-py2.7.egg:/home/cschertz/depot/twitter/commons/pants.pex/.deps/lockfile-0.9.1-py2.7.egg
Build operating on targets: OrderedSet([JarLibrary(tests/java/com/twitter/common/BUILD:all-tests!)])
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
"__main_
", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "./pants.pex/__main_
.py", line 29, in
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 101, in execute
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 128, in execute_entry
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 133, in execute_module
File "/usr/lib/python2.7/runpy.py", line 180, in run_module
fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 174, in
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 168, in main
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 157, in run
File "twitter/pants/commands/__init
.py", line 103, in run

File "twitter/pants/commands/build.py", line 97, in execute
File "twitter/pants/init.py", line 154, in extract_jvm_targets

File "twitter/pants/init.py", line 134, in is_jvm

TypeError: has_label() takes exactly 1 argument (2 given)

@wickman
Collaborator

This seems related: #66

It appears the pull request (/67) has been merged in. Not sure why it's still breaking.

@cschertz

No sure what to do at this point. Maybe someone can recommend an environment that they have this working in. It seems that it impacts simple commands like list I agree it seems related to issue 66 but i dont know anything about python and have not found any docs on pants

tests/python/twitter/thrift/BUILD:all
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
"__main_
", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "./pants.pex/__main_
.py", line 29, in
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 101, in execute
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 128, in execute_entry
File "/home/cschertz/depot/twitter/commons/pants.pex/.bootstrap/twitter/common/python/pex.py", line 133, in execute_module
File "/usr/lib/python2.7/runpy.py", line 180, in run_module
fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 174, in
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 168, in main
File "/home/cschertz/depot/twitter/commons/pants.pex/pants_exe.py", line 157, in run
File "twitter/pants/commands/__init
.py", line 103, in run

File "twitter/pants/commands/list.py", line 101, in execute
File "twitter/pants/base/target.py", line 71, in get_all_addresses
File "twitter/pants/base/parse_context.py", line 116, in parse
File "", line 5, in exec_function
File "/home/cschertz/depot/twitter/commons/tests/python/twitter/thrift/descriptors/BUILD", line 35, in
sources = globs('*.py'),
File "twitter/pants/targets/python_tests.py", line 33, in init
File "twitter/pants/base/target.py", line 168, in add_label
AttributeError: 'PythonTests' object has no attribute 'labels'

Any help would be greatly appreciated

@cschertz

is i just me or is this the the issue.

targets/jar_dependency.py: def has_label(self):

base target defines has_label as the following ?
base/target.py: def has_label(self, label):

@cschertz

Well any way that change fixed the first issue now i am hitting

:large)]): Traceback (most recent call last):
File "twitter/pants/commands/build.py", line 128, in jvm_build
return executor.build(targets, self.build_args)
File "twitter/pants/ant/lib.py", line 69, in build
, _, result = self.generate_and_build(targets, args)
File "twitter/pants/ant/lib.py", line 101, in generate_and_build
return buildxml, ivyxml, subprocess.call(antargs)
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(popenargs, *kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in __init

errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Going to try and debug this one now

@cschertz

ok think i fixed this ant not installed on the box.
Sill the issue above needs to be fixed. If I will try and figure out how to setup a pull request for that fix. Never done that before

@cschertz

Well i guess i didn't get that all right but the pull request now exists

@jsirois
Collaborator

Thanks. The lack of documentation needs to be rectified. This should be getting the love it deserves next week through the end of the month. Some rudimentary docs are here: https://github.com/twitter/commons/tree/master/src/python/twitter/pants but in short:

pants started out as a thin ant shell and evolved to pure python. The evolution is not complete and the old ant build system lives side-by-side and this is clearly very confusing.

Old pants:

$ ./pants
Pants 0.0.3 @ PANTS_BUILD_ROOT: /home/jsirois/development/twitter/science

Available subcommands:
    files   Lists all source files owned by the given target.
    setup_py    Generate setup.py-based Python projects from python_library targets.
    goal    Lists installed goals or else executes a named goal.
    filemap Outputs a mapping from source file to the target that owns the source file.
    doc Generates documentation for a set of targets.
    py  Python chroot manipulation.
    eclipse Creates Eclipse projects for a set of BUILD targets.
    idea    Creates IntelliJ IDEA projects for a set of BUILD targets.
    list    Lists BUILD file targets.
    build   Builds a specified target.
    ivy_resolve Resolves ivy dependencies to a local directory, obviating the need for
  an explicit resolve per build.
    depmap  Generates either a textual dependency tree or a graphviz digraph dotfile for the dependency set
  of a target.
    help    Provides help for available commands or a single specified command.

Default subcommand flags can be stored in ~/.pantsrc using the 'options' key of a
section named for the subcommand in ini style format, ie:
  [build]
  options: --fast

Of these commands you only want to be using the metadata commands:
files, goal, filemap, list, depmap

And the python commands:
setup_py, py and build [python target]

Otherwise you want to be working in 'pants.new', ie: alias pants.new='./pants goal':

./pants goal
Installed goals:
               binary: Create a jvm binary jar.
               bundle: Create an application bundle from binary targets.
           checkstyle: Run checkstyle against java source code.
            clean-all: Cleans all intermediate build output
              compile: Compile both generated and checked in code.
            dependees: Print a reverse dependency mapping for the given targets
     dependees-owners: Print a list owners of dependees for the given targets
              eclipse: Create an Eclipse project from the given targets.
             filedeps: Print out a list of all files the target depends on
                  gen: Generate code.
                goals: List all documented goals.
                 help: Provide help for the specified goal.
                 idea: Create an IntelliJ IDEA project from the given targets.
           invalidate: Invalidate all caches
                  jar: Create one or more jars.
              javadoc: Create javadoc.
             markdown: Generate html from markdown docs.
           ng-killall: Kill any running nailgun servers spawned by pants.
             pathdeps: Print out a list of all paths containing build files the target depends on
              publish: Publish one or more artifacts.
            reinstall: Reinstalls pants from the current source tree.
                 repl: Run a (currently Scala only) REPL with the classpath set according to the targets.
              resolve: Resolves jar dependencies and produces dependency reports.
                  run: Run a (currently JVM only) binary target.
                setup: Setup the target's build environment.
                 test: Test compiled code.

Either way - ant should not be involved any longer, so if you see ant-like output you'll want to find the hopefully sort of obvious ./pants goal [subcommand]. ./pants goal help [subcommand] or ./pants goal [subcommand] -h should be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.