Skip to content

LNK1104: cannot open file 'python3.lib' in Windows Python 3.13 RC #864

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

Closed
dofuuz opened this issue Aug 19, 2024 · 10 comments
Closed

LNK1104: cannot open file 'python3.lib' in Windows Python 3.13 RC #864

dofuuz opened this issue Aug 19, 2024 · 10 comments

Comments

@dofuuz
Copy link

dofuuz commented Aug 19, 2024

Build fails when targeting ABI3 with Windows + Python 3.13.

OS: Windows
Python: 3.13.0rc1

   LINK : fatal error LNK1104: cannot open file 'python3.lib' [D:\a\nanobind_example\nanobind_example\build\cp312-abi3-win_amd64\nanobind_example_ext.vcxproj]

Full log: https://github.com/dofuuz/nanobind_example/actions/runs/10452840733/job/28942106258#step:5:96
Source: https://github.com/dofuuz/nanobind_example/tree/43c312cfa2dba30183c66a1f8b5ed31c8e0b8083

python3.lib exists within Python libs folder.

More simple way to reproduce it from scikit-build-core example:

cd scikit-build-core\tests\packages\abi3_pyproject_ext
pip wheel -v .
@LecrisUT
Copy link
Collaborator

Can you check if setup-python provides full dev packages in this case? Otherwise it could be some path escaping is not done properly in nanobind 🤷

@dofuuz
Copy link
Author

dofuuz commented Aug 19, 2024

@LecrisUT

I could reproduce it from local Windows PC, so it's not problem of setup-python.

And same error occurs in abi3_pyproject_ext example of scikit-build-core. So it's not problem of nanobind.

@LecrisUT
Copy link
Collaborator

And same error occurs in abi3_pyproject_ext example of scikit-build-core. So it's not problem of nanobind

Oh, ok, let me add this to the test cases to try and reproduce here as well

@LecrisUT
Copy link
Collaborator

Still it is most probably a CMake issue, but I couldn't find any reports in the [upstream issues](https://gitlab.kitware.com/cmake/cmake/-/issues. Managed to capture the test failure in tests\test_pyproject_abi3.py. I wonder if the issue is with Development.SABIModule because it seems the tests that don't use it did not fail 🤔

@henryiii
Copy link
Collaborator

henryiii commented Aug 19, 2024

Even if it is, we likely can fix it via setting Python_SABI_LIBRARY. Edit: we do: https://github.com/LecrisUT/scikit-build-core/blob/20db5a527537ba4c14d09a62afd9122d7121a3e0/src/scikit_build_core/builder/builder.py#L207

@henryiii
Copy link
Collaborator

Debugging in #865

@henryiii
Copy link
Collaborator

henryiii commented Aug 19, 2024

I have a feeling we are being affected by python/cpython#110049 combined with some logic issues, some of these variables were missing on Windows before.

@henryiii
Copy link
Collaborator

Looks like that fixes our tests, at least.

@henryiii
Copy link
Collaborator

Should be fixed in 0.10.4!

@dofuuz
Copy link
Author

dofuuz commented Aug 21, 2024

Fix confirmed! Thank you 👍

@dofuuz dofuuz closed this as completed Aug 21, 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

No branches or pull requests

3 participants