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

Pybind11: add v2.11.1 #2976

Closed
wants to merge 4 commits into from
Closed

Pybind11: add v2.11.1 #2976

wants to merge 4 commits into from

Conversation

myuanz
Copy link
Contributor

@myuanz myuanz commented Dec 20, 2023

No description provided.

@myuanz
Copy link
Contributor Author

myuanz commented Dec 21, 2023

@waruqi pybind 11 构建测试时,所有的报错都发生在 Windows x86 和 Arm64 上。

x86 构建里报错是Python config failure: Python is 64-bit, chosen compiler is 32-bit,已经正常安装 x86 Python 3.11 但找到的是 x64 Python 3.9。

Windows Arm64 构建里的报错是fatal error C1083: Cannot open include file: 'Python.h': No such file or directory,已经正常安装 x64 Python 3.11 但是构建系统找不到。

会不会是 Python 环境注入发生了什么问题?我查看了 pybind11 的 FindPythonLibsNew.cmake 发现整体流程挺自然的

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@waruqi When building tests with pybind 11, all errors occur on Windows x86 and Arm64.

The error reported in the x86 build is Python config failure: Python is 64-bit, chosen compiler is 32-bit. x86 Python 3.11 has been installed normally but x64 Python 3.9 is found.

The error reported in the Windows Arm64 build is fatal error C1083: Cannot open include file: 'Python.h': No such file or directory. x64 Python 3.11 has been installed normally but the build system cannot find it.

Could there be something wrong with Python environment injection? I checked FindPythonLibsNew.cmake of pybind11 and found that the overall process is quite natural.

@waruqi
Copy link
Member

waruqi commented Dec 21, 2023

@waruqi pybind 11 构建测试时,所有的报错都发生在 Windows x86 和 Arm64 上。

x86 构建里报错是Python config failure: Python is 64-bit, chosen compiler is 32-bit,已经正常安装 x86 Python 3.11 但找到的是 x64 Python 3.9。

Windows Arm64 构建里的报错是fatal error C1083: Cannot open include file: 'Python.h': No such file or directory,已经正常安装 x64 Python 3.11 但是构建系统找不到。

会不会是 Python 环境注入发生了什么问题?我查看了 pybind11 的 FindPythonLibsNew.cmake 发现整体流程挺自然的

调下 python 那个包的 on_fetch ,然后提 pr 改进下

@myuanz
Copy link
Contributor Author

myuanz commented Dec 21, 2023

我试试看吧,不知道 Qemu 模拟的 Windows arm64 够不够味

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I'll give it a try, I don't know if the Windows arm64 simulated by Qemu is interesting enough.

@myuanz
Copy link
Contributor Author

myuanz commented Dec 21, 2023

目前已经发现是某些情况在这里没有正确找到out libpath includepath,

link = format("python" .. table.concat(table.slice(version:split("%."), 1, 2), ""))
print("python program: " .. program .. ", version: " .. version .. ", link: " .. link .. ", exepath: " .. exepath)
local out = try { function () return os.iorunv(program, { "-c", "import sys; print(sys.base_prefix, end='')" }) end }
print("python base_prefix: " .. out)
libpath = find_library(link, { exepath, out }, { suffixes = { "libs" } })
print("python libpath: " .. libpath.link)
linkdirs = {}
includepath = find_path("Python.h", { exepath, out }, { suffixes = { "include" } })

其输出在 https://github.com/xmake-io/xmake-repo/actions/runs/7289700908/job/19864898317?pr=2976#step:5:377 可见

我无法在本地虚拟机里复现问题, 修改 print 在 CI 里看不到, 接下来就等有缘人了

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It has been found that out libpath includepath is not found correctly here in some cases.

link = format("python" .. table.concat(table.slice(version:split("%."), 1, 2), ""))
print("python program: " .. program .. ", version: " .. version .. ", link: " .. link .. ", exepath: " .. exepath)
local out = try { function () return os.iorunv(program, { "-c", "import sys; print(sys.base_prefix, end='')" }) end }
print("python base_prefix: " .. out)
libpath = find_library(link, { exepath, out }, { suffixes = { "libs" } })
print("python libpath: " .. libpath.link)
linkdirs = {}
includepath = find_path("Python.h", { exepath, out }, { suffixes = { "include" } })

Its output can be seen at https://github.com/xmake-io/xmake-repo/actions/runs/7289700908/job/19864898317?pr=2976#step:5:377

I can't reproduce the problem in the local virtual machine. I can't see it in CI after modifying the print command. I'll have to wait for someone to do it next.

yangrq1018 added a commit to yangrq1018/hikyuu_extern_libs that referenced this pull request Jan 24, 2024
@c8ef c8ef mentioned this pull request Apr 8, 2024
@c8ef c8ef closed this in #3727 Apr 8, 2024
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 this pull request may close these issues.

3 participants