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

Cannot build for py311 #33

Closed
kefeimo opened this issue Apr 20, 2023 · 13 comments · Fixed by VOLTTRON/pybind11#1
Closed

Cannot build for py311 #33

kefeimo opened this issue Apr 20, 2023 · 13 comments · Fixed by VOLTTRON/pybind11#1

Comments

@kefeimo
Copy link
Contributor

kefeimo commented Apr 20, 2023

Ref:
log: https://github.com/VOLTTRON/dnp3-python/actions/runs/4757291625/jobs/8453926574

error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
 1912 |             frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
@craig8
Copy link
Contributor

craig8 commented Apr 20, 2023

@kefeimo I was wondering if you had built it locally with py11

@kefeimo
Copy link
Contributor Author

kefeimo commented Apr 20, 2023

@craig8, I did. But I forgot it failed last time, that's why I stopped it at py310.

@Xelus22
Copy link

Xelus22 commented May 1, 2023

I've been attempting packaging for 3.11 but haven't had time to truly debug/look into it.
Packaging for windows (with Visual Studio 2022 installed) and the appropriate cmake etc.
3.10 works fine but 3.11 I run into these issues.
image

image

@kefeimo
Copy link
Contributor Author

kefeimo commented May 1, 2023

I've been attempting packaging for 3.11 but haven't had time to truly debug/look into it. Packaging for windows (with Visual Studio 2022 installed) and the appropriate cmake etc. 3.10 works fine but 3.11 I run into these issues. image

image

@Xelus22 , Thanks for the comment.
I only build for Linux and haven't tested for Windows yet. Can you describe the process you used to successfully build for Python3.10 on Windows so I can try to reproduce on my end. Especially,

  • Could you confirm the codebase version (for example point to the repo and commit)?
  • Could you confirm the dependency versions (e.g., Cmake)
  • (This is a wild guess of the root cause, but) Could you go to the /deps/pybind11, then run git log --oneline display the output. (In essence, the content should be up-to-date with https://github.com/pybind/pybind11 956390a)

@Xelus22
Copy link

Xelus22 commented May 1, 2023

Yep no worries

  • This repo master.
    image

  • cmake 3.25.1-msvc1
    installed with VS 2022 -
    image

  • pybind 11 log
    image

@kefeimo
Copy link
Contributor Author

kefeimo commented May 1, 2023

Got it. It looks like your pybind11 submodule is behind, which is likely the cause of py3.11 fail (at least for Linux.) We merged PR #36 recently to update the submodule pybind11. into develop branch. So, I am hopeful that at you local develop branch, run git pull --recurse-submodules, then try to build again and it should succeed. (more on Git Pull with Submodule)

@Xelus22
Copy link

Xelus22 commented May 1, 2023

Yep that worked. Needed to use develop and update the submodules there.
However it is now saying bdist_wheel command doesn't exist
image

@kefeimo
Copy link
Contributor Author

kefeimo commented May 1, 2023

@Xelus22
Can you google "python 3.11 error: invalid command 'bdist_wheel`"? the following links look promising to me

@Xelus22
Copy link

Xelus22 commented May 1, 2023

Thanks, the first link worked! That created the wheel :)
Looks like it works now
dnp3_python-0.2.3b3-cp311-cp311-win32.whl.zip

Compiled for win32 py3.11

@kefeimo
Copy link
Contributor Author

kefeimo commented May 1, 2023

@Xelus22
Out of curiosity, are you using virtual environment on your Windows? How do you accomplish coexistence of python 3.10, 3.11

@Xelus22
Copy link

Xelus22 commented May 1, 2023

Python now comes with its own unified/version control with py instead of python or python3 now. you just use py -V:x.yy e.g. py -V:3.10 or py -V:3.11 with the commands/files to run after

@kefeimo
Copy link
Contributor Author

kefeimo commented May 1, 2023

Thanks, the first link worked! That created the wheel :) Looks like it works now dnp3_python-0.2.3b3-cp311-cp311-win32.whl.zip

Compiled for win32 py3.11

Good work!!!
On a side note: I provided feedback on PR: Add Windows Notes-on-Packaging.md. It would be awesome to include a solid example on WINDOWS, with commands and output in each step. Especially you have fresh material now.

@Xelus22
Copy link

Xelus22 commented May 1, 2023

And technically this compilation is done on a VM but should in theory work the exact same since I just have a fresh VM for mucking around

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

Successfully merging a pull request may close this issue.

3 participants