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
UnboundLocalError when system cmake is installed using pip #718
Comments
After checking #717, I think this will work: - except subprocess.CalledProcessError:
+ except subprocess.CalledProcessError as result:
logger.warning(
"Could not determine CMake version via --version, got {!r} {!r}",
result.stdout,
result.stderr,
) |
A script called CMake that imports CMake from CMake sounds suspect (what is anaconda doing?), but you are correct, static checks didn’t catch the unbound variable bug. |
To be clear, I installed cmake using The content of #!/home/njzjz/anaconda3/bin/python3.12
# -*- coding: utf-8 -*-
import re
import sys
from cmake import cmake
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cmake()) |
Yes, that makes sense - if cmake is installed in an "outer" environment (such as no environment), then it might get picked up on the path but not have a valid Python install. If cmake became a real "script", that would fix this, though I'm not sure where I'd need to put the helper module files if we do that (something I do want to explore). Hopefully this is fixed in #719. It's a tricky1 thing to test for. Footnotes
|
Fix #718 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Was able to test locally. Fixed in 0.9.2. |
I got the following error
The error handling here has a problem. So I hack
subprocess.py
to print the stdout/stderr:This seems to be expected, as scikit-build-core runs in an isolated environment.
The error handing problem should be related to #717.
The text was updated successfully, but these errors were encountered: