Search code examples
javamaven-2vaticle-typedbvaticle-typeql

build aborted: no such package '@antlr4_tool//jar'


So I am trying to replicate the textmining usecase of biograkn in the biograkn repo. I am trying to migrate the data in schema, for which i was supposed to do bazel build. so i ran the following command:

bazel build //migrator:migrator-bin

inside the textmining folder of biograkn. Now, the build fails and I am getting error:

Here is the traceback

DEBUG: Rule 'io_bazel_rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1545256788 -0500"
DEBUG: Rule 'com_github_grpc_grpc' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1550231355 +0300"
DEBUG: Rule 'stackb_rules_proto' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1561665037 -0600"
DEBUG: Rule 'graknlabs_grakn_core' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1572870526 +0000"
DEBUG: Rule 'graknlabs_benchmark' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1571391871 +0100"
DEBUG: Rule 'graknlabs_graql' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1572870025 +0000"
DEBUG: Rule 'rules_antlr' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "397361a4d252a7186bc33add33144f4ede2a3899", shallow_since = "1559662328 +0200" and dropping ["tag"]
DEBUG: Rule 'graknlabs_client_python' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1569623464 +0000"
DEBUG: Rule 'graknlabs_bazel_distribution' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1572869706 +0300"
DEBUG: Rule 'com_github_google_bazel_common' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1551104077 +0300"
DEBUG: Rule 'graknlabs_protocol' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1572870033 +0000"
INFO: Call stack for the definition of repository 'antlr4_tool' which is a http_jar (rule definition at /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/bazel_tools/tools/build_defs/repo/http.bzl:347:12):
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/rules_antlr/antlr/deps.bzl:49:5
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/rules_antlr/antlr/deps.bzl:27:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:120:1
ERROR: An error occurred during the fetch of repository 'antlr4_tool':
   java.io.IOException: Error downloading [http://central.maven.org/maven2/org/antlr/antlr4/4.7.2/antlr4-4.7.2.jar] to /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/antlr4_tool/jar/downloaded.jar: Unknown host: central.maven.org
INFO: Call stack for the definition of repository 'remotejdk11_linux' which is a http_archive (rule definition at /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /DEFAULT.WORKSPACE.SUFFIX:199:1
INFO: Call stack for the definition of repository 'com_google_protobuf' which is a http_archive (rule definition at /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/bazel_tools/tools/build_defs/repo/http.bzl:229:16):
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:125:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:83:1
INFO: Call stack for the definition of repository 'com-google-protobuf-protobuf-java' which is a jar_artifact (rule definition at /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:40:16):
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:58:5
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:667:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:103:1
INFO: Call stack for the definition of repository 'org-apache-lucene-lucene-analyzers-common' which is a jar_artifact (rule definition at /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:40:16):
 - /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:58:5
 - /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:120:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:72:1
INFO: Call stack for the definition of repository 'io-netty-netty-all' which is a jar_artifact (rule definition at /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:40:16):
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:58:5
 - /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_grakn_core/dependencies/maven/dependencies.bzl:667:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:103:1
INFO: Call stack for the definition of repository 'edu-stanford-nlp-stanford-corenlp-java-models' which is a jar_artifact (rule definition at /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:40:16):
 - /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:58:5
 - /home/aditya/Projects/RD/biograkn/dependencies/maven/dependencies.bzl:120:9
 - /home/aditya/Projects/RD/biograkn/WORKSPACE:72:1
ERROR: /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/graknlabs_graql/grammar/BUILD:24:1: every rule of type antlr4 implicitly depends upon the target '@antlr4_tool//jar:jar', but this target could not be found because of: no such package '@antlr4_tool//jar': java.io.IOException: Error downloading [http://central.maven.org/maven2/org/antlr/antlr4/4.7.2/antlr4-4.7.2.jar] to /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/antlr4_tool/jar/downloaded.jar: Unknown host: central.maven.org
Documentation for implicit attribute deps of rules of type antlr4:

The dependencies to use. Defaults to the official ANTLR 4 release, but if
you need to use a different version, you can specify the dependencies here.

DEBUG: Rule 'graknlabs_common' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1572870041 +0000"
DEBUG: Rule 'graknlabs_client_java' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1570795516 +0000"
ERROR: Analysis of target '//migrator:migrator-bin' failed; build aborted: no such package '@antlr4_tool//jar': java.io.IOException: Error downloading [http://central.maven.org/maven2/org/antlr/antlr4/4.7.2/antlr4-4.7.2.jar] to /home/aditya/.cache/bazel/_bazel_aditya/1271badea2afdf63b6fcb04c93a3b0e2/external/antlr4_tool/jar/downloaded.jar: Unknown host: central.maven.org
INFO: Elapsed time: 7.458s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 0 targets configured)

I suspect its some antlr4 package issue on maven servers. How to resolve it, if there are any good workarounds?


Solution

  • Yes it looks like the link being depended upon is dead. You are trying to manually migrate the data yourself. To use BioGrakn in the most basic case, you can just download a pre-loaded set of data by following the link in the README/releases page.

    If you want to customise things or use it as a basis for your own work, and you want to use Bazel, then the dependencies in the WORKSPACE file should point to more recent commits the relevant repos. In general this repo needs an update.