-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix:getcwd not work on android platform #7390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you @fantasyRqg ! |
| #if defined(ANDROID) || defined(__ANDROID__) | ||
| char cwd[PATH_MAX]; | ||
| auto cmdline = fopen("/proc/self/cmdline", "r"); | ||
| fread(cwd, 1, sizeof(cwd), cmdline); | ||
| fclose(cmdline); | ||
| base_ = "/data/data/" + std::string(cwd) + "/cache/rpc"; | ||
| #elif !defined(_WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has the effect of now requiring a user to provide a target path to RPCSession.upload(..., target=path), when running from /data/local/tmp for example. Without providing the target path, the /data/data prefix is always prepended resulting in errors like:
Check failed: !fs.fail() == false: Cannot open /data/data//data/local/tmp/tvm_rpc/cache/rpc/dev_lib_cl.so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csullivan great catch, can you send a new PR to fix this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, please allow me some time.
* fix:getcwd not work on android platform * replace `exit()` with `_exit()` on subprocess in `cpp_rpc` Co-authored-by: rqg <ranqingguo318@gmail.com>
* fix:getcwd not work on android platform * replace `exit()` with `_exit()` on subprocess in `cpp_rpc` Co-authored-by: rqg <ranqingguo318@gmail.com>
getcwdnot work on android platform , just get"\"exit()with_exit()on subprocess incpp_rpc@vinx13 @tqchen