← All tasks
cppfmtlib/fmt #4011Repaired task

Not possible to fetch fmt with CMake

envgap__fmtlib__fmt-4011

01 / FAILURE SIGNATURE

Captured in a clean container

-- CMake version: 3.22.1

02 / ENVIRONMENT RECIPE

Base commit
3e3062c13bab7973d93e900c56823c9baf8e8291
Manifest
CMakeLists.txt
Reproduce
cmake -S . -B build -DBUILD_TESTING=OFF && cmake --build build -j4
Run under trace
cmake --build build -j4
Reference environment fix used for admission
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6763e7a9..14ce361a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -403,13 +403,19 @@ if (FMT_INSTALL)
 
   set(INSTALL_TARGETS fmt fmt-header-only)
 
+  if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND CMAKE_GENERATOR STREQUAL "Ninja")
+    set(INSTALL_FILE_SET FILE_SET fmt DESTINATION "${FMT_INC_DIR}/fmt")
+  else()
+    set(INSTALL_FILE_SET)
+  endif()
+
   # Install the library and headers.
   install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
           LIBRARY DESTINATION ${FMT_LIB_DIR}
           ARCHIVE DESTINATION ${FMT_LIB_DIR}
           PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt"
-          FILE_SET fmt DESTINATION "${FMT_INC_DIR}/fmt"
-          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+          ${INSTALL_FILE_SET})
 
   # Use a namespace because CMake provides better diagnostics for namespaced
   # imported targets.

03 / ORIGINAL ISSUE TEXT

fmtlib/fmt #4011 · read the original issue
After #3998 fetching fmt with CMake fails with the following error:

```

CMake Error at build_/_deps/fmt-src/CMakeLists.txt:407 (install):

install TARGETS given unknown argument "FILE_SET".

```



CMake section to reproduce

```

 FetchContent_Declare(fmt

        GIT_REPOSITORY https://github.com/fmtlib/fmt.git

        GIT_TAG master

    )

 FetchContent_MakeAvailable(fmt)

```

Continue on GitHub ↗

04 / LABELS

Labels checked by running the task · needs human review

misspecification
Label rules and the text that matched
[
  {
    "category": "misspecification",
    "rule": "diff.changes_existing_manifest_line",
    "source": "manifest_diff:CMakeLists.txt",
    "excerpt": "-          FILE_SET fmt DESTINATION \"${FMT_INC_DIR}/fmt\"\n-          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})\n+  if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND CMAKE_GENERATOR STREQUAL \"Ninja\")\n+    set(INSTALL_FILE_SET FILE_SET fmt DESTINATION \"${FMT_INC_DIR}/fmt\")\n+  else()\n+    set(INSTALL_FILE_SET)\n+  endif()\n+\n+          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n+          ${INSTALL_FILE_SET})"
  }
]

Mined from a merged pull request linked to the issue whose changed files are all environment files.

The base commit is the pull request's base, not the dated default-branch commit; the registry is pinned to the merge date so the pull request's own pins resolve.

Default commands from envgap default-recipe synthesizer v1; gold_files are the pull request's environment diff.

Preparation uses current registries. Historical package availability is not enforced here; execution metadata records this limitation separately from the oracle's date-bounding policy.