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
This commit is contained in:
Joel Galenson
2021-09-30 14:13:45 -07:00
parent 55be24dec6
commit 308f3521dd

View File

@@ -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']