commit | c431d21055119cf9c547d39e22042d070c9d2406 | [log] [tgz] |
---|---|---|
author | martinboehme <mboehme@google.com> | Wed Mar 31 11:00:46 2021 +0200 |
committer | GitHub <noreply@github.com> | Wed Mar 31 11:00:46 2021 +0200 |
tree | 50661d300ee69913c1a72ba9ca77cd8a5866f4ed | |
parent | 77fde0fdaab9b2eb72d45cd2329fa08b84581f65 [diff] |
construct_arguments: Always use correct attributes in an aspect context. (#668) `construct_arguments` was already using the `rule_attrs` helper function in some places to access `ctx.rule.attr` instead of `ctx.attr`, but it wasn't doing this consistently. I've chosen to eliminate the boolean `aspect` parameter of `construct_arguments` and pass in the correct attributes directly instead. This also eliminates the need for the `rule_attrs` helper function. Since this function was only being used here, I have eliminated it entirely. Finally, I have changed `_get_rustc_env` to take only the attributes instead of the entire context. All tests continue to pass. I haven't added any tests that would break without this change, but in an upcoming PR, I will change `_get_rustc_env` to respect the `crate_name` attribute, and this would break without the changes in this PR.
This repository provides rules for building Rust projects with Bazel.
Please refer to the full documentation.