Skip to content

Obtaining output paths of the build artifacts #8739

@vitarb

Description

@vitarb

There seem to be no easy way of getting location of the artifacts built by bazel, which results in a lot of unnecessary complexity and potentially faulty assumptions in tooling that needs to access build artifacts.

Most difficulties arise from the fact that bazel adds various sub-folders in the output such as "external", "$platform_$arch_[stripped|opt]", "$target_name.runfiles", etc. which requires any tooling that needs to be able to find the location know information about the build target, environment and all bazel layout conventions.

Buck solved this problem by introducing buck targets --show-output command that prints location of each build target in the build output folder.

For example:

buck targets --show-output //java/com/myproject:binary
> //java/com/myproject:binary buck-out/gen/java/com/myproject/binary.apk

The only potential work-around that I was able to find was using bazel aquery as described here but it's not easy to use.

It would be nice to have equivalent in bazel, is there anything that prevents us from exposing this information as part of bazel query command?

Can we have bazel query mytarget --show-output or other simple equivalent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)help wantedSomeone outside the Bazel team could own thisteam-PerformanceIssues for Performance teamstype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions