Skip to content

@bazel_tools//third_party/jarjar was removed #7767

Closed

Description

@brettchabot

Description of the problem / feature request:

androidx.test (github/android/android_test) is broken HEAD with bazel 0.23.2 with the following error:
Step #2: ERROR: /workspace/ext/junit/java/androidx/test/ext/junit/BUILD.bazel:38:1: no such package '@bazel_tools//third_party/jarjar': BUILD file not found on package path and referenced by '//ext/junit/java/androidx/test/ext/junit:junit_release_jarjared'

It looks like @bazel_tools//third_party/jarjar has moved.

I chatted with @jin , he suggested filing an issue since this is a breaking change

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

See https://github.com/android/android-test/blob/master/CONTRIBUTING.md
bazel build :axt_m2repository

What operating system are you running Bazel on?

linux

What's the output of bazel info release?

release 0.23.2

Any other information, logs, or outputs that you want to share?

Activity

  1. added
    team-Rules-Java
    untriaged
    on Mar 19, 2019
  2. jin commented on Mar 19, 2019

    @jin
    Member

    @iirina could you take a look please?

  3. steeve commented on Mar 19, 2019

    @steeve
    Contributor

    You can use a newer version of jarjar with the following repos/build targets:

    JCENTER = "http://jcenter.bintray.com"
    jvm_maven_import_external(
        name = "com_google_jarjar",
        licenses = ["notice"],
        artifact = "org.pantsbuild:jarjar:1.6.6",
        artifact_sha256 = "965ab4c68b7ff6164841d7034cf5b0d5397205e35903c372db981a3660ad72f1",
        server_urls = [JCENTER],
        deps = [
            "@org_ow2_asm_asm",
        ],
    )
    jvm_maven_import_external(
        name = "org_ow2_asm_asm",
        licenses = ["notice"],
        artifact = "org.ow2.asm:asm:6.2",
        server_urls = [JCENTER],
        deps = [
            "@org_ow2_asm_asm_commons",
        ],
    )
    jvm_maven_import_external(
        name = "org_ow2_asm_asm_commons",
        licenses = ["notice"],
        artifact = "org.ow2.asm:asm-commons:6.2",
        server_urls = [JCENTER],
    )
    
    
    java_binary(
        name = "jarjar",
        create_executable = True,
        main_class = "org.pantsbuild.jarjar.Main",
        visibility = ["//visibility:public"],
        runtime_deps = [
            "@com_google_jarjar",
        ]
    )
  4. added
    P1
    and removed
    untriaged
    on Mar 20, 2019
  5. iirina commented on Mar 20, 2019

    @iirina
    Contributor

    @brettchabot indeed jarjar was moved out of the bazel binary as part of the effort to move the Java tools to a remote repository. I'll send a PR to re-add the targets, but they will refrence JarJar from the remote tools.

  6. added a commit that references this issue on Mar 21, 2019
    607d78d
  7. steeve commented on Aug 22, 2019

    @steeve
    Contributor

    @iirina what is the new target one should use ?

  8. iirina commented on Aug 22, 2019

    @iirina
    Contributor

    @steeve you can use @remote_java_tools_linux//:JarJar

  9. steeve commented on Aug 22, 2019

    @steeve
    Contributor

    @iirina it seems on my machine (macos) it's @remote_java_tools_darwin//:JarJar. It makes it hard to depend on since the repo name has the os inside :(

  10. iirina commented on Aug 22, 2019

    @iirina
    Contributor

    You can add an alias if you want:

    alias(
        name = JarJar,
       actual =  select({
            "@bazel_tools//src/conditions:linux_x86_64": ["@remote_java_tools_linux//:JarJar"],
            "@bazel_tools//src/conditions:darwin": ["@remote_java_tools_darwin//:JarJar"],
            "@bazel_tools//src/conditions:darwin_x86_64": ["@remote_java_tools_darwin//:JarJar"],
            "@bazel_tools//src/conditions:windows": ["@remote_java_tools_windows//:JarJar"],
            # Any repository can be used.
            "@bazel_tools//conditions:default": ["@remote_java_tools_linux//:JarJar"],
        })
    )
    

    or use any of the repos since JarJar is a deploy jar and is platform agnostic:

    alias(
        name = "JarJar",
        actual = "@remote_java_tools_darwin//:JarJar"
    )
    
  11. steeve commented on Aug 22, 2019

    @steeve
    Contributor

    That's great thank you !

  12. uajith commented on Jan 22, 2024

    @uajith

    @steeve you can use @remote_java_tools_linux//:JarJar

    @iirina , I am not able to see the JarJar target now. I can see only the below

    jenkins@bazel5-d57575cd6-sdxvb:/repo$ tools/bazel query "@remote_java_tools_linux//:*"
    Another command (pid=29262) is running. Waiting for it to complete on the server (server_pid=9187)...
    @remote_java_tools_linux//:BUILD
    @remote_java_tools_linux//:ijar_prebuilt_binary
    @remote_java_tools_linux//:java_tools/ijar/ijar
    @remote_java_tools_linux//:java_tools/ijar/ijar.exe
    @remote_java_tools_linux//:java_tools/src/tools/singlejar/singlejar_local
    @remote_java_tools_linux//:java_tools/src/tools/singlejar/singlejar_local.exe
    @remote_java_tools_linux//:prebuilt_singlejar
    @remote_java_tools_linux//:windows
    Loading: 1 packages loaded
    jenkins@bazel5-d57575cd6-sdxvb:
    /repo$

    Did this get moved somewhere else?
    I am using bazel 6.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1team-Rules-Java

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions