bazelbuild / bazelbuild/bazel

Building a target with a Bazel aspect overwrites the Target command line printout

Open
#10,530 1 comment 1 reaction 0 assignees View on GitHub
help wanted team-Core type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the problem / feature request:

Building a target with a Bazel aspect overwrites the Target command line
printout. The Target printout previously contained information such as the
path to the generated build artifact.

For example:
```
$ bazel build :grpc_health_v1_proto --aspects=//rules:proto_linter.bzl%proto_linter_aspect --output_groups=+proto_lint_out

INFO: Writing tracer profile to
...
INFO: Found 1 target...
Target //idl/x/go/health/proto:grpc_health_v1_proto up-to-date:
bazel-bin/idl/x/go/health/proto/grpc_health_v1_proto-descriptor-set.proto.bin
INFO: Elapsed time: 0.582s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
```

Has a different command line output then
```
$ bazel build :grpc_health_v1_proto

INFO: Writing tracer profile to
...
INFO: Found 1 target...
Aspect //rules:proto_linter.bzl%proto_linter_aspect of //idl/x/go/health/proto:grpc_health_v1_proto up-to-date:
bazel-bin/idl/xl/go/health/proto/grpc_health_v1_proto.protolint_result
INFO: Elapsed time: 0.493s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
```

The path to the aspect build artifact is printed, but the original build artifact path is lost.

I believe this issue is related to this [logic](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java;bpv=;l=81 l) in Bazel.

### Feature requests: what underlying problem are you trying to solve with this feature?

Building a Bazel target with an aspect should preserve the build target output message.

### What operating system are you running Bazel on?

darwin18.0

### What's the output of `bazel info release`?

release 1.1.0

### Have you found anything relevant by searching the web?

I haven't found a relevant discussion online as of yet.

I believe this issue is related to this [logic](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java;bpv=;l=81 l) in Bazel.

Contributor guide

Open the contributing guide

Research direction

Start in src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java and reproduce the reported bazel build with the proto_linter aspect and output group. Compare its output with a build without the aspect; done means the aspect artifact is printed without losing the original target artifact path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.