abseil / abseil/abseil-cpp

[Bug]: test build issues in LTS 20220623.1

Đang mở
#1,359 2 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

When trying to run `bazel test @com_google_absl://...`, I encountered two build issues:
### `absl/hash/hash_test.cc`
```
external/com_google_absl/absl/hash/hash_test.cc: In instantiation of 'struct {anonymous}::IsAggregateInitializable >':
external/com_google_absl/absl/hash/hash_test.cc:909:3: required from here
external/com_google_absl/absl/hash/hash_test.cc:884:22: error: use of deleted function 'absl::lts_20220623::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from external/com_google_absl/absl/hash/hash.h:85,
from external/com_google_absl/absl/hash/hash_test.cc:15:
external/com_google_absl/absl/hash/internal/hash.h:1208:3: note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
external/com_google_absl/absl/hash/hash_test.cc:884:22: error: use of deleted function 'absl::lts_20220623::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from external/com_google_absl/absl/hash/hash.h:85,
from external/com_google_absl/absl/hash/hash_test.cc:15:
external/com_google_absl/absl/hash/internal/hash.h:1208:3: note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
```
This problem only seems to occur when building with `-std=gnu++17`. The line in question has a comment about GCC since version 9, so it's possible that GCC version 8 with `gnu++17` has the same problem.

### `absl/flags/flag_benchmark.cc`
Long error spew, but all coming from the same line:
```
external/com_google_absl/absl/flags/flag_benchmark.cc:246:62: error: no matching function for call to 'DoNotOptimize(bool (&)())'
int odr##T = (benchmark::DoNotOptimize(AbslInvokeGetFlag##T), 1);
^
external/com_google_absl/absl/flags/flag_benchmark.cc:88:3: note: in expansion of macro 'InvokeGetFlag'
A(bool) \
^
external/com_google_absl/absl/flags/flag_benchmark.cc:248:1: note: in expansion of macro 'BENCHMARKED_TYPES'
BENCHMARKED_TYPES(InvokeGetFlag)
^~~~~~~~~~~~~~~~~
```
(rest omitted)

The master branch has a fix for this in 553491a54cdb842ab583942e1058cbdcedd32018 which references issue #1340

### Steps to reproduce the problem

First issue:
```
git checkout lts_2022_06_23
env CC=/usr/bin/gcc-8 bazel test --cxxopt=-std=gnu++17 //absl/hash/...
```
Second issue needs a newer version of benchmark; update WORKSPACE:
```bzl
http_archive(
name = "com_github_google_benchmark", # 2021-09-20T09:19:51Z
sha256 = "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7",
strip_prefix = "benchmark-1.7.1",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.7.1.tar.gz"],
)
```
Then build:
```
env CC=/usr/bin/gcc-8 bazel build //absl/flags/...
```

### What version of Abseil are you using?

`8c0b94e793a66495e0b1f34a5eb26bd7dc672db0` (`lts_2022_06_23, tag: 20220623.1`)

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

Ubuntu 18.04

### What compiler and version are you using?

```
Using built-in specs.
COLLECT_GCC=gcc-8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.4.0-1ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.4.0 (Ubuntu 8.4.0-1ubuntu1~18.04)
```

### What build system are you using?

bazel 6.0.0 and bazel 5.3.1

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