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

CMake config broken in 1.8.4 #36

Closed
1 task done
pitrou opened this issue Jun 5, 2024 · 4 comments · Fixed by #37
Closed
1 task done

CMake config broken in 1.8.4 #36

pitrou opened this issue Jun 5, 2024 · 4 comments · Fixed by #37
Labels
bug Something isn't working

Comments

@pitrou
Copy link
Member

pitrou commented Jun 5, 2024

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

Following the upgrade from 1.8.3 to 1.8.4, the generated CMake config files now report version "0.0.0". See this diff between the two packages respective cmake directories:

--- benchmark-1.8.3-h59595ed_0/lib/cmake/benchmark/benchmarkConfigVersion.cmake	2023-09-01 12:34:25.000000000 +0200
+++ benchmark-1.8.4-hac33072_0/lib/cmake/benchmark/benchmarkConfigVersion.cmake	2024-05-24 00:22:23.000000000 +0200
@@ -9,19 +9,19 @@
 # The variable CVF_VERSION must be set before calling configure_file().
 
 
-set(PACKAGE_VERSION "1.8.3")
+set(PACKAGE_VERSION "0.0.0")
 
 if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
   set(PACKAGE_VERSION_COMPATIBLE FALSE)
 else()
 
-  if("1.8.3" MATCHES "^([0-9]+)\\.")
+  if("0.0.0" MATCHES "^([0-9]+)\\.")
     set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
     if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
       string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
     endif()
   else()
-    set(CVF_VERSION_MAJOR "1.8.3")
+    set(CVF_VERSION_MAJOR "0.0.0")
   endif()
 
   if(PACKAGE_FIND_VERSION_RANGE)
diff --color -r -u benchmark-1.8.3-h59595ed_0/lib/cmake/benchmark/benchmarkTargets.cmake benchmark-1.8.4-hac33072_0/lib/cmake/benchmark/benchmarkTargets.cmake
--- benchmark-1.8.3-h59595ed_0/lib/cmake/benchmark/benchmarkTargets.cmake	2023-09-01 12:34:39.106235700 +0200
+++ benchmark-1.8.4-hac33072_0/lib/cmake/benchmark/benchmarkTargets.cmake	2024-05-24 00:22:38.404825000 +0200
@@ -3,11 +3,11 @@
 if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
    message(FATAL_ERROR "CMake >= 2.8.0 required")
 endif()
-if(CMAKE_VERSION VERSION_LESS "2.8.3")
-   message(FATAL_ERROR "CMake >= 2.8.3 required")
+if(CMAKE_VERSION VERSION_LESS "2.8.12")
+   message(FATAL_ERROR "CMake >= 2.8.12 required")
 endif()
 cmake_policy(PUSH)
-cmake_policy(VERSION 2.8.3...3.25)
+cmake_policy(VERSION 2.8.12...3.27)
 #----------------------------------------------------------------
 # Generated CMake target import file.
 #----------------------------------------------------------------
@@ -70,10 +70,6 @@
   INTERFACE_LINK_LIBRARIES "benchmark::benchmark"
 )
 
-if(CMAKE_VERSION VERSION_LESS 2.8.12)
-  message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
-endif()
-
 # Load information for each installed configuration.
 file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/benchmarkTargets-*.cmake")
 foreach(_cmake_config_file IN LISTS _cmake_config_files)
@@ -87,9 +83,12 @@
 
 # Loop over all imported files and verify that they actually exist
 foreach(_cmake_target IN LISTS _cmake_import_check_targets)
-  foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
-    if(NOT EXISTS "${_cmake_file}")
-      message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
+  if(CMAKE_VERSION VERSION_LESS "3.28"
+      OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
+      OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
+    foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
+      if(NOT EXISTS "${_cmake_file}")
+        message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
    \"${_cmake_file}\"
 but this file does not exist.  Possible reasons include:
 * The file was deleted, renamed, or moved to another location.
@@ -98,8 +97,9 @@
    \"${CMAKE_CURRENT_LIST_FILE}\"
 but not all the files it references.
 ")
-    endif()
-  endforeach()
+      endif()
+    endforeach()
+  endif()
   unset(_cmake_file)
   unset("_cmake_import_check_files_for_${_cmake_target}")
 endforeach()
diff --color -r -u benchmark-1.8.3-h59595ed_0/lib/cmake/benchmark/benchmarkTargets-release.cmake benchmark-1.8.4-hac33072_0/lib/cmake/benchmark/benchmarkTargets-release.cmake
--- benchmark-1.8.3-h59595ed_0/lib/cmake/benchmark/benchmarkTargets-release.cmake	2023-09-01 12:34:25.000000000 +0200
+++ benchmark-1.8.4-hac33072_0/lib/cmake/benchmark/benchmarkTargets-release.cmake	2024-05-24 00:22:23.000000000 +0200
@@ -8,22 +8,22 @@
 # Import target "benchmark::benchmark" for configuration "release"
 set_property(TARGET benchmark::benchmark APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
 set_target_properties(benchmark::benchmark PROPERTIES
-  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbenchmark.so.1.8.3"
-  IMPORTED_SONAME_RELEASE "libbenchmark.so.1"
+  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbenchmark.so.0.0.0"
+  IMPORTED_SONAME_RELEASE "libbenchmark.so.0"
   )
 
 list(APPEND _cmake_import_check_targets benchmark::benchmark )
-list(APPEND _cmake_import_check_files_for_benchmark::benchmark "${_IMPORT_PREFIX}/lib/libbenchmark.so.1.8.3" )
+list(APPEND _cmake_import_check_files_for_benchmark::benchmark "${_IMPORT_PREFIX}/lib/libbenchmark.so.0.0.0" )
 
 # Import target "benchmark::benchmark_main" for configuration "release"
 set_property(TARGET benchmark::benchmark_main APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
 set_target_properties(benchmark::benchmark_main PROPERTIES
-  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbenchmark_main.so.1.8.3"
-  IMPORTED_SONAME_RELEASE "libbenchmark_main.so.1"
+  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbenchmark_main.so.0.0.0"
+  IMPORTED_SONAME_RELEASE "libbenchmark_main.so.0"
   )
 
 list(APPEND _cmake_import_check_targets benchmark::benchmark_main )
-list(APPEND _cmake_import_check_files_for_benchmark::benchmark_main "${_IMPORT_PREFIX}/lib/libbenchmark_main.so.1.8.3" )
+list(APPEND _cmake_import_check_files_for_benchmark::benchmark_main "${_IMPORT_PREFIX}/lib/libbenchmark_main.so.0.0.0" )
 
 # Commands beyond this point should not need to know the version.
 set(CMAKE_IMPORT_FILE_VERSION)

Installed packages

Doesn't seem relevant here.

Environment info

Ditto.

@pitrou pitrou added the bug Something isn't working label Jun 5, 2024
@pitrou
Copy link
Member Author

pitrou commented Jun 5, 2024

cc @xhochy @h-vetinari @kou

assignUser pushed a commit to apache/arrow that referenced this issue Jun 5, 2024
…1987)

### Rationale for this change

Work around bug in version 1.8.4 of the benchmark package: conda-forge/benchmark-feedstock#36

### Are these changes tested?

By regular CI jobs.

### Are there any user-facing changes?

No.

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
@h-vetinari
Copy link
Member

Should be easy to backport google/benchmark@d77b692 - can you open a PR?

vibhatha pushed a commit to vibhatha/arrow that referenced this issue Jun 5, 2024
…ache#41987)

### Rationale for this change

Work around bug in version 1.8.4 of the benchmark package: conda-forge/benchmark-feedstock#36

### Are these changes tested?

By regular CI jobs.

### Are there any user-facing changes?

No.

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
kou added a commit to kou/benchmark-feedstock that referenced this issue Jun 6, 2024
@kou
Copy link
Contributor

kou commented Jun 6, 2024

Done: #37

@xhochy xhochy closed this as completed in #37 Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants