[BUG] benchmark build errors when included as an external bazel project

オープン
#1,893 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
build-system

調査の方向性

MODULE の外部依存関係の設定とリポジトリの BUILD.bazel から始め、報告された http_archive 設定を使って bazel build @benchmark//:benchmark を再現します。不足している platforms リポジトリ参照と、プロジェクトの Bazel 使用手順を調査します。外部 :benchmark ターゲットが問題なくビルドされるか、文書化された Bazel モジュールレジストリの使用方法が提供されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

There are no instructions by the project about how to use it from a Bazel project, so the usual thing is to get it via http_archive, like this:

http_archive(
    name = "benchmark",
    strip_prefix = "benchmark-1.9.1",
    sha256 = "32131c08ee31eeff2c8968d7e874f3cb648034377dfc32a4c377fa8796d84981",
    urls = ["https://github.com/google/benchmark/archive/v1.9.1.tar.gz"],
)

However, included like this, benchmark doesn't build:

> bazel build @benchmark//:benchmark
ERROR: no such package '@@[unknown repo 'platforms' requested from @@+_repo_rules+benchmark]//os': The repository '@@[unknown repo 'platforms' requested from @@+_repo_rules+benchmark]' could not be resolved: No repository visible as '@platforms' from repository '@@+_repo_rules+benchmark'
ERROR: /home/debian/.cache/bazel/_bazel_debian/dd361b7f393c74ecd4bce5d0457e94c7/external/+_repo_rules+benchmark/BUILD.bazel:29:15: no such package '@@[unknown repo 'platforms' requested from @@+_repo_rules+benchmark]//os': The repository '@@[unknown repo 'platforms' requested from @@+_repo_rules+benchmark]' could not be resolved: No repository visible as '@platforms' from repository '@@+_repo_rules+benchmark' and referenced by '@@+_repo_rules+benchmark//:windows'
ERROR: /home/debian/.cache/bazel/_bazel_debian/dd361b7f393c74ecd4bce5d0457e94c7/external/+_repo_rules+benchmark/BUILD.bazel:52:11: errors encountered resolving select() keys for @@+_repo_rules+benchmark//:benchmark
ERROR: Analysis of target '@@+_repo_rules+benchmark//:benchmark' failed; build aborted
INFO: Elapsed time: 0.084s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

System
Which OS, compiler, and compiler version are you using:

  • OS: Linux debian 6.10.6+bpo-arm64 #1 SMP Debian 6.10.6-1~bpo12+1 (2024-08-26) aarch64 GNU/Linux
  • Compiler and version: bazel 8.0.0

To reproduce
Steps to reproduce the behavior:

  1. Set up a project with Bazel and include the dependency above in your MODULE
  2. Try to build the :benchmark target, as show above

Expected behavior
Ideally, you should have instructions about how to use this project with Bazel, and they should probably involve publishing to the module registry.

Absent that, the project should build cleanly when included as an external dependency.

主要言語
C++
スター
10.5k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/benchmark のほかの issue

google/benchmark の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。