summaryrefslogtreecommitdiff
path: root/rust/proc_macro.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2022-03-23 17:31:39 -0400
committer Ivan Lozano <ivanlozano@google.com> 2022-03-25 09:25:07 -0400
commit872d579a22cd8e2d34a9baf8d892346e4ac71d27 (patch)
tree82273711859c3094e83a80de9ee34a6d36e60e8d /rust/proc_macro.go
parent057beb21468ec738d6d9325a46d6e8ca77fef00b (diff)
rust: rust_proc_macro host snapshot support.
Adds support for capturing rust_proc_macros as part of the host snapshot. Proc macros target the host and can be thought of as compiler plugins. Because of this, they don't have vendor image variants and can't be easily captured as part of the vendor snapshot. Instead we capture them as part of the host snapshot. This adds a rust_prebuilt_proc_macro module type. Bug: 204304380 Test: m HOST_FAKE_SNAPSHOT_ENABLE=true host-fake-snapshot dist Test: python3 development/vendor_snapshot/update.py --image=host --install-dir=vendor/vendor_name/ 31 --local out/dist Test: Checked Android.bp for rust_prebuilt_proc_macro modules. Change-Id: I4a8c4d9c41b7ca361b5b97d3f74973918c2a5fe3
Diffstat (limited to 'rust/proc_macro.go')
-rw-r--r--rust/proc_macro.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/proc_macro.go b/rust/proc_macro.go
index 974c096c4..f8a4bbded 100644
--- a/rust/proc_macro.go
+++ b/rust/proc_macro.go
@@ -33,6 +33,7 @@ type procMacroDecorator struct {
}
type procMacroInterface interface {
+ ProcMacro() bool
}
var _ compiler = (*procMacroDecorator)(nil)
@@ -90,6 +91,10 @@ func (procMacro *procMacroDecorator) autoDep(ctx android.BottomUpMutatorContext)
return rlibAutoDep
}
+func (procMacro *procMacroDecorator) ProcMacro() bool {
+ return true
+}
+
func (procMacro *procMacroDecorator) everInstallable() bool {
// Proc_macros are never installed
return false