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

Commit a2e8000d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "HostToolPath should return install path" am: 65c74d9f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1396128

Change-Id: I628ebb49b3315bed63c3c6d9174d9b96ccd38ba9
parents eb037766 65c74d9f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,11 @@ func TestPreferDynamicBinary(t *testing.T) {
	fizzBuzz := ctx.ModuleForTests("fizz-buzz", "linux_glibc_x86_64").Output("fizz-buzz")
	fizzBuzzDynamic := ctx.ModuleForTests("fizz-buzz-dynamic", "linux_glibc_x86_64").Output("fizz-buzz-dynamic")

	path := ctx.ModuleForTests("fizz-buzz", "linux_glibc_x86_64").Module().(*Module).HostToolPath()
	if g, w := path.String(), "/host/linux-x86/bin/fizz-buzz"; !strings.Contains(g, w) {
		t.Errorf("wrong host tool path, expected %q got %q", w, g)
	}

	// Do not compile binary modules with the --test flag.
	flags := fizzBuzzDynamic.Args["rustcFlags"]
	if strings.Contains(flags, "--test") {
+2 −2
Original line number Diff line number Diff line
@@ -1057,8 +1057,8 @@ func (mod *Module) HostToolPath() android.OptionalPath {
	if !mod.Host() {
		return android.OptionalPath{}
	}
	if _, ok := mod.compiler.(*binaryDecorator); ok {
		return mod.outputFile
	if binary, ok := mod.compiler.(*binaryDecorator); ok {
		return android.OptionalPathForPath(binary.baseCompiler.path)
	}
	return android.OptionalPath{}
}