Skip to content

Conversation

LecrisUT
Copy link
Collaborator

Back in #790 I commented that we could support configurePresets if we overwrite the binarydir. It seems to work fine, but I realized we still have an issue to discuss how to deal with the generator. My thinking is that depending on make-fallback value and if preset is present we deffer to the value of preset and let it handle the rest. Although not sure how to detect/handle multi-config then, but wouldn't it build all configs if it wasn't specified explicitly? The documentation of make-fallback is also confusing me a bit.

PS: it took me way too long to figure out nox -t gen was a thing 🤦

@LecrisUT LecrisUT force-pushed the preset branch 2 times, most recently from 1c4ae1f to 9f9b879 Compare February 19, 2025 18:53

default_cmake_minimum = "3.15"
if self.settings.cmake.preset:
default_cmake_minimum = "3.19"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I am handling this part correctly. Generally it should not be tied to the auto-cmake version, but not sure where to feed it to override potential values set by the user. Or we just fail it at builder.cmake?

@LecrisUT LecrisUT force-pushed the preset branch 3 times, most recently from cf19fc1 to d07f649 Compare February 20, 2025 13:59
"OVERWRITTEN_VAR": "original"
},
"binaryDir": "/dev/null",
"generator": "Ninja"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows disapproves, but empty generator is only available in version 3. Not sure if I can bump it and satisfy the other builders. What generator value is available on windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scikit-build-core installs ninja via pip anyway, doesn't it? It should be ok to set Ninja on all platforms unconditionally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows is the black sheep here, and there is some logic on scikit-build-core around it. Don't remember the details though. There is also the logic around make-fallback option which confused me a bunch when I first attempted this

@alexreinking
Copy link
Contributor

This would be really useful as I could replace my [cmake.define] table with a {wheel_tag} preset. I'd like to help. What's the blocker here?

@LecrisUT
Copy link
Collaborator Author

LecrisUT commented Aug 7, 2025

This would be really useful as I could replace my [cmake.define] table with a {wheel_tag} preset. I'd like to help. What's the blocker here?

I need to rebase this and run the CI again. Iirc the issue was something to do with windows even when we overwrote the generator. I will not have a pc to work for about 1 week, but could you try a simple rebase and opening a PR in your fork to check the failure again?

@jcfr jcfr added this to the v0.12.0 milestone Sep 19, 2025
Signed-off-by: Cristian Le <git@lecris.dev>
@LecrisUT
Copy link
Collaborator Author

Got to rebasing this, and here is the main issue that we encounter in this PR

>           raise FailedLiveProcessError(msg) from None
E           scikit_build_core.errors.FailedLiveProcessError: CMake configuration failed

_cmake_args = <generator object CMaker._compute_cmake_args at 0x000001981C3B3970>
all_args   = ['-SD:\\a\\scikit-build-core\\scikit-build-core\\tests\\packages\\cmake_defines', '-BC:\\Users\\runneradmin\\AppData\\...istEntryThatWouldOverflowTheLine;Baz', '-DNESTED_LIST=Apple;Lemon\\;Lime;Banana', '-DOVERWRITTEN_VAR=overwritten', ...]
cmake_args = []
defines    = {'NESTED_LIST': 'Apple;Lemon\\;Lime;Banana', 'ONE_LEVEL_LIST': 'Foo;Bar;ExceptionallyLargeListEntryThatWouldOverflowTheLine;Baz', 'OVERWRITTEN_VAR': 'overwritten'}
gen        = 'Visual Studio 17 2022'
msg        = 'CMake configuration failed'
preset     = 'scikit'
self       = CMaker(cmake=CMake(version=<Version('4.1.0')>, cmake_path=WindowsPath('C:/hostedtoolcache/windows/Python/3.12.10/x64/L...dmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/popen-gw3/test_cmake_defines_True_0/build/.cmake/api/v1/reply'))

src\scikit_build_core\cmake.py:275: FailedLiveProcessError
---------------------------- Captured stdout call -----------------------------
loading initial cache file C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\popen-gw3\test_cmake_defines_True_0\build\CMakeInit.txt
-- Configuring incomplete, errors occurred!
---------------------------- Captured stderr call -----------------------------
CMake Error at CMakeLists.txt:2 (project):
  Generator

    Ninja

  does not support platform specification, but platform

    x64

  was specified.

I believe that we are trying to pass the msvc generator here for which we also pass --config flags, but CMake is then failing when trying to run with the preset generator even though we are overwriting it. Or could be an even simpler issue. I don't have a windows machine to live-test this though, so best I could do is print-debug this

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

Successfully merging this pull request may close these issues.

3 participants