Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: rules_java 7.12.1: deploy jar not provided for tests #230

Closed
tpasternak opened this issue Oct 16, 2024 · 7 comments
Closed

Release: rules_java 7.12.1: deploy jar not provided for tests #230

tpasternak opened this issue Oct 16, 2024 · 7 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) release

Comments

@tpasternak
Copy link

The project:

BUILD.bazel:

load("@rules_java//java:defs.bzl", "java_test")

java_test(
    name = "test",
    srcs = ["Test.java"],
    test_class = "Test",
    deps = [],
)

MODULE.bazel

bazel_dep(name = "rules_java", version = "7.12.1")

Test.java

public class Test {
    public static void main(String[] args) {

    }
}

Scenario

run bazel build :test

Expected result:

test_deploy.jar is built (doc: https://bazel.build/reference/be/java#java_test_implicit_outputs)

Actual result:

only test.jar is built

References

bazelbuild/intellij#6895

@tpasternak tpasternak added P1 I'll work on this now. (Assignee required) release labels Oct 16, 2024
@mai93
Copy link

mai93 commented Oct 16, 2024

@tpasternak are we still passing --experimental_java_test_auto_create_deploy_jar --output_groups=+_hidden_top_level_INTERNAL_ from plugin side, I see we had bazelbuild/intellij@a61a256 to fix fast test for Bazel 7.

@hvadehra is there something else we should add?

@tpasternak
Copy link
Author

Ok, I didn't know about the flag. We do pass it and it doesn't work

@tpasternak
Copy link
Author

oh, wait, there is this thing 071069d

@tpasternak
Copy link
Author

okay, fixed in 8.1.0

@hvadehra
Copy link
Member

Sorry for the breakage, this actually happened in Bazel in bazelbuild/bazel@364cc11

fwiw, I'm planning to backport the fix to rules_java 7.x as well.

hvadehra added a commit that referenced this issue Oct 17, 2024
See #230

PiperOrigin-RevId: 683574444
Change-Id: I4d1fe8e90392c37cc873ad97f079c9f3d9b401d5 (cherry picked from
commit 071069d)
@hvadehra
Copy link
Member

FYI rules_java 7.12.2 with the fix 071069d has been released and published to the BCR.

@tpasternak
Copy link
Author

Thank you @hvadehra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) release
Projects
None yet
Development

No branches or pull requests

5 participants