diff options
Diffstat (limited to 'rust/image.go')
-rw-r--r-- | rust/image.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/rust/image.go b/rust/image.go index 6cfb42c7d..3b54f12c7 100644 --- a/rust/image.go +++ b/rust/image.go @@ -82,7 +82,12 @@ func (mod *Module) SetCoreVariantNeeded(b bool) { } func (mod *Module) SnapshotVersion(mctx android.BaseModuleContext) string { - panic("Rust modules do not support snapshotting: " + mod.BaseModuleName()) + if snapshot, ok := mod.compiler.(cc.SnapshotInterface); ok { + return snapshot.Version() + } else { + mctx.ModuleErrorf("version is unknown for snapshot prebuilt") + return "" + } } func (mod *Module) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool { @@ -110,7 +115,9 @@ func (mod *Module) ExtraImageVariations(android.BaseModuleContext) []string { } func (mod *Module) IsSnapshotPrebuilt() bool { - // Rust does not support prebuilts in its snapshots + if p, ok := mod.compiler.(cc.SnapshotInterface); ok { + return p.IsSnapshotPrebuilt() + } return false } @@ -220,7 +227,9 @@ func (mod *Module) ImageMutatorBegin(mctx android.BaseModuleContext) { } } if vendorSpecific { - mctx.PropertyErrorf("vendor", "Vendor-only non-rust_ffi Rust modules are not supported.") + if lib, ok := mod.compiler.(libraryInterface); ok && lib.buildDylib() { + mctx.PropertyErrorf("vendor", "Vendor-only dylibs are not yet supported, use rust_library_rlib.") + } } cc.MutateImage(mctx, mod) |