wide-midnight-78598
01/17/2022, 6:52 PME Engine traceback:
E in select
E in experimental.pyoxidizer.rules.package_pyoxidizer_binary (src:test-bin)
E in pants.backend.python.util_rules.pex.create_pex (pyoxidizer.pex)
E in pants.backend.python.util_rules.pex.build_pex (pyoxidizer.pex)
E in pants.backend.python.util_rules.pex.find_interpreter (CPython>=3.8)
E in pants.engine.process.fallible_to_exec_result_or_raise
E in pants.backend.python.util_rules.pex_cli.setup_pex_cli_process
E in pants.backend.python.util_rules.pex_environment.find_pex_python
E in pants.python._binaries_rules.find_python
E Traceback (most recent call last):
E File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/de04010553f1713b72512ad07d1b20b66bf8f840/f5cef8ebdbaf03ed774d467ae52a457e8fe3774a/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 705, in native_engine_generator_send
E res = func.send(arg)
E File "/Users/sj/.cache/pants/named_caches/pex_root/venvs/de04010553f1713b72512ad07d1b20b66bf8f840/f5cef8ebdbaf03ed774d467ae52a457e8fe3774a/lib/python3.9/site-packages/pants/python/_binaries_rules.py", line 82, in find_python
E raise BinaryNotFoundError(
E pants.engine.process.BinaryNotFoundError: Was not able to locate a Python interpreter to execute rule code.
E Please ensure that Python is available in one of the locations identified by `[python-bootstrap] search_path`, which currently expands to:
E []
wide-midnight-78598
01/17/2022, 6:52 PMhappy-kitchen-89482
01/17/2022, 6:59 PMwide-midnight-78598
01/17/2022, 7:00 PM./pants test ::
commandwide-midnight-78598
01/17/2022, 7:00 PMhappy-kitchen-89482
01/17/2022, 7:03 PM./pants test ::
, 2) The one that the pex-creation rule invokeshappy-kitchen-89482
01/17/2022, 7:03 PMhappy-kitchen-89482
01/17/2022, 7:03 PMwide-midnight-78598
01/17/2022, 7:04 PMwide-midnight-78598
01/17/2022, 7:04 PMhappy-kitchen-89482
01/17/2022, 7:06 PM./pants test
is the right way to run your tests, even if they are testing a pluginhappy-kitchen-89482
01/17/2022, 7:07 PMrule_runner.set_options([], env_inherit={"PATH"})
in your test before the call to rule_runner.request
wide-midnight-78598
01/17/2022, 7:09 PMwide-midnight-78598
01/17/2022, 7:09 PMhappy-kitchen-89482
01/17/2022, 7:14 PMhappy-kitchen-89482
01/17/2022, 7:14 PMwide-midnight-78598
01/17/2022, 7:15 PMfast-nail-55400
01/17/2022, 8:27 PM[test]
extra_env_vars = [
# TODO: These are exposed to tests in order to allow for python interpreter discovery when
# Pants-tests-Pants: in particular, the [python] subsystem consumes them.
# see <https://github.com/pantsbuild/pants/issues/11638>
"PYENV_ROOT",
"HOME",
"PATH",
# We'd always like complete backtraces in tests.
"RUST_BACKTRACE=1",
]
fast-nail-55400
01/17/2022, 8:28 PMwide-midnight-78598
01/17/2022, 9:21 PMcurved-television-6568
01/18/2022, 6:52 AMwide-midnight-78598
01/18/2022, 2:02 PMcurved-television-6568
01/18/2022, 2:25 PMwide-midnight-78598
01/18/2022, 2:46 PMhappy-kitchen-89482
01/18/2022, 6:13 PM./pants test ::
failed on your laptop? That's not idealhappy-kitchen-89482
01/18/2022, 6:13 PMwide-midnight-78598
01/18/2022, 6:13 PMpants_run = run_pants([
"--backend-packages=['pants.backend.python', 'pants.backend.experimental.python.packaging.pyoxidizer']",
"help",
"pyoxidizer_binary"])
pants_run.assert_success()
For this, I'm running ./pants test src/..../pyoxidizer:rules_integration_test
wide-midnight-78598
01/18/2022, 6:14 PMwide-midnight-78598
01/18/2022, 6:15 PMImportError while importing test module
and then something about symbol not found in flat namespace _PyObject_VectorCallMethod
I think the issue here was the version of Python - I remember that I forced my BUILD to use interpreter_constraints for >= 3.9 and that error went away when testing my own ruleswide-midnight-78598
01/18/2022, 6:19 PMwide-midnight-78598
01/18/2022, 6:20 PMhappy-kitchen-89482
01/18/2022, 6:20 PMhappy-kitchen-89482
01/18/2022, 6:21 PMwide-midnight-78598
01/18/2022, 6:23 PMwide-midnight-78598
01/18/2022, 6:27 PMhappy-kitchen-89482
01/18/2022, 6:29 PMhappy-kitchen-89482
01/18/2022, 6:29 PMwide-midnight-78598
01/18/2022, 6:33 PM[python]
experimental_lockfile = "3rdparty/python/lockfiles/user_reqs.txt"
interpreter_constraints = [">=3.7,<3.10"]
macos_big_sur_compatibility = true
This is for going to the root folder and typing ./pants test ::
wide-midnight-78598
01/18/2022, 6:36 PMPY=python3.9 ./pants test ::
Sample error:
___________ ERROR collecting src/python/pants/option/options_test.py ___________
ImportError while importing test module '/private/var/folders/11/60kkmmxx08q79t_pf28zlbm80000gp/T/process-executionqmeXQq/src/python/pants/option/options_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/python/pants/option/options_test.py:22: in <module>
from pants.engine.fs import FileContent
src/python/pants/engine/fs.py:13: in <module>
from pants.engine.engine_aware import SideEffecting
src/python/pants/engine/engine_aware.py:9: in <module>
from pants.engine.internals import native_engine
E ImportError: dlopen(/private/var/folders/11/60kkmmxx08q79t_pf28zlbm80000gp/T/process-executionqmeXQq/src/python/pants/engine/internals/native_engine.so, 0x0002): symbol not found in flat namespace '_PyObject_VectorcallMethod'
- generated xml file: /private/var/folders/11/60kkmmxx08q79t_pf28zlbm80000gp/T/process-executionqmeXQq/src.python.pants.option.options_test.py.tests.xml -
happy-kitchen-89482
01/18/2022, 6:42 PMhappy-kitchen-89482
01/18/2022, 6:43 PMhappy-kitchen-89482
01/18/2022, 6:43 PMhappy-kitchen-89482
01/18/2022, 6:43 PMwide-midnight-78598
01/18/2022, 6:43 PMwide-midnight-78598
01/18/2022, 6:44 PMhappy-kitchen-89482
01/18/2022, 6:44 PMhappy-kitchen-89482
01/18/2022, 6:44 PMsearch_path
option in the [python-bootstrap]
config sectionhappy-kitchen-89482
01/18/2022, 6:45 PM["<PYENV>"]
it will only find pyenv-installed interpreters at runtimehappy-kitchen-89482
01/18/2022, 6:45 PMwide-midnight-78598
01/18/2022, 6:45 PMwide-midnight-78598
01/18/2022, 6:46 PMwide-midnight-78598
01/18/2022, 7:06 PM/src/python/pants/init/BUILD
and in that file are a list of manually included dependencies. Mine wasn't in that list (as I guess I missed the documentation about adding it here), so when I ran my tests, it couldn't find my register.py...
However, when I used pants at the command line, it was using the pants.toml file, which correctly registered it...