Open sjpritchard opened 3 weeks ago
Error code: Access violation
Please confirm your access rights and antivirus software, then clean the cache and rerun:
./vcpkg remove libtorch
./vcpkg install libtorch
I'm having the exact same error code but when building glad which is also using python 3.12.7
If I run the same python script with my local python installation 3.12.3 there is no issues
My issue goes away if I revert back to python 3.11.8 by reverting this: https://github.com/microsoft/vcpkg/commit/7dcb4ca95bfde3cfca3a9f0a7e933f1d17cc4836#diff-26499ad5d840cada3059f7aaa8363695140b4a6811ed08697b388ab19e16ae97L3-R35
in PR https://github.com/microsoft/vcpkg/pull/41232
This could still be related to antivirus/applocker/etc issues but debugging the Access Violation crash is hard. Seems to happen somewhere in pythons importlib._bootstrap for me. Maybe the new old python has be removed from windows defender, but the new one triggers some issue? Very hard to say. Im not allowed to bypass the org antivirus settings so Im not able to try that.
Possible the same issue as #41707
I figured out the issue.
vcpkg downloads and uses python 3.12.7 and puts that into vcpkg/downloads/tools/python/python-3.12.7-x64
But I have a local python installation of python 3.12.3 in C:\Program Files\Python312 which is also in the global PATH
And it turns out the the vcpkg python will load the _ctypes.pyd from C:\Program Files\Python312 \DLLs not the on in vcpkg/downloads/tools/python/python-3.12.7-x64 and the are apparently not binary compatible. The old ctypes dll will try use PyObject_LookupAttr which craches with an access violation.
Updating my local python version to the same version "solves" the issue.
But the vcpkg python really should run isolated from any other installations.
Maybe scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake should prefix it self to the local path
@Neumann-A Could you help look into this issue?
IMO this is the same problem that we see with the meson ports (other issues): One of the other installations of python interferes with the version run by vcpkg.
And there is a PR for meson in particular. One thing I don't like about that PR is that I assume that vcpkg_find_acquire_program(PYTHON3)
must be fixed to do the right thing.
vcpkg_find_acquire_program(PYTHON3)
disables the "isolated mode" for the downloaded python. This has some desired effects, but it also makes python use Windows registry and environment variables (PYTHONPATH and PYTHONHOME) when setting up the module search path. I guess this is what causes interference but I'm not an expert for python.
@petersteneteg Are these environment variables set in your system? If yes, is the problem solved by unsetting them?
The registry lookup is the problem. I think the only way to 'solve' it is by pretending to be a venv python if vcpkg provides the tool.
The registry lookup is the problem. I think the only way to 'solve' it is by pretending to be a venv python if vcpkg provides the tool.
Agree.
Basically we have what is needed in vcpkg-get-python-packages, except that it requires packages to be defined.
(pip
should be a no-op?)
Package: libtorch:x64-windows@2.1.2#7
Host Environment
To Reproduce
vcpkg install
Failure logs
Additional context
vcpkg.json
``` { "name": "ai-sim-assistant", "builtin-baseline": "4f746bc66438fce2b900c3ba6094a483b871b045", "dependencies": [ { "name": "flashlight-text", "version>=": "0.0.4", "features": [ "kenlm" ] }, { "name": "glog", "version>=": "0.7.1" }, { "name": "gtest", "version>=": "1.15.2" }, { "name": "jwt-cpp", "version>=": "0.7.0#1" }, { "name": "kenlm", "version>=": "20230531#1" }, { "name": "libtorch", "default-features": false, "version>=": "2.1.2#7" }, { "name": "openssl", "version>=": "3.4.0" }, { "name": "rapidfuzz", "version>=": "3.0.5" } ] } ```