Skip to content

Commit b01eae7

Browse files
committed
ld lib path?
1 parent 4c0f356 commit b01eae7

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

rust/private/rustdoc_test.bzl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ def _build_rustdoc_flags(ctx, dep_info, crate_info, toolchain):
143143
rust_lib_files = depset(transitive = [toolchain.rust_lib.files, toolchain.rustc_lib.files])
144144
rust_lib_paths = depset([file.short_path for file in rust_lib_files.to_list()]).to_list()
145145
rust_lib_dirs = depset([file.rsplit("/", 1)[0] for file in rust_lib_paths]).to_list()
146+
rust_lib_dirs = ["${{pwd}}/{}".format(lib) for lib in rust_lib_dirs]
146147

147148
# Tell Rustc where to find the standard library
148-
link_search_flags.extend(["-L ${{pwd}}/{}".format(lib) for lib in rust_lib_dirs])
149+
link_search_flags.extend(["-L {}".format(lib) for lib in rust_lib_dirs])
149150

150151
sysroot = find_sysroot(toolchain, short_path = True)
151152
if sysroot:
@@ -170,8 +171,11 @@ def _build_rustdoc_flags(ctx, dep_info, crate_info, toolchain):
170171

171172
flags = link_search_flags + link_flags + edition_flags
172173

174+
# Start with the default shell env, which contains any --action_env
175+
# settings passed in on the command line.
176+
env = dict(ctx.configuration.default_shell_env)
177+
173178
# Build a set of environment variables to use for the test
174-
env = {}
175179
toolchain_tools = []
176180
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
177181
cc_env = get_cc_compile_env(cc_toolchain, feature_configuration)
@@ -197,7 +201,9 @@ def _build_rustdoc_flags(ctx, dep_info, crate_info, toolchain):
197201
if cc_toolchain.sysroot:
198202
env["SYSROOT"] = cc_toolchain.sysroot
199203

200-
env["SYSROOT"] = "${{pwd}}/{}".format(sysroot)
204+
# env["SYSROOT"] = "${{pwd}}/{}".format(sysroot)
205+
env["LD_LIBRARY_PATH"] = env.get("LD_LIBRARY_PATH", "") + ":".join(rust_lib_dirs)
206+
env["DYLD_LIBRARY_PATH"] = env.get("DYLD_LIBRARY_PATH", "") + ":".join(rust_lib_dirs)
201207
return flags, env, toolchain_tools
202208

203209
rust_doc_test = rule(

util/launcher/launcher.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def _merge_providers(ctx, providers, launcher, launcher_files, executable = None
8585
)
8686

8787
# buildifier: disable=print
88-
print(ctx.label, default_info.default_runfiles.merge(
89-
# The original executable is now also considered a runfile
90-
ctx.runfiles(files = launcher_files + [
91-
executable or default_info.files_to_run.executable,
92-
]),
93-
).files)
88+
# print(ctx.label, default_info.default_runfiles.merge(
89+
# # The original executable is now also considered a runfile
90+
# ctx.runfiles(files = launcher_files + [
91+
# executable or default_info.files_to_run.executable,
92+
# ]),
93+
# ).files)
9494

9595
providers.extend([
9696
DefaultInfo(

0 commit comments

Comments
 (0)