-
Notifications
You must be signed in to change notification settings - Fork 64
Unconditional preset python cmake variables #1061
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
Comments
Scikit-build-build has to communicate the Python that's running it to the CMake run. Otherwise CMake will possibly grab the wrong Python instead of the one that's running the process. It also communicates other things, like where to put the files that should go in the wheel. However, this file uses the CMake path syntax which is operating system independent, so it should not break (and we test extensively on Windows, many users use Windows, etc). Do you have more info on what's breaking? Logs, a repo, etc? |
Hi @henryiii, thanks for the reply.
|
Re point 1 the cross-compilation support with But changing the values to be scikit-build-core/src/scikit_build_core/cmake.py Lines 170 to 173 in d52df05
scikit-build-core/src/scikit_build_core/builder/builder.py Lines 242 to 244 in d52df05
|
Do you mean you can't use Python_ROOT but rather having to set whole bunch of Python_ variable individually? Do you mean FindPython is incapable of setting those variable correctly if only Python_ROOT is set? |
It is complicated. As you can see But you are right that these should be converted to |
I originally did just set one value, but had to add others due to bugs finding Python. I think I had to add this one almost immediately. One example is if you have multiple versions of Python side-by-side, which happens, for example, if you have python3.13 and python3.13t. I think there were other bugs too, but that's why we've had a slowly growing number of values set here. We don't need or want FindPython to find Python. We literally are running from the Python we want it to find1, and finding anything else is an error. However, we should set it with a CMake style path, not a Windows style path (true for all paths!), and it looks like that might not be happening. If it's a CMake style path, then it will behave just like if CMake itself set it. Looks like we just need to wrap it like BTW, PATH vs. STRING doesn't matter, but the handling code @LecrisUT highlighted does matter2. The CMake type is just for GUIs when displaying the cache options, like ccmake. Edit: Footnotes |
In my testing the variable type makes a world of difference. When I test manually by setting the variable in command line, if I use something like |
Do you have a sample of an |
I said above the command line makes a difference, but not the set command. That has to be a CMake style path already. The command line converts if it's PATH or FILEPATH. The thing that we are doing wrong is this is avoiding our Windows -> CMake path conversion because the type is a string. |
CMakeLists.txt:
Command line:
Error message:
|
Set it via command line or via set() function is the same for me, STRING type keeps the backslash and breaks, PATH type handles the backslash and works. I don't think the manual conversion is the critical part. |
Interesting, I'm going from the documentation, haven't booted up a Windows machine. I was able to reproduce the failure in tests, working on a fix! |
I run into problem using
Python_EXECUTABLE
variable in Windows build due to the backslash in the string. After some debugging I find out that scikit-build-core setPython_EXECUTABLE
(and some other python related variables) via "-C" option of cmake that pre-populate the cmake cache. I don't find any configuration to override/disable this behavior. I would like to know what is the reason to impose these variables unconditionally to my build configuration. Thanks.The text was updated successfully, but these errors were encountered: