Fix cargo2rulesmk.py dependency bug in sandbox
Remove the check performed by cargo2rulesmk.py
whether the external/rust/crates/{name} directories
exist for all dependencies of the current crate.
These directories only exist in the Android tree,
not in the minimal checkout inside the redshell sandbox.
Bug: 281857510
Test: cargo2rulesmk.py on thiserror-impl
Change-Id: I1e5d46b4de3129770ab87ebc5e58563010ae6605
This commit is contained in:
@@ -596,25 +596,14 @@ class Crate(object):
|
||||
path = CUSTOM_MODULE_CRATES.get(
|
||||
name, f"external/rust/crates/{name}"
|
||||
)
|
||||
abspath = os.path.normpath(os.path.join(TOP_DIR, path))
|
||||
# just check for directory, not whether it contains rules.mk, since
|
||||
# we do not generate makefile rules in topological order
|
||||
if os.path.isdir(abspath):
|
||||
library_deps.append(path)
|
||||
elif dependency["optional"]:
|
||||
if dependency["optional"]:
|
||||
if feats := [
|
||||
f
|
||||
for f in self.features
|
||||
if name in self.feature_dependencies.get(f, [])
|
||||
]:
|
||||
print(
|
||||
f"### WARNING: missing dependency {name} needed by features "
|
||||
+ ", ".join(feats)
|
||||
)
|
||||
return
|
||||
else:
|
||||
print(f"### WARNING: missing non-optional dependency: {path}")
|
||||
return
|
||||
continue
|
||||
library_deps.append(path)
|
||||
if library_deps:
|
||||
self.write("MODULE_LIBRARY_DEPS := \\")
|
||||
for path in library_deps:
|
||||
|
||||
Reference in New Issue
Block a user