diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index 669b4dac4..f39f15ed4 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -118,13 +118,13 @@ DRY_RUN_NOTE = ( 'See --help for other flags, and more usage notes in this script.\n') # Cargo -v output of a call to rustc. -RUSTC_PAT = re.compile('^ +Running `rustc (.*)`$') +RUSTC_PAT = re.compile('^ +Running `(.*\/)?rustc (.*)`$') # Cargo -vv output of a call to rustc could be split into multiple lines. # Assume that the first line will contain some CARGO_* env definition. RUSTC_VV_PAT = re.compile('^ +Running `.*CARGO_.*=.*$') # The combined -vv output rustc command line pattern. -RUSTC_VV_CMD_ARGS = re.compile('^ *Running `.*CARGO_.*=.* rustc (.*)`$') +RUSTC_VV_CMD_ARGS = re.compile('^ *Running `.*CARGO_.*=.* (.*\/)?rustc (.*)`$') # Cargo -vv output of a "cc" or "ar" command; all in one line. CC_AR_VV_PAT = re.compile(r'^\[([^ ]*)[^\]]*\] running:? "(cc|ar)" (.*)$') @@ -1567,7 +1567,7 @@ class Runner(object): if not line.endswith('`\n') or (new_rustc.count('`') % 2) != 0: return new_rustc if RUSTC_VV_CMD_ARGS.match(new_rustc): - args = RUSTC_VV_CMD_ARGS.match(new_rustc).group(1) + args = RUSTC_VV_CMD_ARGS.match(new_rustc).group(2) self.add_crate(Crate(self, outf_name).parse(n, args)) else: self.assert_empty_vv_line(new_rustc) @@ -1632,7 +1632,7 @@ class Runner(object): continue new_rustc = '' if RUSTC_PAT.match(line): - args_line = RUSTC_PAT.match(line).group(1) + args_line = RUSTC_PAT.match(line).group(2) self.add_crate(Crate(self, outf_name).parse(n, args_line)) self.assert_empty_vv_line(rustc_line) elif rustc_line or RUSTC_VV_PAT.match(line):