Merge "Add a stronger wording to don't use ModuleFromName" am: 44baecd513 am: bb0a61e40c am: a6b048dcbb am: bd42ee2158

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2522235

Change-Id: I60408a27a7161bfbe18d41c96b88c4a53dda4671
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/module_ctx.go b/module_ctx.go
index 841e5c4..a1388b4 100644
--- a/module_ctx.go
+++ b/module_ctx.go
@@ -300,6 +300,9 @@
 	// There are no guarantees about which variant of the module will be returned.
 	// Prefer retrieving the module using GetDirectDep or a visit function, when possible, as
 	// this will guarantee the appropriate module-variant dependency is returned.
+	//
+	// WARNING: This should _only_ be used within the context of bp2build, where variants and
+	// dependencies are not created.
 	ModuleFromName(name string) (Module, bool)
 
 	// OtherModuleDependencyVariantExists returns true if a module with the