abseil / abseil/abseil-cpp

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

Đang mở
#1,973 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
18.1k
Fork
3.2k
Merge trung bình
20 giờ 36 phút
Pull request đã merge (30 ngày)
1

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.