Heh, I thought this was going to be an easy one, b...
# development
c
Heh, I thought this was going to be an easy one, but alas, I can’t really find where
pex
comes from, so not sure what is the right way to fix this.. https://github.com/pantsbuild/pants/issues/12333
e
It comes from your command line:
./pants -ldebug pex
c
Yeah, well.. that of course, but
./pants foo
errors with a “unknown goal” error… but
pex
is not listed as a known goal, but it does not error out either, so I figure it must be declared at some level some where…
Copy code
$ ./pants pex
{'auth-acquire': <class 'toolchain.pants.auth.rules.AccessTokenAcquisition'>,
 'count-loc': <class 'pants.backend.project_info.count_loc.CountLinesOfCode'>,
 'dependees': <class 'pants.backend.project_info.dependees.DependeesGoal'>,
 'dependencies': <class 'pants.backend.project_info.dependencies.Dependencies'>,
 'export-codegen': <class 'pants.backend.codegen.export_codegen_goal.ExportCodegen'>,
 'filedeps': <class 'pants.backend.project_info.filedeps.Filedeps'>,
 'filter': <class 'pants.backend.project_info.filter_targets.FilterGoal'>,
 'fmt': <class 'pants.core.goals.fmt.Fmt'>,
 'lint': <class 'pants.core.goals.lint.Lint'>,
 'list': <class 'pants.backend.project_info.list_targets.List'>,
 'lock': <class 'pants.backend.experimental.python.lockfile.LockGoal'>,
 'package': <class 'pants.core.goals.package.Package'>,
 'py-constraints': <class 'pants.backend.python.mixed_interpreter_constraints.py_constraints.PyConstraintsGoal'>,
 'repl': <class 'pants.core.goals.repl.Repl'>,
 'roots': <class 'pants.backend.project_info.list_roots.Roots'>,
 'run': <class 'pants.core.goals.run.Run'>,
 'tailor': <class 'pants.core.goals.tailor.Tailor'>,
 'test': <class 'pants.core.goals.test.Test'>,
 'typecheck': <class 'pants.core.goals.typecheck.Typecheck'>,
 'validate': <class 'pants.backend.project_info.source_file_validator.Validate'>}
17:07:38.81 [ERROR] Exception caught: (builtins.KeyError)
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 239, in _run_inner
    return self._perform_run(goals)
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 178, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
    return self.graph_session.run_goal_rules(
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/init/engine_initializer.py", line 125, in run_goal_rules
    goal_product = self.goal_map[goal]

Exception message: 'pex'
Traceback (most recent call last):
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 239, in _run_inner
    return self._perform_run(goals)
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 178, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
    return self.graph_session.run_goal_rules(
  File "/Users/aadt/src/github/kaos/pants/src/python/pants/init/engine_initializer.py", line 125, in run_goal_rules
    goal_product = self.goal_map[goal]
KeyError: 'pex'

(Use --no-process-execution-local-cleanup to inspect chroots and/or -ldebug for more logs. See <https://www.pantsbuild.org/v2.7/docs/troubleshooting> for common issues. Consider reaching out for help: <https://www.pantsbuild.org/v2.7/docs/getting-help.>)

$ ./pants foo
Unknown goal: foo
Use `./pants help` to get help.
Use `./pants help goals` to list goals.
(with a debug print in there with the declared goals…)
e
Their is a subsystem named
pex
and subsystems play into CLI option parsing. Does ...
./pants python-setup
fail similarly? (May need
-
->
_
)
Yeah, that's it.
c
ok, so there’s a glitch in accepting subsystems as goals.. ?
e
Something like that, yeah. (from my phone)
c
ok, that’s enough for me to go on, a little further at least 🙂
❤️ 1
e
Ok, great. Thanks for digging @curved-television-6568.
👍 1
c
Draft PR: https://github.com/pantsbuild/pants/pull/12337 still some issues introduced I need to resolve..
also, if you think I’m going about it the wrong way, this is a good chance to guide it in a different direction (n.p.) 🙂