-
Notifications
You must be signed in to change notification settings - Fork 691
Java image .tar file is not generated in bazel-bin #2014
Comments
We have the same issue with |
This also affects the base |
I suspect this is an issue with transitions, possibly introduced in #1963 |
I don't believe See GoogleContainerTools/skaffold#7251 for an example. Please feel free to reopen if I'm missing something 😄 |
The tar output location has been changed and is no longer stable. The old docs were not updated at the time of the change and the result is confusing build breakages. Until the original behavior is added back (not clear that it will happen) the README should document the new behavior. See Issue bazelbuild#2014 for more info (this was closed as WAI), and [GoogleContainerTools PR#7251](GoogleContainerTools/skaffold#7251) for more context.
* Update README to account for new tar build output The tar output location has been changed and is no longer stable. The old docs were not updated at the time of the change and the result is confusing build breakages. Until the original behavior is added back (not clear that it will happen) the README should document the new behavior. See Issue #2014 for more info (this was closed as WAI), and [GoogleContainerTools PR#7251](GoogleContainerTools/skaffold#7251) for more context. * Update README.md add ".tar" to the query, it is needed!
For anyone stumbling on this, I was able to get a stable output path by copying the output: load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
# ...
container_image(
name = "my_image",
# ...
)
copy_file(
name = "my_image_archive",
src = ":my_image.tar",
out = "my_image_archive.tar",
is_executable = False,
allow_symlink = True,
) |
* Update README to account for new tar build output The tar output location has been changed and is no longer stable. The old docs were not updated at the time of the change and the result is confusing build breakages. Until the original behavior is added back (not clear that it will happen) the README should document the new behavior. See Issue bazelbuild#2014 for more info (this was closed as WAI), and [GoogleContainerTools PR#7251](GoogleContainerTools/skaffold#7251) for more context. * Update README.md add ".tar" to the query, it is needed!
Is this the official way to work around unstable .tar file? |
🐞 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 runbazel build //src/main/java/com/example/myproject:myproject.tar
it should create a tar file in bazel-bin, which isbazel-out/k8-fastbuild/bin
but instead, the tar is generated in the pathbazel-out/k8-fastbuild-ST-4a519fd6d3e4/bin
This is the console output
🔬 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:
Output of
bazel version
:Rules_docker version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: