cabal benchmark bytestring:包没有基准

cabal benchmark bytestring: package has no benchmark

当我在 bytestring 上尝试 运行 cabal benchmark 时,我得到了 package has no benchmark。实际上,.cabal 文件没有基准配置。但是 repo 确实有一个 bench 目录。这是如何运作的?我不应该尝试对它进行基准测试吗?

编辑:

当 运行ning cabal buildbench 目录中时,出现以下错误:

Building bench-bytestring-0.1.0.0...
Preprocessing executable 'bench-bytestring-builder' for
bench-bytestring-0.1.0.0...
[18 of 18] Compiling Main ( BenchAll.hs, dist/build/bench-bytestring-builder/bench-bytestring-builder-tmp/Main.o )

BenchAll.hs:133:46:
Couldn't match expected type ‘Benchmarkable’
            with actual type ‘IO ()’
In the second argument of ‘($)’, namely ‘benchIntEncodingB nRepl e’
In the expression:
  bench (name ++ " (" ++ show nRepl ++ ")")
  $ benchIntEncodingB nRepl e

bench 目录有一个单独的 Cabal 文件,bench-bytestring.cabal。您应该能够 cd 进入该目录并执行 cabal run 到 运行 基准测试。

该软件包的描述解释了它以这种方式工作的原因:

This package is not meant for public release. It fixes a problem with the current benchmarking support in cabal, which has trouble compiling because criterion depends on bytestring. Here, we just include the whole source of the bytestring library directly.