Hello, community! I happen to do some work on a Pa...
# general
g
Hello, community! I happen to do some work on a Pants-built python app from a colleague that recently left the company and I have an issue, which I prefer to address here instead of stackoverflow. So, the issue is that we need to run this pants app on RHEL 9, 8 and 7 and we build it on CentOS 7 (which works on rhel7 / 8 as expected), but on RHEL 9, I get a glibc error : "return code=1, stdout=, stderr=awk: /tmp/_MEIu4qVxf/libm.so.6: version `GLIBC_2.29' not found (required by awk)". I've also tried to build it on rhel 8, but throws the same error as above. Also attaching an output of glibc backwards compat. Building the pants bin directly on RHEL 9 works correctly. Do you have any idea how to make it run from rhel 7 to all the upcoming distros? Thanks alot!
e
I'm focusing on this: "...`GLIBC_2.29' not found (required by awk)" Read literally, that says `awk`requires glibc 2.29 and
awk
is a native program, not Python at all. Does the Pants Python app (I assume you mean a PEX produced by Pants and not
./pants
itself) contain a copy of
awk
or does the it try to invoke the system
awk
in a subprocess? PEXes are just zipfiles; so you can use
zipinfo <your PEX python app>
or unzip it and inspect that way.
Also, what is the Pants version?
./pants --version
g
Thanks for the answer, pants version is 2.6.1
e
Ok, And was I right in assuming by Pants Python app you meant a Python application packaged by Pants; in other words a
python_binary
(or
pex_binary
) app produced by running
./pants package ...
resulting in an app file emitted under
dist/...
?
g
yes, that is correct
I didn't fully read the Pants doc
I assume you want me to run a tar -tf because the archive is a .tar.gz
from what I checked, it invokes the system awk
tar -tf nci-env-validation-14.0.1-33.g6a50387.tar.gz | grep -i awk ----- this returns nothing
e
Aha, Pants does not produce tarballs. Your repo must have a custom Pants plugin that does this. What is the Pants command line you run to generate this tarball?
g
cmd1='rm -rf dist && ./pants --version && ./pants filter --filter-target-type=python_distribution :: | xargs ./pants package && ./pants filter --filter-target-type=pex_binary :: | xargs -i -d ":" -n 2 '${RUNNING_DIR_RELATIVE}'/build_installer_binary.sh' cmd2='rm -rf dist && ./pants --version && ./pants filter --filter-target-type=python_distribution :: | xargs ./pants package && ./pants --changed-since='${BRANCH}' --changed-dependees=transitive filter --filter-target-type=pex_binary --address-regex="^(.(?!(.py:)))*$" | xargs -i -d ":" -n 2 '${RUNNING_DIR_RELATIVE}'/build_installer_binary.sh' cmd=$(setCmd "${cmd1}" "${cmd2}") bash -c "${cmd}"
e
And, while I have you, if you can share your pants.toml (or pants.ini), that would help determine if you do, in fact, have custom plugins. In modern Pants this is found in the GLOBAL section
So
'${RUNNING_DIR_RELATIVE}'/build_installer_binary.sh'
is the actual terminal command. Can you look in that shell script and see what Pants commands it invokes?
g
only pyinstaller and staticx commands
e
Ok, well then no Pants is involved. ALl the Pants commands you listed above just produce Pants metadata.
g
right, I see the libm added here
thanks for the info
e
So pyinstaller is not Pants. The Pantsbuild team does not maintain that project.
I think you need to ask those folks in their forums.
g
I wonder what's the purpose of Pants here
this is so complicated
thanks a lot for your help
e
No clue. I agree it seems very very strange.
Yes, super complicated. Good luck!!
h
Looks like you're using Pants to query dependency metadata and do change analysis, but not actually run any processes!
😲 1
👍 1
Thanks again, John for pointing out that we weren't actually using pants 😄
e
Ah, excellent. You're welcome.