http://bazel.io/docs/getting-started.html errors?

14 views
Skip to first unread message

A O Van Emmenis

unread,
Mar 19, 2016, 2:32:33 PM3/19/16
to bazel-discuss
mkdir src/main/java/com/example/cmdline
should be 
mkdir -p src/main/java/com/example/cmdline
This command
bazel build //src/main/java/com/example/cmdline:runner
seems to be wrong:

~/p/b/e/cmdline % bazel build //src/main/java/com/example/cmdline:runner

ERROR: no such package 'src/main/java/com/example/cmdline': BUILD file not found on package path

INFO: Elapsed time: 0.088s

This seemed to give the expected result:

~/p/b/e/cmdline % bazel build //cmdline:runner

ERROR: /Users/aove215/projects/bazel/ex1/cmdline/BUILD:2:1: Target '//:greeter' is not visible from target '//cmdline:runner'. Check the visibility declaration of the former target if you think the dependency is legitimate.

ERROR: Analysis of target '//cmdline:runner' failed; build aborted.

INFO: Elapsed time: 0.334s




Thiago Farina

unread,
Mar 20, 2016, 12:30:09 PM3/20/16
to A O Van Emmenis, bazel-discuss
On Sat, Mar 19, 2016 at 3:32 PM, A O Van Emmenis <aov...@gmail.com> wrote:
mkdir src/main/java/com/example/cmdline
should be 
mkdir -p src/main/java/com/example/cmdline
Looks like you are right about this. I will submit a patch for this.
 
This command
bazel build //src/main/java/com/example/cmdline:runner
seems to be wrong:
This does not look wrong to me.

Have you added the BUILD file to //src/main/java/com/example/cmdline directory?

If you have it then it probably should work, no? 

~/p/b/e/cmdline % bazel build //src/main/java/com/example/cmdline:runner

ERROR: no such package 'src/main/java/com/example/cmdline': BUILD file not found on package path

That is what I say above, you need to create the BUILD file in this cmdline directory and declare the java_binary there.

--
Thiago Farina
Reply all
Reply to author
Forward
0 new messages