Repository navigation
platform-tools 是目录联接时也认得出自己起的 logcat 采集 - #125
Merged
Merged
Conversation
进程映像路径是解析过链接的,m.Root.AdbExe() 经过链接,capturePathMatches 在 Windows 上只比名字,两边对不上:开机不打印 logcat 路径,开诊断误报 「已有其它程序采集」。根目录本身是联接时,tools\modavd.exe 和根目录参数 的比对也一样。 Windows 上名字对不上时,再按文件身份(os.SameFile)比,和别的平台一样。 补了 platform-tools 和根目录是目录联接时的单测,去掉修复时单测失败。 Refs ModAVD/ModAVD#135
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
根目录的
sdk\platform-tools是目录联接或符号链接时,管理器认不出自己起的 logcat 采集:开机不打印logcat:<路径>,开诊断模式误报「已有其它程序采集 logcat」(ModAVD/ModAVD#135)。原因是
capturePathMatches在 Windows 上只比路径名:进程映像路径是解析过链接的,m.Root.AdbExe()是经过链接的,两边对不上。根目录本身是联接时,tools\modavd.exe和根目录参数的比对也一样。改了什么
internal/emu/capture_policy.go的capturePathMatches:Windows 上名字(不分大小写)一样就算;不一样时再按文件身份(os.SameFile)比,和其它平台的做法一样。ownedCapture、pendingOwnedCapture、waitDiagnosticCaptureRuntime、ownsCaptureHelper都经过它,一起修好。测试
TestCapturePathMatchesThroughJunction:platform-tools是目录联接、根目录是联接、大小写不同、同目录的别的文件、不存在的文件、空路径。去掉修复时前两项失败。go test ./internal/emu/...通过;go vet(Windows、GOOS=darwin)通过。Refs ModAVD/ModAVD#135