diff options
author | Philipp Wollermann <philwo@google.com> | 2015-09-04 19:07:44 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2015-09-08 09:02:16 +0000 |
commit | ab1711b026f8a4915ee2ef2556b2a7dbff18fa63 (patch) | |
tree | b4cbdd4148af101cee5be0f874afb1266c84a537 /tools/build_rules/rust | |
parent | ab4abc4728ed4b42bad335be52a53fdcb56bf421 (diff) |
Fixes #414: Add rustc + libs to action inputs, add LD_LIBRARY_PATH so that rustc finds its libs on Linux, too.
--
MOS_MIGRATED_REVID=102362939
Diffstat (limited to 'tools/build_rules/rust')
-rw-r--r-- | tools/build_rules/rust/rust.bzl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/build_rules/rust/rust.bzl b/tools/build_rules/rust/rust.bzl index 847775ddfc..943c6c73a3 100644 --- a/tools/build_rules/rust/rust.bzl +++ b/tools/build_rules/rust/rust.bzl @@ -141,6 +141,7 @@ def _build_rustc_command(ctx, crate_type, src, output_dir, depinfo, return " ".join([ "set -e;", " ".join(depinfo.setup_cmd), + "LD_LIBRARY_PATH=" + rustc_lib_path, "DYLD_LIBRARY_PATH=" + rustc_lib_path, rustc_path + " " + src, "--crate-name " + ctx.label.name, @@ -191,7 +192,8 @@ def _rust_library_impl(ctx): # Compile action. ctx.action( - inputs = srcs + ctx.files.data + depinfo.libs, + inputs = srcs + ctx.files.data + depinfo.libs + [ctx.file._rustc] + + ctx.files._rustc_lib + ctx.files._rustlib, outputs = [rust_lib], mnemonic = 'Rustc', command = cmd, @@ -239,7 +241,8 @@ def _rust_binary_impl_common(ctx, extra_flags = []): # Compile action. ctx.action( - inputs = srcs + ctx.files.data + depinfo.libs, + inputs = srcs + ctx.files.data + depinfo.libs + [ctx.file._rustc] + + ctx.files._rustc_lib + ctx.files._rustlib, outputs = [rust_binary], mnemonic = 'Rustc', command = cmd, |