Open prestonvanloon opened 5 years ago
ctx.bin_dir
is not a file, but is a root: https://docs.bazel.build/versions/master/skylark/lib/ctx.html#bin_dir
Is there an example of rust_benchmark
? I don't think this rule works at all.
Found the example. To reproduce this, run bazel build //fibonacci:fibonacci_bench
from the examples directory.
The benchmark example is skipped for CI because we're running with stable. iirc you are running with nightly, which is a requirement for benchmarks to run at all (ie. the bazel build
invocation implies a nightly toolchain).
I would fully believe that either or both:
I think this is a starlark code bug, not nightly rust issue
Build label: 0.25.3
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu May 23 19:25:07 2019 (1558639507)
Build timestamp: 1558639507
Build timestamp as int: 1558639507
Running bazel build
on a test benchmark actually runs the benchmark?
Wouldn't it be more idiomatic to run the test on bazel test
?
I'm saying that benchmarks require nightly, which is why the starlark code is untested and likely broken.
bazel build
should build the benchmark + wrapper script, bazel run
should run the benchmark. It was a test before, but having a benchmark do a bunch of not-actually-a-test work seemed inappropriate.
Is there a solution? The rule seems to be completely broken as of Bazel 4.0.0
https://github.com/bazelbuild/rules_rust/blob/adccbbad58411657102ab8168aee7c5f4ff3af4c/rust/private/rust.bzl#L200-L204