Repository: scikit-build/scikit-build-core
Pull request #639 (2024-02-14 15:20:00)

Make run command logged at info
From #629 

Maybe this level should be split for more granularity like:
- `status` for messages that should always be outputted like when it enters a `configure`/`build` stage, etc.
- `info` for tracing basic execution, like in this case what commands are run

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/scikit-build/scikit-build-core/pull/639?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`cdeb832`)](https://app.codecov.io/gh/scikit-build/scikit-build-core/commit/cdeb8320d65a21361ff6dc725223658b2873afcd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) 86.23% compared to head [(`1259d18`)](https://app.codecov.io/gh/scikit-build/scikit-build-core/pull/639?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build) 86.23%.


<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main     #639   +/-   ##
=======================================
  Coverage   86.23%   86.23%           
=======================================
  Files          63       63           
  Lines        3233     3233           
=======================================
  Hits         2788     2788           
  Misses        445      445           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/scikit-build/scikit-build-core/pull/639?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-build).

LecrisUT: Nvm the rawhide failure. F40 just branched today so it might take some time to recover

Patch:
diff --git a/src/scikit_build_core/_shutil.py b/src/scikit_build_core/_shutil.py
index 9c67bed..46fce89 100644
--- a/src/scikit_build_core/_shutil.py
+++ b/src/scikit_build_core/_shutil.py
@@ -66,7 +66,7 @@ class Run:
                 logger.debug("RUNENV - changes since last run only:\n  {}", msg)
                 type(self)._prev_env = self.env.copy()
 
-        logger.debug("RUN: {}", " ".join(options))
+        logger.info("RUN: {}", " ".join(options))
 
         return subprocess.run(
             options,
diff --git a/src/scikit_build_core/cmake.py b/src/scikit_build_core/cmake.py
index 1f73a8d..762b5ae 100644
--- a/src/scikit_build_core/cmake.py
+++ b/src/scikit_build_core/cmake.py
@@ -178,9 +178,6 @@ class CMaker:
         if self.init_cache_file.is_file():
             yield f"-C{self.init_cache_file}"
 
-        if self.single_config and self.build_type:
-            yield f"-DCMAKE_BUILD_TYPE:STRING={self.build_type}"
-
         for key, value in defines.items():
             if isinstance(value, bool):
                 str_value = "ON" if value else "OFF"
@@ -214,6 +211,9 @@ class CMaker:
         if gen:
             self.single_config = gen == "Ninja" or "Makefiles" in gen
 
+        if self.single_config and self.build_type:
+            all_args.insert(2, f"-DCMAKE_BUILD_TYPE:STRING={self.build_type}")
+
         try:
             Run(env=self.env).live(self.cmake, *all_args)
         except subprocess.CalledProcessError:


Test patch:
diff --git a/tests/test_cmake_config.py b/tests/test_cmake_config.py
index d08f45e..3f8e25f 100644
--- a/tests/test_cmake_config.py
+++ b/tests/test_cmake_config.py
@@ -22,13 +22,13 @@ def configure_args(config: CMaker, *, init: bool = False) -> Generator[str, None
     yield f"-S{config.source_dir}"
     yield f"-B{config.build_dir}"
 
+    if config.single_config:
+        yield f"-DCMAKE_BUILD_TYPE:STRING={config.build_type}"
+
     if init:
         cmake_init = config.build_dir / "CMakeInit.txt"
         yield f"-C{cmake_init}"
 
-    if config.single_config:
-        yield f"-DCMAKE_BUILD_TYPE:STRING={config.build_type}"
-
 
 @pytest.mark.configure()
 def test_init_cache(fp, tmp_path):