Fix & improve GitHub Actions CI builds (#7784)

This commit is contained in:
mehrdadn
2020-03-30 16:29:54 -07:00
committed by GitHub
parent e356e97eb2
commit f86e623095
14 changed files with 149 additions and 207 deletions
-2
View File
@@ -16,8 +16,6 @@ syntax = "proto3";
package ray.rpc;
import "src/ray/protobuf/common.proto";
message GetProfilingStatsRequest {
// PID of the worker process.
uint32 pid = 1;
-2
View File
@@ -14,8 +14,6 @@
#include "ray/raylet/worker_pool.h"
#include <sys/wait.h>
#include <algorithm>
#include <boost/date_time/posix_time/posix_time.hpp>
+3
View File
@@ -51,6 +51,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string.h>
#ifdef _WIN32
#ifndef _WINSOCKAPI_
#include <WinSock2.h>
#endif
#include <Windows.h>
#include <io.h>
#include <ws2tcpip.h> /* socklen_t, et al (MSVC20xx) */
-27
View File
@@ -1,27 +0,0 @@
#include <sys/wait.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <Windows.h>
pid_t waitpid(pid_t pid, int *status, int options) {
int result;
if (pid <= 0) {
result = -1;
errno = ECHILD;
} else if (HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid)) {
DWORD timeout = status && *status == WNOHANG ? 0 : INFINITE;
if (WaitForSingleObject(process, timeout) != WAIT_FAILED) {
result = 0;
} else {
result = -1;
errno = ECHILD;
}
CloseHandle(process);
} else {
result = -1;
errno = ECHILD;
}
return result;
}
-15
View File
@@ -1,15 +0,0 @@
#ifndef WAIT_H
#define WAIT_H
#include <unistd.h> // pid_t
#define WNOHANG 1
__declspec(
deprecated("Waiting on a process by ID has an inherent race condition"
" on Windows and is discouraged. "
"Please use a wrapper that keeps the process handle alive"
" and waits on it directly as needed."
"")) pid_t waitpid(pid_t pid, int *status, int options);
#endif /* WAIT_H */
-22
View File
@@ -71,25 +71,3 @@ unsigned sleep(unsigned seconds) {
Sleep(seconds * 1000);
return 0;
}
int kill(pid_t pid, int sig) {
int result;
if (HANDLE process = OpenProcess(PROCESS_TERMINATE, FALSE, pid)) {
if (sig == SIGKILL) {
if (TerminateProcess(process, ERROR_PROCESS_ABORTED)) {
result = 0;
} else {
result = -1;
errno = EPERM;
}
} else {
result = -1;
errno = EINVAL;
}
CloseHandle(process);
} else {
result = -1;
errno = ESRCH;
}
return result;
}