jmorrill commented on a change in pull request #4857: Windows Support for 
cpp_rpc
URL: https://github.com/apache/incubator-tvm/pull/4857#discussion_r380492019
 
 

 ##########
 File path: apps/cpp_rpc/rpc_env.cc
 ##########
 @@ -20,141 +20,139 @@
  * \file rpc_env.cc
  * \brief Server environment of the RPC.
  */
+#include <cerrno>
 #include <tvm/runtime/registry.h>
-#include <errno.h>
-#ifndef _MSC_VER
-#include <sys/stat.h>
+#ifndef _WIN32
 #include <dirent.h>
+#include <sys/stat.h>
 #include <unistd.h>
 #else
 #include <Windows.h>
+#include <direct.h>
+namespace {
+  int mkdir(const char* path, int /* ignored */) { return _mkdir(path); }
+}
 #endif
+#include <cstring>
 #include <fstream>
-#include <vector>
 #include <iostream>
 #include <string>
-#include <cstring>
+#include <vector>
+#include <string>
 
-#include "rpc_env.h"
 #include "../../src/support/util.h"
 #include "../../src/runtime/file_util.h"
+#include "rpc_env.h"
+
+namespace {
+#if defined(__linux__) || defined(__ANDROID__)
+  const std::string untar_cmd = "tar -C ";
+#elif defined(_WIN32)
+  const std::string untar_cmd = "wsl tar -C ";
 
 Review comment:
   I just did a few tests in powershell:
   `Measure-Command {start-process "python tar-test.py" -Wait}`
   
   Where tar-test.py is just: "import tarfile"
   
   `Measure-Command {start-process "wsl tar --help" -Wait}`
   
   It doesnt look like python startup is much worse than "wsl tar".  Both 
around ~30ms.
   
   How would you suggest this be implemented?  Generate a python script at 
runtime in the tmp folder?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to