summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Larsen <perlarsen@google.com>2024-04-06 02:48:36 +0000
committerPer Larsen <perlarsen@google.com>2024-04-06 02:48:36 +0000
commitde979840b967c8e3af9445dc4536093e4dd3af50 (patch)
treedbae4cadf5724c6fe20efd18215628e2e0787dd7
parentf9133cdaf7b3584eb69f1c0e9ec11b352170067e (diff)
downloaddevelopment-de979840b967c8e3af9445dc4536093e4dd3af50.tar.gz
cargo2rulesmk.py: Build with cap-lints allow
Make sure we can generate rules for crates even if they are not linter clean and request to have linter issues treated as errors. Test: cd external/rust/crates/serde && path/to/cargo2rulesmk.py --run Bug: None Change-Id: Ifc40a9e21494c571f598f3d407fe394fcfffb9b3
-rwxr-xr-xscripts/cargo2rulesmk.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/cargo2rulesmk.py b/scripts/cargo2rulesmk.py
index 7e0e33881..722484983 100755
--- a/scripts/cargo2rulesmk.py
+++ b/scripts/cargo2rulesmk.py
@@ -870,8 +870,11 @@ class Runner(object):
cmd_v_flag = " -vv " if self.args.vv else " -v "
cmd = self.cargo_path + cmd_v_flag
cmd += c + features + cmd_tail_target + cmd_tail_redir
- if self.args.rustflags and c != "clean":
- cmd = 'RUSTFLAGS="' + self.args.rustflags + '" ' + cmd
+ if c != "clean":
+ rustflags = self.args.rustflags if self.args.rustflags else ""
+ # linting issues shouldn't prevent us from generating rules.mk
+ rustflags = f'RUSTFLAGS="{rustflags} --cap-lints allow" '
+ cmd = rustflags + cmd
self.run_cmd(cmd, cargo_out)
if self.args.tests:
cmd = (