Skip to content

Commit 41e0325

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

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

rust/private/rustdoc_test.bzl

Lines changed: 5 additions & 2 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:
@@ -197,7 +198,9 @@ def _build_rustdoc_flags(ctx, dep_info, crate_info, toolchain):
197198
if cc_toolchain.sysroot:
198199
env["SYSROOT"] = cc_toolchain.sysroot
199200

200-
env["SYSROOT"] = "${{pwd}}/{}".format(sysroot)
201+
# env["SYSROOT"] = "${{pwd}}/{}".format(sysroot)
202+
env["LD_LIBRARY_PATH"] = env.get("LD_LIBRARY_PATH", "") + ":".join(rust_lib_dirs)
203+
env["DYLD_LIBRARY_PATH"] = env.get("DYLD_LIBRARY_PATH", "") + ":".join(rust_lib_dirs)
201204
return flags, env, toolchain_tools
202205

203206
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)