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

build 306 cannot build with python3.12 #2249

Open
tangyinqi opened this issue Apr 24, 2024 · 3 comments
Open

build 306 cannot build with python3.12 #2249

tangyinqi opened this issue Apr 24, 2024 · 3 comments

Comments

@tangyinqi
Copy link

tangyinqi commented Apr 24, 2024

For all bugs, please provide the following information:

Expected behavior and actual behavior

Steps to reproduce the problem

Build 306 of pywin32 cannot be built with python 3.12.
But build 306 of pywin32 can be built with python 3.86
(I built it in virtual windows environment)
distutils was removed in python 3.12, which was still used in setup.py. So is that the reason?

Anyone who has successfully built pywin32 with python 3.12?

Below is where it failed building:

INFO:root:building 'win32file' extension
INFO:root:swigging win32/src/win32file.i to win32/src/win32file_swig.cpp
INFO:root:C:\__w\1\s\src\pywin32\swig\swig.exe -python -c++ -dnone -DSWIG_PY64BIT -o C:\__w\1\s\src\pywin32\win32\src\win32file_swig.cpp C:\__w\1\s\src\pywin32\win32\src\win32file.i
INFO:root:"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DDISTUTILS_BUILD -D_CRT_SECURE_NO_WARNINGS -DCRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS -Icom/win32com/src/include -Iwin32/src -IC:\__w\1\s\out\buildenvs\venv-Test\include -IC:\__w\1\s\packages\python.3.12.1\tools\include -IC:\__w\1\s\packages\python.3.12.1\tools\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-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\\um" "-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\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpwin32/src/win32file_comm.cpp /Fobuild\temp.win-amd64-cpython-312\Release\win32/src/win32file_comm.obj /Zi /Fdbuild\temp.win-amd64-cpython-312\Release\win32file_vc.pdb /EHsc /wd4163 -DUNICODE -D_UNICODE -DWINNT
INFO:root:"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DDISTUTILS_BUILD -D_CRT_SECURE_NO_WARNINGS -DCRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS -Icom/win32com/src/include -Iwin32/src -IC:\__w\1\s\out\buildenvs\venv-Test\include -IC:\__w\1\s\packages\python.3.12.1\tools\include -IC:\__w\1\s\packages\python.3.12.1\tools\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-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\\um" "-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\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpwin32/src/win32file_swig.cpp /Fobuild\temp.win-amd64-cpython-312\Release\win32/src/win32file_swig.obj /Zi /Fdbuild\temp.win-amd64-cpython-312\Release\win32file_vc.pdb /EHsc /wd4163 -DUNICODE -D_UNICODE -DWINNT
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe' failed with exit code 2
C:\__w\1\s\out\buildenvs\venv-Test\Scripts\python.exe setup.py install 
--skip-verstamp failed with exit code 1

This is the command I use to build:

setup.py install --debug --skip-verstamp

System information

Python version and distribution:

pywin32 version: build 306

Installed from PyPI or exe installer:

Windows Version:

DLL locations:

@Avasam
Copy link
Collaborator

Avasam commented May 18, 2024

@tangyinqi Do you have the full error log? The tests do run the install script on Python 3.12 (although not in debug mode), so I'm tempted to say it's likely an issue with your environment.

matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
architecture: ['x64', 'x86']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Setup environment
run: |
python --version
pip --version
pip install --upgrade setuptools wheel
- name: Build and install
run: |
python setup.py --skip-verstamp install --user

distutils was removed in python 3.12, which was still used in setup.py. So is that the reason?

setuptools stills vendors and patches-in distutils. So no.

@smanross
Copy link

minor note as I was searching for bug notes before filing one as I found an issue in 306 using Python 3.12 on Windows... the imp module has been deprecated

imp is used in win32comext\axscript\client\pyscript.py at line 213 (in 306)

@Avasam
Copy link
Collaborator

Avasam commented May 21, 2024

@smanross that has been resolved in #2113 but isn't released yet.

If you need it, you can look at artefacts from the "CI" action: https://github.com/mhammond/pywin32/actions/workflows/main.yml?query=is%3Asuccess+branch%3Amain

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

No branches or pull requests

3 participants