question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Instructions for Bazel do not work

See original GitHub issue

Following the instructions in the main readme for Bazel do not work.

I am getting this:

ERROR: Analysis of target '//:Main' failed; build aborted: no such package '@com_google_dagger//': BUILD file not found on package path

WORKSPACE:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_google_dagger",
    urls = ["https://github.com/google/dagger/archive/dagger-2.21.zip"],
)

maven_jar(
    name = "org_json",
    artifact = "org.json:json:20141113",
)

maven_jar(
    name = "com_google_guava_guava",
    artifact = "com.google.guava:guava:21.0",
    sha1 = "3a3d111be1be1b745edfa7d91678a12d7ed38709",
)

maven_jar(
    name = "com_google_guava_guava_testlib",
    artifact = "com.google.guava:guava-testlib:21.0-rc1",
    sha1 = "13f0f0dce4e710bb0bb791bd07f6e9858670a865",
)

BUILD:

java_binary(
    name = "Main",
    srcs = 
        glob(["src/**/*.java"]),
    deps = [
        "@org_json//jar",
        "@com_google_guava_guava//jar",
        "@com_google_dagger//:dagger_with_compiler",
    ]
)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
davidsantiagocommented, Apr 24, 2020

I think this issue should be reopened. The instructions on the readme for using Dagger with Bazel are still as the original poster described, and they still produce the same results when you try to follow them.

The instructions that were added by @ronshapiro at https://github.com/google/dagger/issues/1422#issuecomment-483740264 as the reason for closing this issue appear to be for setting up your development environment for hacking on dagger itself, not for using it in another project.

The instructions posted by @mancini0 at https://github.com/google/dagger/issues/1422#issuecomment-513581156 do appear to work, so if there is no way to update the instructions in the current readme so that they do work, maybe they should be changed to follow the alternate approach his example lays out.

1reaction
bcorsocommented, Jun 2, 2020

@austince, coincidentally, we’re working on this now. I’ll update the docs once this is in.

We’ll be using rules_jvm_external/maven_install for the macro, but that should just be an implementation detail for users calling the macro.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commands and Options | Bazel
This page covers the options that are available with various Bazel commands, such as bazel build , bazel run , and bazel test...
Read more >
User's Guide - Bazel 0.21.0
A User's Guide to Bazel. To run Bazel, go to your base workspace directory or any of its subdirectories and type bazel ....
Read more >
Rules Tutorial | Bazel
"bzl file evaluation" is printed first. Before evaluating the BUILD file, Bazel evaluates all the files it loads. If multiple BUILD files are...
Read more >
User Manual - Bazel 0.17.1
When running bazel , the client first checks that the server is the appropriate version; if not, the server is stopped and a...
Read more >
Command-Line Reference | Bazel
If set to true, the top level aspect will honor its required providers and only run on top level targets whose rules' advertised...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found