Skip to content

[Bug]: js_image_layer is broken with bzlmod #1530

@thesayyn

Description

@thesayyn

What happened?

Currently, cross compiling js_image_layer through platform attribute is broken due to this line here where linux toolchains are not registered first like it is in the WORKSPACE version.

Version

Development (host) and target OS/architectures:

Output of bazel --version:

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

Language(s) and/or frameworks involved:

How to reproduce

When building the image from Darwin to Linux, the following BUILD will produce an image that contains nodejs interpreter for darwin instead of linux.


js_binary(
  name = ":binary"
)

platform(
  name = "linux_amd64",
  constraint_values = [
      "@platforms//os:linux",
      "@platforms//cpu:x86_64",
  ],
)

js_image_layer(
  name = name,
  binary = ":binary",
  platform = ":linux_amd64"
)

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions