Skip to content

Java image .tar file is not generated in bazel-bin #2014

@juanmarin-co

Description

@juanmarin-co

🐞 bug report

Affected Rule

java_image

Is this a regression?

Yes, it works well on v0.22.0

Description

I have a java_image target, the label is //src/main/java/com/example/myproject, if I run bazel build //src/main/java/com/example/myproject:myproject.tar it should create a tar file in bazel-bin, which is bazel-out/k8-fastbuild/bin but instead, the tar is generated in the path bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin

This is the console output

INFO: Analyzed target //src/main/java/com/example/myproject:myproject.tar (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //src/main/java/com/example/myproject:myproject.tar up-to-date:
  bazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin/src/main/java/com/example/myproject/myproject.tar
INFO: Elapsed time: 0.084s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

🔬 Minimal Reproduction

Clone https://github.com/juanpmarin/bazel-java-image-bug
Run bazel build //src/main/java/com/example/myproject:myproject.tar

🌍 Your Environment

Operating System:

  
Fedora 35
  

Output of bazel version:

  
Bazelisk version: v1.11.0
Build label: 5.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jan 19 14:08:54 2022 (1642601334)
Build timestamp: 1642601334
Build timestamp as int: 1642601334
  

Rules_docker version:

  
0.23.0
  

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions