Skip to content
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

Ensure venv works with source builds when using --copies #92897

Open
jkloth opened this issue May 17, 2022 · 2 comments
Open

Ensure venv works with source builds when using --copies #92897

jkloth opened this issue May 17, 2022 · 2 comments
Labels
stdlib type-bug

Comments

@jkloth
Copy link
Contributor

@jkloth jkloth commented May 17, 2022

Currently a venv created with --copies or on Windows doesn't respect the sysconfig.is_python_build() property of the creating interpreter. This leads to compilation errors when attempting to build extensions in the virtual environment.

@jkloth jkloth added the type-bug label May 17, 2022
jkloth added a commit to jkloth/cpython that referenced this issue May 17, 2022
@eryksun eryksun added the stdlib label May 17, 2022
@jkloth
Copy link
Contributor Author

@jkloth jkloth commented May 17, 2022

An example error when building psutil.

running build_ext
building 'psutil._psutil_windows' extension
creating build\temp.win-amd64-3.12
creating build\temp.win-amd64-3.12\Release
creating build\temp.win-amd64-3.12\Release\psutil
creating build\temp.win-amd64-3.12\Release\psutil\arch
creating build\temp.win-amd64-3.12\Release\psutil\arch\windows
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=590 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x01000 -D_AVAIL_WINVER_=0x01000 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Users\Jeremy\Source\pyperformance\include -IC:\Public\Devel\cpython\main\include -IC:\Public\Devel\cpython\main\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /Tcpsutil/_psutil_common.c /Fobuild\temp.win-amd64-3.12\Release\psutil/_psutil_common.obj
_psutil_common.c
C:\Public\Devel\cpython\main\include\Python.h(12): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

After the PR, this builds without error (kinda). There is a bug in setuptools that causes an additional error. This can be worked around by setting the environment variable SETUPTOOLS_USE_DISTUTILS=no.

@vstinner
Copy link
Member

@vstinner vstinner commented May 18, 2022

@jkloth proposed #92899 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib type-bug
Projects
None yet
Development

No branches or pull requests

3 participants