Skip to content
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

debug build with pip? #1033

Open
qnzhou opened this issue Oct 13, 2023 · 2 comments
Open

debug build with pip? #1033

qnzhou opened this issue Oct 13, 2023 · 2 comments

Comments

@qnzhou
Copy link

qnzhou commented Oct 13, 2023

Hi there, thanks for this great tool!

I am not able to figure out how to create a cmake debug build using pip.

export SKBUILD_CONFIGURE_OPTIONS="-DCMAKE_BUILD_TYPE:STRING=Debug"
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -e .

however, it does not work.

$ grep CMAKE_BUILD_TYPE _skbuild/*/cmake-build/CMakeCache.txt
CMAKE_BUILD_TYPE:STRING=Release

Any hints? Thanks!

@henryiii
Copy link
Contributor

It looks like the logic is incorrect for passing this through properly. It was only designed for setup.py commands. :( I think

if namespace.build_type is not None:
_cmake_args.append("-DCMAKE_BUILD_TYPE:STRING=" + namespace.build_type)
needs to respect having it already set in the arguments, like
# Select correct --config using final CMAKE_BUILD_TYPE
for item in cmake_args[::-1]:
if item.startswith("-DCMAKE_BUILD_TYPE"):
_, config_type = item.split("=")
break
else:
config_type = "Release"
cmake_args.append("-DCMAKE_BUILD_TYPE:STRING=Release")
does.

PS: In scikit-build-core you can set this in toml or via -C (config-settings).

@qnzhou
Copy link
Author

qnzhou commented Oct 13, 2023

Thanks! I will try scikit-build-core again. I remember there was some missing feature (possibly related to editable debug build) that prevents me from migrating to it, but I will double check again! Thanks for confirming this bug!

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

2 participants