Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pants.ini required even with --config-override #2652

Closed
cburroughs opened this issue Dec 2, 2015 · 2 comments
Closed

pants.ini required even with --config-override #2652

cburroughs opened this issue Dec 2, 2015 · 2 comments

Comments

@cburroughs
Copy link
Contributor

I was trying to follow https://pantsbuild.github.io/howto_develop.html to create a pex build of pants for my CI server (I don't have any custom pants extensions at the moment so maybe there should have been an easier way to do this). I found it surprising that pants.ini was requred even though I was explicitly instructing pants to use a different ini file.

From a new directory:

/home/csb/prog/github/pants/pants -lDEBUG --config-override pants-production.ini clean-all binary //:pants
/home/csb/prog/github/pants/src/python/pants/base/build_environment.py:36: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  print(e.message, file=sys.stderr)
Could not find pants.ini!

After creating an empty pants.ini and the BUILD.tools scale magic it worked.

@jsirois
Copy link
Member

jsirois commented Dec 2, 2015

Yeah - it should be named --config-overlay. FWIW - when you just want a pex of an official release: pex -v -c pants pantsbuild.pants -o pants is the way to go. This assumes you have pex installed (pip install pex).

For example (I use pyenv to isolate python installed tools, but thats not really a relevant detail here):

~ $ mkdir /tmp/build && cd /tmp/build
/tmp/build $ pyenv activate pex

(pex)/tmp/build $ pex --version
pex 1.1.1

(pex)/tmp/build $ pex -v -c pants pantsbuild.pants -o pants
  cov-core 1.15.0 :: Resolving distributions :: Packaging cov-core                  
  pytest-cov 1.8.1
  setuptools 5.4.1
  Markdown 2.1.1
  twitter.common.options 0.3.4
  six 1.10.0
  pystache 0.5.3
  lockfile 0.10.2
  pex 1.1.0
  pytest 2.6.4
  twitter.common.confluence 0.3.4
  docutils 0.12
  twitter.common.dirutil 0.3.4
  twitter.common.collections 0.3.4
  py 1.4.31
  twitter.common.log 0.3.4
  zincutils 0.3.1
  ansicolors 1.0.2
  requests 2.5.3
  Pygments 1.4
  coverage 3.7.1
  twitter.common.lang 0.3.4
  psutil 3.1.1
  pantsbuild.pants 0.0.62
pex: Building pex: 3862.6ms                                       
pex:   Resolving distributions: 3576.8ms
pex:       Packaging pantsbuild.pants: 334.2ms
pex:       Packaging twitter.common.dirutil: 97.5ms
pex:       Packaging coverage: 237.7ms
pex:       Packaging twitter.common.confluence: 95.9ms
pex:       Packaging pytest-cov: 97.3ms
pex:       Packaging docutils: 217.6ms
pex:       Packaging pytest: 123.1ms
pex:       Packaging twitter.common.collections: 98.0ms
pex:       Packaging cov-core: 95.6ms
Saving PEX file to pants

(pex)jsirois@gill /tmp/build $ touch pants.ini

(pex)jsirois@gill /tmp/build $ ./pants --version
0.0.62

NB: You would either need to run the command once on a machine of each platform you distribute to, or else you would need to have a repository of pre-built eggs or wheels for platform-specific libs pants uses, like pycov and psutil and use pex's --find-links flag to point it at that repo and --platform to tell it which platform to pull platform-specific binary distributions for.

@stuhood
Copy link
Sponsor Member

stuhood commented Oct 17, 2016

To get the behaviour you want, you can set --pants-config-files instead of --config-override.

@stuhood stuhood closed this as completed Oct 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants