scikit-build-core: Some tests on Windows fail with ProcessNotRegisteredError

When building the package for conda, the following tests in tests/test_cmake_config.py fail on Windows:

  1. test_cmake_paths
  2. test_init_cache
  3. test_cmake_args

at

config.configure()

with error ProcessNotRegisteredError:

Running e.g.:

pytest -vv -ra --showlocals -k "test_cmake_args"
...
            if not cls.process_list[-1]._allow_unregistered:
>               raise exceptions.ProcessNotRegisteredError(
                    "The process '%s' was not registered."
                    % (
                        command
                        if isinstance(command, str)
                        else " ".join(str(item) for item in command),
                    )
                )
E               pytest_subprocess.exceptions.ProcessNotRegisteredError: The process '%PREFIX%\Library\bin\cmake.EXE -S%SRC_DIR%\tests\packages\simple_pure -BC:\Users\buildu.

cls        = <class 'pytest_subprocess.process_dispatcher.ProcessDispatcher'>
command    = ['C:\\Users\\builidusername\\miniconda3\\envs\\c3i\\conda-bld\\scikit-build-core_1722583656353\\_test_env\\Library\\bin\\cmake.EXE',
 '-SC:\\Users\\builidusername\\miniconda3\\envs\\c3i\\conda-bld\\scikit-build-core_1722583656353\\test_tmp\\tests\\packages\\simple_pure',
 '-BC:\\Users\\builidusername\\AppData\\Local\\Temp\\pytest-of-builidusername\\pytest-86\\test_cmake_args0\\build',
 '-DCMAKE_BUILD_TYPE:STRING=Release',
 '-DSOMETHING=one']
command_instance = None
process_instance = None
processes  = None
...

full log: scikit-build-core-0.9.9-pytest.log

Something is not working with the parameters in the registration of the commands here:

https://github.com/scikit-build/scikit-build-core/blob/715777d94d57ab0f9ae158f8690d609356a69753/tests/test_cmake_config.py#L140

https://github.com/scikit-build/scikit-build-core/blob/715777d94d57ab0f9ae158f8690d609356a69753/tests/test_cmake_config.py#L110

https://github.com/scikit-build/scikit-build-core/blob/715777d94d57ab0f9ae158f8690d609356a69753/tests/test_cmake_config.py#L56

as a test, if I replace *cmd with fp.any() to ignore the parameters, the registration works and the three tests pass.

On other platforms (linux, darwin) these three tests pass.

I could not determine if it was a \\ problem or something else.

scikit-build-core version: 0.9.9 or 0.9.8 Python: 3.8 to 3.11 Windows: 11 pytest-subprocess: 1.5.0 cmake: 3.26.4 Compiler: vs2019 win-64

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I think we probably should monkeypatch the test to remove the envvar. If it’s important, we could also make a new or parameterized test with the envvar set. You generally don’t want a test to depend on the environment and run differently.