Uploaded image for project: 'Aurora'
  1. Aurora
  2. AURORA-1267

Investigate upgrading pants to 0.0.32+

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.9.0
    • Build
    • None
    • Twitter Aurora Q2'15 Sprint 3

    Description

      A naive upgrade to pants 0.0.32 from 0.0.28 results in the following stack trace:

      Exception caught:
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/bin/pants", line 9, in <module>
          load_entry_point('pantsbuild.pants==0.0.28', 'console_scripts', 'pants')()
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 66, in main
          _run()
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 61, in _run
          result = goal_runner.run()
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 168, in run
          result = self._do_run()
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 251, in _do_run
          return engine.execute(context, self.goals)
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/engine/engine.py", line 27, in execute
          self.attempt(context, goals)
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/engine/round_engine.py", line 212, in attempt
          goal_executor.attempt(explain)
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/engine/round_engine.py", line 45, in attempt
          task.execute()
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/backend/codegen/tasks/code_gen.py", line 117, in execute
          self.genlang(lang, invalid_lang_tgts)
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/backend/codegen/tasks/apache_thrift_gen.py", line 152, in genlang
          gen = self.gen_python.gen
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/backend/codegen/tasks/apache_thrift_gen.py", line 127, in gen_python
          self._gen_python = self.create_geninfo('python')
        File "/Users/zmanji/workspace/gh-aurora/build-support/pants.venv/lib/python2.7/site-packages/pants/backend/codegen/tasks/apache_thrift_gen.py", line 101, in create_geninfo
          gen = gen_info['gen']
      
      Exception message: 'NoneType' object has no attribute '__getitem__'
      

      The root cause of this is pants 0.0.32 expects a differently formatted pants.ini than the one we have now. Pants 0.0.32 ships with a migration tool that informs us of changes required. With a 0.0.32 pants source we can run:

       PANTS_DEV=1 ./pants run src/python/pants/option:migrate_config -- <pants.ini path>
      

      This gives us:

      Found java in section [thrift-gen]. Should be java in section [gen.thrift].
      Found extra_jvm_test_paths in section [ide]. Should be extra_jvm_test_paths in section [idea].
        Note: extra_jvm_test_paths now must be specified separately for idea and eclipse goals.
      Found python_test_paths in section [ide]. Should be python_test_paths in section [idea].
        Note: python_test_path now must be specified separately for idea and eclipse goals.
      Found python_lib_paths in section [ide]. Should be python_lib_paths in section [idea].
        Note: python_lib_path now must be specified separately for idea and eclipse goals.
      Found python in section [thrift-gen]. Should be python in section [gen.thrift].
      Found strict in section [thrift-gen]. Should be strict in section [gen.thrift].
      Found supportdir in section [thrift-gen]. Should be supportdir in section [gen.thrift].
      Found python_source_paths in section [ide]. Should be python_source_paths in section [idea].
      Found version in section [thrift-gen]. Should be version in section [gen.thrift].
      Found requirements in section [python-ipython]. Should be ipython_requirements in section [repl.py].
      Found indices in section [python-repos]. Should be indexes in section [python-repos].
      Found extra_jvm_source_paths in section [ide]. Should be extra_jvm_source_paths in section [idea].
        Note: extra_jvm_source_paths now must be specified separately for idea and eclipse goals.
      

      Making the above changes to pants.ini results in some commands failing with Unable to detect a suitable interpreter. It isn't clear what needs to be done to fix that error. I suspect it has to do with some of the constraints in our pants.ini but I cannot determine which ones are at fault.

      Attachments

        Issue Links

          Activity

            People

              kevints Kevin Sweeney
              zmanji Zameer Manji
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: