Skip to content

Commit fc7ed21

Browse files
authored
allow setting RANLIB to something other than : (#1509)
bazel has no standard way to retrieve this value from the toolchain, but some toolchains provide it and some build systems (like openssl) require it for non-racy parallel builds. Therefore, load it from user_vars if it's available, so users who know their toolchains have it can use it.
1 parent 2373ac5 commit fc7ed21

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

foreign_cc/private/make_env_vars.bzl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ def get_make_env_vars(
1616
vars = _get_make_variables(workspace_name, tools, flags, user_vars, make_commands)
1717
deps_flags = _define_deps_flags(deps, inputs, is_msvc)
1818

19-
# For cross-compilation.
20-
if "RANLIB" not in vars.keys():
19+
# bazel has no standard way to retrieve this value from the toolchain, but
20+
# some toolchains provide it and some build systems (like openssl) require
21+
# it for non-racy parallel builds.
22+
if "RANLIB" in user_vars:
23+
vars["RANLIB"] = [user_vars["RANLIB"]]
24+
25+
elif "RANLIB" not in vars.keys():
26+
# For cross-compilation.
2127
vars["RANLIB"] = [":"]
2228

2329
if "LDFLAGS" in vars.keys():

0 commit comments

Comments
 (0)