You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is my first time here, and I already read the contribution guideline. So I hope creating an issue is an appropriate step for this discussion.
I am working on a bazel workspace that needs to import and build both gflags and glog from source. I would like to build glog using the version of gflags in my workspace, instead of the one specified in glog WORKSPACE file. Hence, would the following change work and be accepted?
if "com_github_gflags_gflags" not in native.existing_rules():
http_archive(
name = "com_github_gflags_gflags",
strip_prefix = "gflags-2.2.2",
urls = [
"https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz",
"https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
],
)
The text was updated successfully, but these errors were encountered:
If I understand correctly, you shouldn't need to change glog to do what you want. Since Bazel ignores the WORKSPACE files of external repositories (see bazelbuild/bazel#1943), adding glog to your WORKSPACE will not add gflags: you'll have to add it yourself. You can add any version that you want, as long as it includes gflags/gflags@57ceb0e (2.2.2 is the first release with this commit).
Does that help?
PS: The if ... not in native.existing_rules(): pattern can't be used directly in the WORKSPACE file (if statements aren't allowed in BUILD or WORKSPACE files), but it is useful inside a dependencies macro that is intended to be called from the WORKSPACE to add a group of dependencies. glog doesn't provide a macro like that since it only has one (optional) dependency, so it's easier to let people add gflags to the top-level WORKSPACE themselves.
It is my first time here, and I already read the contribution guideline. So I hope creating an issue is an appropriate step for this discussion.
I am working on a bazel workspace that needs to import and build both gflags and glog from source. I would like to build glog using the version of gflags in my workspace, instead of the one specified in glog
WORKSPACE
file. Hence, would the following change work and be accepted?to:
The text was updated successfully, but these errors were encountered: