-
-
Notifications
You must be signed in to change notification settings - Fork 844
Envvars not set in subshell in macOS Python 3.7-3.9 configure invocation #1049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does anything need to change in the devguide documentation, or are you suggesting the generated configure script should be tweaked? If the former, could you point out exactly where the text should be changed is, and what you're suggesting it be changed to? If the latter, we should transfer this issue to the CPython repo instead. |
Hello, @CAM-Gerlach. Thanks for following up on this. I am suggesting a change to the instructions for building Python on macOS here. The command for building Python 3.9 through 3.7 is not working as intended because On my comment before yours I've posted the command that worked: $ export PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig"; \
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
./configure --with-pydebug \
--with-openssl=$(brew --prefix [email protected]) \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)" But I would like to open this up for discussion as there might be a better approach since I am no expert on that matter. |
Okay, thanks for the clarifications. In that case, I'd refer this to macOS build experts @ned-deily and @ronaldoussoren to take a look. |
@thecesrom, can you please propose a patch in the form of a PR; it's easier to review your proposed change that way. |
I don't use Homebrew myself but the problem here is a shell issue. It's a bit subtle but the instructions for both 3.9- and 3.10+ are incorrect in the devguide. The issue is the order in which a POSIX-conformant shell evaluates statements. Reading the POSIX spec for the shell command language, it states that, when evaluating simple commands, words that are recognized as variable assignments are saved for processing in a later step, then words (in the shell sense) are expanded first, including command substitions
For the 3.10 instructions, it doesn't matter that the And things are much simplier starting with 3.11 as configure.ac and friends almost fully support pkg-config for all dependencies. The devguide should be updated to reflect that. |
Will do. |
And @thecesrom make sure to see Ned's comment for what actually should be changed before you do. |
If I understood @ned-deily's comment correctly, it is not necessary to set So I've just tried it with this: $ CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
./configure --with-pydebug \
--with-openssl=$(brew --prefix openssl) And while I did get some warnings after running $ make -s -j2
...
The necessary bits to build these optional modules were not found:
ossaudiodev spwd
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc pwd time
renaming build/scripts-3.10/pydoc3 to build/scripts-3.10/pydoc3.10
renaming build/scripts-3.10/idle3 to build/scripts-3.10/idle3.10
renaming build/scripts-3.10/2to3 to build/scripts-3.10/2to3-3.10 I do have one more suggestion for the The PR is on its way. Thanks |
Describe the bug
I've tried building Python 3.9.16 on macOS following the dev guide and I believe there is an issue with the command as
pkg-config
fails to get the value set forPKG_CONFIG_PATH
as, in my limited knowledge of the shell, I believepkg-config --libs tcl tk
runs on a subshell.The current
configure
command produces the following output:Expected behavior
The one-line command should properly set
PKG_CONFIG_PATH
.I've had success running the following:
Additional context
There must be something that can be done differently, but I know I'm no expert in the matter.
The text was updated successfully, but these errors were encountered: