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(
|
path = CUSTOM_MODULE_CRATES.get(
|
||||||
name, f"external/rust/crates/{name}"
|
name, f"external/rust/crates/{name}"
|
||||||
)
|
)
|
||||||
abspath = os.path.normpath(os.path.join(TOP_DIR, path))
|
if dependency["optional"]:
|
||||||
# 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 feats := [
|
if feats := [
|
||||||
f
|
f
|
||||||
for f in self.features
|
for f in self.features
|
||||||
if name in self.feature_dependencies.get(f, [])
|
if name in self.feature_dependencies.get(f, [])
|
||||||
]:
|
]:
|
||||||
print(
|
continue
|
||||||
f"### WARNING: missing dependency {name} needed by features "
|
library_deps.append(path)
|
||||||
+ ", ".join(feats)
|
|
||||||
)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
print(f"### WARNING: missing non-optional dependency: {path}")
|
|
||||||
return
|
|
||||||
if library_deps:
|
if library_deps:
|
||||||
self.write("MODULE_LIBRARY_DEPS := \\")
|
self.write("MODULE_LIBRARY_DEPS := \\")
|
||||||
for path in library_deps:
|
for path in library_deps:
|
||||||
|
|||||||
Reference in New Issue
Block a user