From 308f3521dda77959d40a96d5f78d465ba4795ee1 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Thu, 30 Sep 2021 14:13:45 -0700 Subject: [PATCH] Handle versions of the form -a.b.c+foo. Previously we would keep the +x.y.z part, which caused errors in Soong. See the diff between the first two patchsets in aosp/1833319 for an example. Test: Fix the above CL and run on a crate without a +. Change-Id: I791c85545e67b54e2c8952428211688e7bbf580d --- scripts/cargo2android.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index c0db53883..37ecb959f 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -125,8 +125,8 @@ CC_AR_VV_PAT = re.compile(r'^\[([^ ]*)[^\]]*\] running:? "(cc|ar)" (.*)$') # Rustc output of file location path pattern for a warning message. WARNING_FILE_PAT = re.compile('^ *--> ([^:]*):[0-9]+') -# Rust package name with suffix -d1.d2.d3. -VERSION_SUFFIX_PAT = re.compile(r'^(.*)-[0-9]+\.[0-9]+\.[0-9]+$') +# Rust package name with suffix -d1.d2.d3(+.*)?. +VERSION_SUFFIX_PAT = re.compile(r'^(.*)-[0-9]+\.[0-9]+\.[0-9]+(?:\+.*)?$') # Crate types corresponding to a C ABI library C_LIBRARY_CRATE_TYPES = ['staticlib', 'cdylib']