summaryrefslogtreecommitdiff
path: root/android/module_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2021-11-09 16:37:52 -0800
committer Colin Cross <ccross@android.com> 2021-11-09 17:25:57 -0800
commit64002afc56fe08620af56d5cf30f265dcb144df7 (patch)
treee67eb1e41dc4e4e29ed8551e8c63ed51fef1911f /android/module_test.go
parent6ac9576eefd3c896ca32412929ef5bc92205cbe2 (diff)
Fix InstallBypassMake symlink dependencies
Host symlinks cannot use order-only dependencies because they may be used as part of the dependency chain on a tool, and an order-only dependency would cause the target of the symlink not to be updated. Use regular dependencies instead. Bug: 204136549 Fixes: 205674000 Test: TestInstallBypassMake Change-Id: Ib3f4ee143e94d1995ec6c60d314e7c91e57cc775
Diffstat (limited to 'android/module_test.go')
-rw-r--r--android/module_test.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/android/module_test.go b/android/module_test.go
index 236cae79a..8607a8d34 100644
--- a/android/module_test.go
+++ b/android/module_test.go
@@ -425,7 +425,8 @@ func TestInstall(t *testing.T) {
)
assertOrderOnlys(hostInstallRule("foo"))
- // Check host symlink rule dependencies
+ // Check host symlink rule dependencies. Host symlinks must use a normal dependency, not an
+ // order-only dependency, so that the tool gets updated when the symlink is depended on.
assertInputs(hostSymlinkRule("foo"), hostInstallRule("foo").Output)
assertImplicits(hostSymlinkRule("foo"))
assertOrderOnlys(hostSymlinkRule("foo"))
@@ -442,7 +443,8 @@ func TestInstall(t *testing.T) {
symlinkRule("qux").Output,
)
- // Check device symlink rule dependencies
+ // Check device symlink rule dependencies. Device symlinks could use an order-only dependency,
+ // but the current implementation uses a normal dependency.
assertInputs(symlinkRule("foo"), installRule("foo").Output)
assertImplicits(symlinkRule("foo"))
assertOrderOnlys(symlinkRule("foo"))
@@ -553,9 +555,10 @@ func TestInstallBypassMake(t *testing.T) {
)
assertOrderOnlys(hostInstallRule("foo"))
- // Check host symlink rule dependencies
- assertDeps(hostSymlinkRule("foo"))
- assertOrderOnlys(hostSymlinkRule("foo"), hostInstallRule("foo").target)
+ // Check host symlink rule dependencies. Host symlinks must use a normal dependency, not an
+ // order-only dependency, so that the tool gets updated when the symlink is depended on.
+ assertDeps(hostSymlinkRule("foo"), hostInstallRule("foo").target)
+ assertOrderOnlys(hostSymlinkRule("foo"))
// Check device install rule dependencies
assertDeps(installRule("foo"), outputRule("foo").Output.String())
@@ -568,9 +571,10 @@ func TestInstallBypassMake(t *testing.T) {
symlinkRule("qux").target,
)
- // Check device symlink rule dependencies
- assertDeps(symlinkRule("foo"))
- assertOrderOnlys(symlinkRule("foo"), installRule("foo").target)
+ // Check device symlink rule dependencies. Device symlinks could use an order-only dependency,
+ // but the current implementation uses a normal dependency.
+ assertDeps(symlinkRule("foo"), installRule("foo").target)
+ assertOrderOnlys(symlinkRule("foo"))
}
type installMakeRule struct {