Skip to content

Commit f2f417a

Browse files
committed
Drop Windows MSVC env setup
after crystal-lang/crystal#11496
1 parent 1219d2f commit f2f417a

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

index.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const Util = require("util");
1111
const FS = require("fs").promises;
1212

1313
const {cmpTags} = require("tag-cmp");
14-
const exec = Util.promisify(ChildProcess.exec);
1514
const execFile = Util.promisify(ChildProcess.execFile);
1615

1716
async function run() {
@@ -362,44 +361,9 @@ async function installCrystalForWindows({crystal, arch = "x86_64", path}) {
362361
await IO.mv(await downloadCrystalNightlyForWindows(), path);
363362

364363
Core.info("Setting up environment for Crystal");
365-
const vars = await variablesForVCBuildTools();
366-
for (const [k, v] of vars.entries()) {
367-
Core.exportVariable(k, v);
368-
}
369364
Core.addPath(path);
370365
}
371366

372-
const outputSep = "---";
373-
const vcvarsPath = String.raw`C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat`;
374-
375-
async function variablesForVCBuildTools() {
376-
const command = `set && echo ${outputSep} && "${vcvarsPath}" >nul && set`;
377-
Core.info(`[command]cmd /c "${command}"`);
378-
const {stdout} = await exec(command, {shell: "cmd"});
379-
Core.debug(JSON.stringify(stdout));
380-
return new Map(getChangedVars(stdout.trimEnd().split(/\r?\n/)));
381-
}
382-
383-
function* getChangedVars(lines) {
384-
const vars = new Map();
385-
lines = lines[Symbol.iterator]();
386-
for (const line of lines) {
387-
if (line.trimEnd() === outputSep) {
388-
break;
389-
}
390-
const [key, value] = line.split(/=(.+)/, 2);
391-
vars.set(key.toLowerCase(), value);
392-
}
393-
for (const line of lines) {
394-
const [key, value] = line.split(/=(.+)/, 2);
395-
if (vars.get(key.toLowerCase()) !== value) {
396-
yield [key, value];
397-
} else {
398-
Core.debug("Unchanged: " + key);
399-
}
400-
}
401-
}
402-
403367
async function downloadCrystalNightlyForWindows() {
404368
Core.info("Looking for latest Crystal build");
405369

0 commit comments

Comments
 (0)