support adb-shell style cpp_rpc#8223
Conversation
|
Android Application test log: adb shell test log: |
|
please fix the format problem using clang-format-10 |
| cmake-build-debug | ||
| cmake-build* |
There was a problem hiding this comment.
your pr should not be related with this .gitignore
There was a problem hiding this comment.
Should I modify .gitignore in another PR ?
There was a problem hiding this comment.
Yes, if you think it is a must
| std::string android_base_ = "/data/data/" + std::string(cwd) +"/cache"; | ||
| struct stat statbuf; | ||
| if (stat(android_base_.data(), &statbuf) == -1 || !S_ISDIR(statbuf.st_mode)){ | ||
| android_base_ = "."; |
There was a problem hiding this comment.
If failed, android_base_ becomes ., will ./rpc work well on android?
There was a problem hiding this comment.
When current working directory is writable, Yes .
Another option is force base_ to /data/local/tmp/rpc. But I don't think this is a good choice. So I keep the original implementation .
There was a problem hiding this comment.
how about add one simple code comment to indicate users if failed, should make sure the directory is writable and also consider to change base_ to /data/local/tmp/rpc. This could help users find one solution more quickly
|
@FrozenGene All problems solved |
| base_ = "/data/data/" + std::string(cwd) + "/cache/rpc"; | ||
| std::string android_base_ = "/data/data/" + std::string(cwd) + "/cache"; | ||
| struct stat statbuf; | ||
| // Check if application data directory exist. If not exist usually mean tvm_rpc run from adb |
There was a problem hiding this comment.
Nitty comment. If not exist, usually means we run tvm_rpc from adb shell terminal
| // Check if application data directory exist. If not exist usually mean tvm_rpc run from adb | ||
| // shell terminal. | ||
| if (stat(android_base_.data(), &statbuf) == -1 || !S_ISDIR(statbuf.st_mode)) { | ||
| // Tmp directory always writable for 'shell' user. |
|
@FrozenGene Thanks for correcting my spelling mistake [Lol] |
|
Thanks @fantasyRqg |
* support adb-shell style cpp_rpc * fix review problems, apache#8223 * add comment & use /data/local/tmp dir in shell terminal case * fix spelling errors * fix spelling errors Co-authored-by: rqg <ranqingguo90@qq.com> Co-authored-by: rqg <ranqingguo318@gmail.com>
* support adb-shell style cpp_rpc * fix review problems, apache#8223 * add comment & use /data/local/tmp dir in shell terminal case * fix spelling errors * fix spelling errors Co-authored-by: rqg <ranqingguo90@qq.com> Co-authored-by: rqg <ranqingguo318@gmail.com>
Fix problem mentioned at #7390
Support
tvm_rpcdirectly use inadb shellterminal@vinx13 @tqchen