You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... build app, package to tar, transition binary
oci_load(
name = "load",
image = ":transitioned_image",
repo_tags = "tags.txt",
)
When I run bazel run @libA//:load, the command fails with the error:
tar: Error reading archive -: Can't open external/libA+/image/blobs/sha256/d057aa77ea6c6e060f84c1bbe1a261478509b8d0f11bdbbd3ca6a5a3bbd1e2d0
tar: Error exit delayed from previous errors.
open /var/lib/docker/tmp/docker-import-1307345443/repositories: no such file or directory
If I run bazel run //:load inside libA dir, it runs fine. I can also run the app from the root directory without any issues. It's only the image creation that fails.
I suspect the '+' symbol in the name is causing some problems for the tar command.
So the oci_load() does not work when used with external dependencies. Any workarounds/fixes?
The text was updated successfully, but these errors were encountered:
: manifest_root, image_root and workspace_name are not working with running oci_load defined in different module / repository.
Suppose we have a workspace / module named "main" and it imports "other" that has @other//path:my_oci_load
The following are the problems:
ctx.workspace_name seems to always returns the name of "main" workspace. But we would want "other"
file.root.path returns the root of all outputs - lets say "/path/to/my/root"
But whole path of file from @other//path:target is /path/to/my/root/external/other/path/target. For targets in "main" it would be /path/to/my/root/main/path/target (No external prefix)
In the end, the load executable would not strip enough from the path and then go into wrong directory ($RUNFILES_DIR/main, while it should go to $RUNFILES_DIR/other)
I am not sure what is the best solution here, but I generally tend to use file.short_path to distinguish between these two cases (if short path starts with .. -> this is external repository and next directory is a workspace name. Not sure if this is the "clean" solution though.
I have 2 bazel modules. One at the root and the other in a sub directory. Example:
In the root MODULE.bazel I have:
And libA's BUILD file has:
When I run
bazel run @libA//:load
, the command fails with the error:If I run
bazel run //:load
inside libA dir, it runs fine. I can also run the app from the root directory without any issues. It's only the image creation that fails.I suspect the '+' symbol in the name is causing some problems for the
tar
command.So the oci_load() does not work when used with external dependencies. Any workarounds/fixes?
The text was updated successfully, but these errors were encountered: