Skip to content

[Bug]: oci image using js_image_layer with remote exec fails to run #2152

Open
@Olsworn

Description

@Olsworn

What happened?

Hello!

First of all, thank you for the amazing work maintaining this repo :)

We tried to upgrade our repo to v2.3.3, but when we did so we noticed that our tests on our js images using rules_oci started breaking, but only when remote execution was used.

Version

Development (host) and target OS/architectures: linux arm64

Output of bazel --version: 8.1.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

bazel_dep(name = "aspect_rules_js", version = "2.3.3")
bazel_dep(name = "rules_oci", version = "2.2.5")

Language(s) and/or frameworks involved: javascript / oci

How to reproduce

With remote execution: build an image using js_image_layer as one of its tars.

Perhaps removing the "no-remote-exec" tag from https://github.com/aspect-build/rules_js/blob/main/e2e/js_image_oci/src/BUILD.bazel#L57 would highlight the error.

Any other information?

When inspecting the image, the package.json situated in our image would contain the content of the {js_image_layer_target_name}_launcher instead of its original content.
Leading to the following error SyntaxError: Error parsing /path/to/dir/etc/package.json Unexpected token '#', "#!/usr/bin"... is not valid JSON.

After some investigation we narrowed it down to the js_image_layer rule. It would only start working again when setting the no-remote-exec tag.

We tracked down the last working commit to fff00b6

So we believe the bug was introduced in #2130, this PR also adds a no-remote-exec to the js_image_layer of the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed: investigationInvestigation required to proceed further

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions