Skip to content

Bug from 1.9.6 to 2.1.9 when using a genrule to execute a kt_jvm_binary #1377

@dnkoutso

Description

@dnkoutso

We are seeing a bug that could be related to our repo configuration.

Its a bit difficult to provide a sample from our monorepo but here's the gist:

    kt_jvm_binary(
        name = name + "_swiftpoetgen_kt",
        srcs = srcs,
        main_class = main_class,
        deps = ["@maven//:io_outfoxx_swiftpoet"],
    )

    genrule(
        name = name + "_swiftpoetgen.swift",
        srcs = [],
        outs = outs,
        cmd = "$(location {}) $(OUTS)".format(name + "_swiftpoetgen_kt"),
        tools = [name + "_swiftpoetgen_kt"],
    )

Invoking this in 1.9.6 we see the launcher script template with:

# Set JAVABIN to the path to the JVM launcher.
JAVABIN=external/rules_java~~toolchains~local_jdk/bin/java

which works correctly but with 2.1.x:

# Set JAVABIN to the path to the JVM launcher.
JAVABIN=../rules_java~~toolchains~local_jdk/bin/java

This ends up failing with this error message:

line 409: exec: /<redacted>/_main/../rules_java~~toolchains~remotejdk11_macos_aarch64/bin/java: cannot execute: No such file or directory

Could it be related to #1244?

Thanks in advance!

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