Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a10dfd6 authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Fix missing rust dependencies when ALLOW_MISSING_DEPENDENCIES=true" into main

parents 4b4d61fa a86ea0e0
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -1306,11 +1306,16 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
				}
			}
			linkObject := ccDep.OutputFile()
			linkPath := linkPathFromFilePath(linkObject.Path())

			if !linkObject.Valid() {
				if !ctx.Config().AllowMissingDependencies() {
					ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
				} else {
					ctx.AddMissingDependencies([]string{depName})
				}
				return
			}

			linkPath := linkPathFromFilePath(linkObject.Path())

			exportDep := false
			switch {
@@ -1356,6 +1361,14 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
				// Re-get linkObject as ChooseStubOrImpl actually tells us which
				// object (either from stub or non-stub) to use.
				linkObject = android.OptionalPathForPath(sharedLibraryInfo.SharedLibrary)
				if !linkObject.Valid() {
					if !ctx.Config().AllowMissingDependencies() {
						ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
					} else {
						ctx.AddMissingDependencies([]string{depName})
					}
					return
				}
				linkPath = linkPathFromFilePath(linkObject.Path())

				depPaths.linkDirs = append(depPaths.linkDirs, linkPath)