Archived
1
0

Add windows support (#41)

* Add windows support

* Improve multi-platform support

* Install with network-concurrency 1

* Use file-glob to upload windows binary

* Don't install packages in parallel if on windows

* Rename vscode-remote to code-server

* Add output at intervals so CI doesn't kill build

* Update all tasks to provide timed output

* Don't perform tasks sync otherwise we can't log
This commit is contained in:
Kyle Carberry
2019-02-28 14:04:19 -06:00
committed by GitHub
parent 1e30831c91
commit e8174095ca
27 changed files with 769 additions and 72 deletions

View File

@ -45,7 +45,7 @@ export class Entry extends Command {
}
const { args, flags } = this.parse(Entry);
const dataDir = flags["data-dir"] || path.join(os.homedir(), ".vscode-remote");
const dataDir = flags["data-dir"] || path.join(os.homedir(), ".code-server");
const workingDir = args["workdir"];
setupNativeModules(dataDir);
@ -112,9 +112,9 @@ export class Entry extends Command {
}
}
logger.info("\u001B[1mvscode-remote v1.0.0");
logger.info("\u001B[1mcode-server v1.0.0");
// TODO: fill in appropriate doc url
logger.info("Additional documentation: https://coder.com/docs");
logger.info("Additional documentation: http://github.com/codercom/code-server");
logger.info("Initializing", field("data-dir", dataDir), field("working-dir", workingDir), field("log-dir", logDir));
const sharedProcess = new SharedProcess(dataDir, builtInExtensionsDir);
const sendSharedProcessReady = (socket: WebSocket): void => {

View File

@ -13,13 +13,13 @@ export const setup = (dataDirectory: string): void => {
try {
fs.mkdirSync(currentDir);
} catch (ex) {
if (ex.code !== "EEXIST" && ex.code !== "EISDIR") {
if (ex.code !== "EEXIST" && ex.code !== "EISDIR" && ex.code !== "ENOENT") {
throw ex;
}
}
return currentDir;
}, path.sep);
}); // Might need path.sep here for linux. Having it for windows causes an error because \C:\Users ...
const unpackModule = (moduleName: string): void => {
const memFile = path.join(isCli ? buildDir! : path.join(__dirname, ".."), "build/dependencies", moduleName);
@ -37,12 +37,13 @@ export const setup = (dataDirectory: string): void => {
unpackModule("pty.node");
unpackModule("spdlog.node");
unpackModule("rg");
const nodePtyUtils = require("../../protocol/node_modules/node-pty-prebuilt/lib/utils") as typeof import("../../protocol/node_modules/node-pty-prebuilt/src/utils");
// const nodePtyUtils = require("../../protocol/node_modules/node-pty-prebuilt/lib/utils") as typeof import("../../protocol/node_modules/node-pty-prebuilt/src/utils");
// tslint:disable-next-line:no-any
nodePtyUtils.loadNative = (modName: string): any => {
return (typeof __non_webpack_require__ !== "undefined" ? __non_webpack_require__ : require)(path.join(dataDirectory, "dependencies", modName + ".node"));
};
// nodePtyUtils.loadNative = (modName: string): any => {
// return (typeof __non_webpack_require__ !== "undefined" ? __non_webpack_require__ : require)(path.join(dataDirectory, "dependencies", modName + ".node"));
// };
(<any>global).RIPGREP_LOCATION = path.join(dataDirectory, "dependencies", "rg");
(<any>global).NODEPTY_LOCATION = path.join(dataDirectory, "dependencies", "pty.node");
// tslint:disable-next-line:no-any
(<any>global).SPDLOG_LOCATION = path.join(dataDirectory, "dependencies", "spdlog.node");
// tslint:disable-next-line:no-unused-expression

View File

@ -23,7 +23,7 @@ export type SharedProcessEvent = {
};
export class SharedProcess {
public readonly socketPath: string = path.join(os.tmpdir(), `.vscode-remote${Math.random().toString()}`);
public readonly socketPath: string = os.platform() === "win32" ? path.join("\\\\?\\pipe", os.tmpdir(), `.code-server${Math.random().toString()}`) : path.join(os.tmpdir(), `.code-server${Math.random().toString()}`);
private _state: SharedProcessState = SharedProcessState.Stopped;
private activeProcess: ChildProcess | undefined;
private ipcHandler: StdioIpcHandler | undefined;