Skip to content

Commit

Permalink
add compile_data argument for data required at compile time (#516)
Browse files Browse the repository at this point in the history
Using the existing data argument for build-time data dependencies causes the files to also show up in the runfiles. This can be seen when using rules_docker's rust_image() for example - the files are included in the image twice; once in the binary and once in their original form.

If this is accepted I'll send through a PR to cargo-raze to expose this for third-party crates similar to data_attr.

Closes #222
  • Loading branch information
dae committed Dec 12, 2020
1 parent 997a8a1 commit eef7f56
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 29 deletions.
3 changes: 2 additions & 1 deletion cargo/cargo_build_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def _build_script_impl(ctx):
env.update(expand_locations(
ctx,
ctx.attr.build_script_env,
getattr(ctx.attr, "data", []),
getattr(ctx.attr, "data", []) +
getattr(ctx.attr, "compile_data", []),
))

tools = depset(
Expand Down
Loading

0 comments on commit eef7f56

Please sign in to comment.