拷贝别人编译好的的aosp后自己编译报错FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks

在使用scp -r拷贝别人的sdk后编译无法通过pathtools测试,原因是拷贝时把链接也当成了真实的文件或者目录,尤其是拷贝build目录时会残留之前别人编译的文件夹。

FAILED: out/soong/.bootstrap/blueprint-pathtools/test/test.passed
out/soong/.bootstrap/bin/gotestrunner -p ./build/blueprint/pathtools -f out/soong/.bootstrap/blueprint-pathtools/test/test.passed -- out/soong/.bootstrap/blueprint-pathtools/test/test -test.short
--- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks (0.00s)
    --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os (0.00s)
        --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os/relpath (0.00s)
            --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os/relpath/. (0.00s)
                fs_test.go:287: want: [. a a/a], got [. a a/a b b/a c d]
        --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os/abspath (0.00s)
            --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os/abspath/. (0.00s)
                fs_test.go:287: want: [/mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/a /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/a/a], got [/mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/a /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/a/a /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/b /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/b/a /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/c /mnt/rk356x-android11-V1.1.5/build/blueprint/pathtools/testdata/dangling/d]
    --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os_relative_srcDir (0.00s)
        --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os_relative_srcDir/relpath (0.00s)
            --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os_relative_srcDir/relpath/. (0.00s)
                fs_test.go:287: want: [. a a/a], got [. a a/a b b/a c d]
        --- FAIL: TestFs_ListDirsRecursiveDontFollowSymlinks/os_relative_srcDir/absp

解决方法,重新拷贝build或者其他提示xxx redefine重定义的文件夹。使用rsync代替scp,或者先压缩再拷贝。

rsync -avz -e ssh /path/to/source user@remote:/path/to/destination

-a 表示归档模式,递归复制,并保持符号链接、权限、时间戳等。
-z 表示压缩数据传输。
-e ssh 指定使用 ssh 作为传输协议。

使用cp时:可以使用 -P 或 --no-dereference 选项。cp 的选项说明-P 或 --no-dereference:这两个选项告诉 cp 在复制符号链接时,不要跟随符号链接指向的目标,而是将符号链接本身复制。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值