-
Notifications
You must be signed in to change notification settings - Fork 16
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
Multiple calls operating on the same build folder leak resources from isolated environment #26
Comments
Hi @remy-phelipot, sorry for the late reply, I missed this issue somehow. cmake-build-extension/setup.cfg Line 50 in bb836e4
Can you provide more info on your use case? |
Hello @diegoferigo. I tested again and indeed ninja seems to be correctly installed, so my original message do not correctly reflect the actual problem. I'm encountering the following error when building the example module (I added
If I produce the sdist and the wheel using Do you know what is going on and if there is any solution? |
Calling I couldn't reproduce your problem on my PC (see details below). The example has two Let's keep investigating, I suspect that is something specific to your setup since it's not happening in mine nor in CI that builds installs and tests in all major OSs. python -m build --wheel
|
I reset my environment and do:
So far so good. But if I execute the command again it fails:
It seems temporary files are produced in the
|
Ow ok I finally understood the problem after your last comment! The I suspect that a workaround is passing in your |
Yeap your solution works at least on linux platforms 🙂 As the use of ninja is internal of diff --git a/src/cmake_build_extension/build_extension.py b/src/cmake_build_extension/build_extension.py
index a27d144..c4667c7 100644
--- a/src/cmake_build_extension/build_extension.py
+++ b/src/cmake_build_extension/build_extension.py
@@ -148,6 +148,7 @@ class BuildExtension(build_ext):
"-GNinja",
f"-DCMAKE_BUILD_TYPE={ext.cmake_build_type}",
f"-DCMAKE_INSTALL_PREFIX:PATH={cmake_install_prefix}",
+ f"-DCMAKE_MAKE_PROGRAM={shutil.which('ninja')}",
]
# Extend the configure arguments with those passed from the extension |
Yes this was the idea, thanks for trying! Do you have specific reasons to say that this works only on linux platforms? The Feel free to open a PR with this change, otherwise I'll take care of it in the next days. |
I agree about Windows compatibility, it should be ok. |
Fix #26: Pass ninja path to CMakeCache through CMAKE_MAKE_PROGRAM
Hello,
Ninja is currently the only generator supported by cmake-build-extension:
cmake-build-extension/src/cmake_build_extension/build_extension.py
Line 78 in bb836e4
Unfortunately it is not installed on all platform and a great benefit of CMake is to be agnostic of the final build tool that is used.
It would be nice to add a configuration option that select a different generator in replacement of Ninja (e.g. Make)
The text was updated successfully, but these errors were encountered: