ancient-rose-27306
08/23/2022, 1:10 PMpex_binary()
target using package
goal but it fails with following error:
(pants) [root@9a5752857756 pants-training]# ./pants package src/client:greeter_client
13:07:32.60 [ERROR] 1 Exception encountered:
BinaryNotFoundError: Cannot find `unzip` on `['/bin', '/usr/bin', '/usr/local/bin']`. Please ensure that it is installed so that Pants can download the tools Pants needs to run.
(pants) [root@9a5752857756 pants-training]#
I have the unzip package in `/usr/bin/`:
(pants) [root@9a5752857756 pants-training]# ls -ltra /usr/bin/unzip
-rwxr-xr-x 2 root root 206728 Dec 16 2021 /usr/bin/unzip
(pants) [root@9a5752857756 pants-training]#
Could someone please help with this?hundreds-father-404
08/23/2022, 2:47 PM/usr/bin/unzip -v
do? We try running that to make sure the binary works
https://github.com/pantsbuild/pants/blob/9449f42fb37c2663f28da7b33bb4d91d3d1851e7/src/python/pants/core/util_rules/system_binaries.py#L665-L674ancient-rose-27306
08/23/2022, 3:00 PM(pants) [root@9a5752857756 pants-training]# /usr/bin/unzip -v
UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using <http://www.info-zip.org/zip-bug.html>; see README for details.
Latest sources and executables are at <ftp://ftp.info-zip.org/pub/infozip/> ;
see <ftp://ftp.info-zip.org/pub/infozip/UnZip.html> for other sites.
Compiled with gcc 8.5.0 20210514 (Red Hat 8.5.0-7) for Unix (Linux ELF) on Dec 16 2021.
UnZip special compilation options:
COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)
SET_DIR_ATTRIB
SYMLINKS (symbolic links supported, if RTL and file system permit)
TIMESTAMP
UNIXBACKUP
USE_EF_UT_TIME
USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)
USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)
UNICODE_SUPPORT [wide-chars, char coding: UTF-8] (handle UTF-8 paths)
MBCS-support (multibyte character support, MB_CUR_MAX = 6)
LARGE_FILE_SUPPORT (large files over 2 GiB supported)
ZIP64_SUPPORT (archives using Zip64 for large files supported)
USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version 1.0.6, 6-Sept-2010)
VMS_TEXT_CONV
[decryption, version 2.11 of 05 Jan 2007]
UnZip and ZipInfo environment options:
UNZIP: [none]
UNZIPOPT: [none]
ZIPINFO: [none]
ZIPINFOOPT: [none]
(pants) [root@9a5752857756 pants-training]#
hundreds-father-404
08/23/2022, 3:06 PM--no-process-cleanup
https://www.pantsbuild.org/docs/troubleshooting#debug-tip-inspect-the-sandbox-with---no-process-cleanup
Then we can run the __run.sh
script with set -x
enabled in the bash script we use to search for binaries to see what exactly is happening.ancient-rose-27306
08/23/2022, 3:11 PMancient-rose-27306
08/23/2022, 3:15 PMpython setup.py egg_info Check the logs for full command output.
Now, it doesn’t seem to be a python error because I am running both Docker and Pex build on two completely isolated envs.ancient-rose-27306
08/23/2022, 3:17 PM3rdparty/BUILD
in the Docker thread.hundreds-father-404
08/23/2022, 3:17 PMunzip
was able to be discoveredancient-rose-27306
08/23/2022, 3:18 PMancient-rose-27306
08/23/2022, 3:19 PMpackage
without --no-process-cleanup
, it will automatically remove the temp files from previous run too?hundreds-father-404
08/23/2022, 3:19 PM/tmp/process-execution*
ancient-rose-27306
08/23/2022, 3:20 PM3rdparty/BUILD
. Moving to Docker now.ancient-rose-27306
08/23/2022, 6:48 PMpex_binary(
name="greeter_client",
entry_point="greeter_client.py",
)
It doesn’t mention any dependency to any proto (or any python source that imports those protos) but still the pex file has the generated stubs in it.
However, the python_distribution()
required me to explicitly mention the dependency on the source from where it could read the import statements based on which it would generate the stubs.hundreds-father-404
08/23/2022, 8:29 PMpex_binary
has dependency inference. We're able to infer a dependency on greeter_client.py
, which then pulls in the transitive deps on the protos
But for python_distribution
, we don't have any field like entry_point
where we can deduce what your dependencies are. So you have to explicitly tell us. But we still pull in your transitive deps for you, like the protosancient-rose-27306
08/23/2022, 8:57 PM