abseil / abseil/abseil-cpp

[Bug]: Use of `ExactVersion` with CMake `write_basic_package_version_file` is unfortunate 😞

未關閉
#1,973 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
18.1k
分支
3.2k
平均合併
20 小時 36 分鐘
30 天內合併 PR
1

描述

### Describe the issue

Hi!

It has come to my attention that use of `ExactVersion` at…

https://github.com/abseil/abseil-cpp/blob/f751e6186da331d7a712256d4cdc5e812cdb60b7/CMakeLists.txt#L204-L207

…makes use of `find_package(absl 20240722.0 CONFIG REQUIRED)` in dependent build systems officially incompatible with any other major version like `20250512.1` when compiling against it and use of `find_package(absl CONFIG REQUIRED)` works fine in contrast against the very same system Abseil. That's rather unfortunate, e.g. because [it forbids Google Protobuf from requiring Abseil >=20240722.0 at build time](https://github.com/protocolbuffers/protobuf/issues/24374#issuecomment-3529189705) my conventional means. Is there a chance this could be re-considered in Abseil? Could you elaborate on the rationale behind this approach?

Thanks and best, Sebastian

CC @mkruskal-google

### Steps to reproduce the problem

```console
# cat CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(absl_dep_check)
find_package(absl 20240722.0 CONFIG REQUIRED)

# cmake .
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a configuration file for package "absl" that is compatible
with requested version "20240722.0".
^^^^^^^
The following configuration files were considered but not accepted:

/usr/lib64/cmake/absl/abslConfig.cmake, version: 20250512
^^^^^

-- Configuring incomplete, errors occurred!
```

### What version of Abseil are you using?

Git `master` (commit f751e6186da331d7a712256d4cdc5e812cdb60b7)

### What operating system and version are you using?

(Linux)

### What compiler and version are you using?

(GCC 15 + Clang 21)

### What build system are you using?

CMake

### Additional context

_No response_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。