https://pantsbuild.org/ logo
#development
Title
# development
p

polite-garden-50641

08/30/2022, 2:56 PM
seeing a failure on the main branch:
Copy code
Caused by:
    command ["/tmp/pants-sandbox-A9W6vX/.cache/pyoxidizer/python_distributions/python.1c490d71269e/python/install/bin/python3.9", "-m", "pip", "--disable-pip-version-check", "install", "--target", "/tmp/pyoxidizer-pip-installjeHPfR/install", "pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl"] exited with code 1
  --> ./pyoxidizer.bzl:21:30
   |
21 |     exe.add_python_resources(exe.pip_install(['pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl']))
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PythonExecutable.pip_install()


error: calling pip install
to repo run
./pants package  src/python/::
(this is on linux, didn't try on mac).
Copy code
14:55:30.95 [INFO] Initializing scheduler...
14:55:31.48 [INFO] Scheduler initialized.
14:55:32.79 [INFO] View on BuildSense: <https://app.toolchain.com/organizations/pantsbuild/repos/pants/builds/pants_run_2022_08_30_14_55_31_679_76b7b3a041514b65b7916ac07b91df29/>
14:55:41.45 [INFO] Completed: Building src/python/pants/bin:pants_oxidized_experimental with PyOxidizer
14:55:41.45 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
  in pants.core.goals.package.package_asset
  in pants.backend.python.packaging.pyoxidizer.rules.package_pyoxidizer_binary (src/python/pants/bin:pants_oxidized_experimental)
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/data/home/asher/projects/pants2/src/python/pants/engine/process.py", line 272, in fallible_to_exec_result_or_raise
    raise ProcessExecutionFailure(
pants.engine.process.ProcessExecutionFailure: Process 'Building src/python/pants/bin:pants_oxidized_experimental with PyOxidizer' failed with exit code 1.
stdout:
resolving 1 targets
resolving target install
resolving target exe
resolving Python distribution <https://github.com/indygreg/python-build-standalone/releases/download/20211017/cpython-3.9.7-x86_64-unknown-linux-gnu-pgo-20211017T1616.tar.zst> (sha256=1c490d71269eaeebe4de109d9bd1d22281cc028f2161bfe467f6df31de326e3a)
Python distribution available at /tmp/pants-sandbox-JxgxLJ/.cache/pyoxidizer/python_distributions/cpython-3.9.7-x86_64-unknown-linux-gnu-pgo-20211017T1616.tar.zst
reading data from Python distribution...
installing modified distutils to /tmp/pyoxidizer-pip-installa8WwD5/packages
modifying distutils/_msvccompiler.py for oxidation
modifying distutils/command/build_ext.py for oxidation
modifying distutils/unixccompiler.py for oxidation
pip installing to /tmp/pyoxidizer-pip-installa8WwD5/install
ERROR: pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.
error[PYOXIDIZER_PYTHON_EXECUTABLE]: calling pip install

Caused by:
    command ["/tmp/pants-sandbox-JxgxLJ/.cache/pyoxidizer/python_distributions/python.1c490d71269e/python/install/bin/python3.9", "-m", "pip", "--disable-pip-version-check", "install", "--target", "/tmp/pyoxidizer-pip-installa8WwD5/install", "pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl"] exited with code 1
  --> ./pyoxidizer.bzl:21:30
   |
21 |     exe.add_python_resources(exe.pip_install(['pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl']))
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PythonExecutable.pip_install()


error: calling pip install

Caused by:
    command ["/tmp/pants-sandbox-JxgxLJ/.cache/pyoxidizer/python_distributions/python.1c490d71269e/python/install/bin/python3.9", "-m", "pip", "--disable-pip-version-check", "install", "--target", "/tmp/pyoxidizer-pip-installa8WwD5/install", "pantsbuild.pants-2.15.0.dev0-cp37-cp37m-linux_x86_64.whl"] exited with code 1

stderr:



Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
@enough-analyst-54434 @ancient-vegetable-10556
not a blocker for me or anything. more of an FYI.
w

wide-midnight-78598

08/30/2022, 3:02 PM
a

ancient-vegetable-10556

08/30/2022, 3:04 PM
OK. I hadn’t tried running
package ::
before, and yes, the default interpreter constrains can’t build the PyOxidized binary, because the rust binary gets built against the Python that runs pants
so if you have default interpreter constraints, it’ll build
native_engine.so
against 3.7 and then PyOxidizer will fail
Obviously it would be useful to fix this… I am wondering whether there is a way to get the pyoxidizer build to not get built when running
pants package src/python::
— if there isn’t, then maybe I move the pyox stuff over to an
experimental
top-level-directory?
h

hundreds-father-404

08/30/2022, 3:24 PM
Some targets have a
skip_package
field. The issue there is you can't dynamically change BUILD files via the options system, so there would be no way to say "don't publish locally but do publish in CI"
a

ancient-vegetable-10556

08/30/2022, 3:26 PM
well even then, we need the Rust build to happen under restricted Python ICs for PyOx to even work in the first place. Maybe for that reason it’s worth moving the PyOx stuff out of the main source tree?
👍 1
h

hundreds-father-404

08/30/2022, 3:28 PM
You would only need to move the target definition, right?
a

ancient-vegetable-10556

08/30/2022, 3:28 PM
Right.
Proposal is to move the target definition to
<ROOT>/experimental/pyoxidized
h

hundreds-father-404

08/30/2022, 3:34 PM
how about
build-support/
?
a

ancient-vegetable-10556

08/30/2022, 3:38 PM
I’m not 100% certain it fits there
It’s certainly unlikely anyone would call
./pants package build-support/::
🤷
1
h

hundreds-father-404

08/30/2022, 3:45 PM
Yeah, I think it's fine in
build-support
, which is where our release scripts are. It's not perfect, but we don't need perfect here
a

ancient-vegetable-10556

08/30/2022, 3:46 PM
OK, I have a PR that’s tangentially related to this coming up, so I’ll file a ticket for @polite-garden-50641’s report, and then solve both bits in one hit
👍 1