local_repository name field must be a legal workspace name

182 views
Skip to first unread message

Przemek Lach

unread,
May 14, 2016, 12:54:59 PM5/14/16
to bazel-discuss
Hi,

I'm trying to use boost in my C++ project and I'm trying to set boost up as an external dependency.

In my boost directory I have a empty WORKSPACE file and a BUILD file with the following:

cc_library(
  name = "boost-optional",
  hdrs = glob(["boost_1_61_0/boost/**/*.hpp", "boost_1_61_0/boost/**/*.h"]),
  includes = ["boost_1_61_0/boost"],
  copts = ["-std=c++11"],
  visibility = ["//visibility:public"],
)

In my main project, where I am trying to use boost, I have the following in my WORKSPACE file:

local_repository(
  name = "boost-optional",
  path = "/Users/przemeklach/dev/boost-optional",
)

I'm not including it in any of my targets yet but when I try to build anything I get the following error:

ERROR: /Users/przemeklach/source/Master/WORKSPACE:10:1: local_repository rule //external:boost-optional's name field must be a legal workspace name.
ERROR: Error evaluating WORKSPACE file.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'tools/cpp/cc_configure.bzl': no such package '@bazel_tools//tools/cpp': error loading package 'external': Could not load //external package.

Looking at the docs this seems like a straight forward process. Anyone can see what I'm doing wrong here?

Thanks in advance.


Przemek

Ming Zhao

unread,
May 14, 2016, 1:29:13 PM5/14/16
to Przemek Lach, bazel-discuss
Replace dash with underscore?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/7355bf6d-ed2c-4d84-9ce9-1fdd577b0466%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages