acoustic-librarian-3937
02/25/2022, 12:50 AMcryptography
library. This requires rust and openssl. It fails to compile because it cannot find headers for openssl.
build/temp.macosx-12.1-arm64-3.9/_openssl.c:575:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.h>
I am surprised by this, because I explicitly set some env variables to avoid this.
$ echo $CPPFLAGS $LDFLAGS $PKG_CONFIG_PATH
-I/opt/homebrew/opt/openssl@3/include -L/opt/homebrew/opt/openssl@3/lib /opt/homebrew/opt/openssl@3/lib/pkgconfig
$ ls /opt/homebrew/opt/openssl@3/include/openssl/opensslv.h
/opt/homebrew/opt/openssl@3/include/openssl/opensslv.h
What should I change to get cargo to look in the right spot for that file?hundreds-father-404
02/25/2022, 12:52 AMos.environ.get("CPPFLAGS", "")
Also we have a bug in that code that we are not invalidating Pantsd, OOF. This was code written a long time ago. Try using --no-pantsd
or explicitly setting the options --python-native-code-cpp-flags
and --python-native-code-ld-flags
enough-analyst-54434
02/25/2022, 12:54 AMacoustic-librarian-3937
02/25/2022, 12:55 AMCPPFLAGS
set in my shell, shouldn't that get passed on to any child process spawned by me in that shell, i.e. pants -> cargo -> clang?enough-analyst-54434
02/25/2022, 12:55 AMacoustic-librarian-3937
02/25/2022, 12:55 AMhundreds-father-404
02/25/2022, 12:56 AMpython-native-code
. pex_cli.py
line 129.
I've tried a few times to get rid of python-native-code
in favor of something like subprocess-environment
, but I couldn't figure out how to not break our deprecation policy. That subsystem is so random, it's a holdover from v1enough-analyst-54434
02/25/2022, 12:57 AMhundreds-father-404
02/25/2022, 12:59 AMhappy-kitchen-89482
02/25/2022, 1:01 AMhundreds-father-404
02/25/2022, 1:02 AMDeprecated options must behave the same as before.But at least better than Pants complaining the option does not exist, and the deprecation message will point you to how to fix things
[subprocess-environment]
to [python]
imoacoustic-librarian-3937
02/25/2022, 1:05 AMfork()
in c, the child process and the parent have the same env, right? 🙂explicitly setting the optionsand--python-native-code-cpp-flags
--python-native-code-ld-flags
hundreds-father-404
02/25/2022, 1:06 AM[python-native-code]
options + [subprocess-environment]
this worked btwExcellent. What about if you go back to using the default and do
rm -rf .pids
first to force Pantsd to restart? Given that you have explicitly set your $CPPFLAGS
and $LDFLAGS
to the correct value, the default should work other than the Pantsd invalidation bugacoustic-librarian-3937
02/25/2022, 1:08 AMcryptography
but it didn't fail!hundreds-father-404
02/25/2022, 1:12 AM--no-local-cache --no-pantsd
to be extra extra confident, but I think you're in the clear.
FYI the cache would not be used if LDFLAGS
and CPPFLAGS
was set to a different value because the input to building the PEX would have changed. You can convince yourself of this by trying another run with --python-native-code-cpp-flags=nonsense
, and Pants should try rebuilding the PEX.acoustic-librarian-3937
02/25/2022, 1:19 AM--no-local-cache --no-pantsd
was also successful. I couldn't force it to fail with --python-native-code-cpp-flags=nonsense
which is a little 👻 to me. But I am also still not sure why it even tried to build cryptography from source, given that my constraint was cryptography==36.0.1
and a wheel for that exists cryptography-36.0.1-cp36-abi3-macosx_10_10_universal2.whl
https://pypi.org/project/cryptography/#files so maybe it just used the wheel?busy-vase-39202
02/25/2022, 1:25 AMacoustic-librarian-3937
02/25/2022, 1:26 AMhundreds-father-404
02/25/2022, 1:26 AMacoustic-librarian-3937
02/25/2022, 1:26 AMhundreds-father-404
02/25/2022, 1:27 AMuniversal2
and backported that to 2.9, but need to check the changelog if that got cherry-picked. (logging off for the night, will check tomorrow if someone doesn't beat me)acoustic-librarian-3937
02/25/2022, 1:28 AMCollecting cryptography>=3.3.1
Downloading cryptography-36.0.1-cp36-abi3-macosx_10_10_universal2.whl
busy-vase-39202
02/25/2022, 3:21 AMlively-exabyte-12840
02/25/2022, 1:01 PMenough-analyst-54434
02/25/2022, 3:19 PMuniversal2
I dropped the ball. The PR is here and still needs cherry-pick: https://github.com/pantsbuild/pants/pull/14256
It looks like that landed on the 26th and I had gone on OOO for a few weeks the 25th (technically).
I'll get the cherry-pick up here presently.busy-vase-39202
02/25/2022, 4:19 PM