Skip to content

Commit 2c56d7e

Browse files
committed
fix: disable msvc installation in CI temporarily
1 parent 531e651 commit 2c56d7e

File tree

3 files changed

+37
-30
lines changed

3 files changed

+37
-30
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/msvc/msvc.ts

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { setupChocoPack } from "../utils/setup/setupChocoPack"
2-
import { error, exportVariable } from "@actions/core"
2+
import { error, exportVariable, warning } from "@actions/core"
33
import { existsSync } from "fs"
4+
import { isCI } from "../utils/env/isci"
45

56
type MSVCVersion = "2015" | "2017" | "2019" | string
67

@@ -33,37 +34,43 @@ export async function setupMSVC(
3334
}
3435
let toolset: string | undefined
3536
let VCTargetsPath: string | undefined
36-
try {
37-
if (version === "2015") {
38-
toolset = "14.0.25420.1"
39-
await setupChocoPack("visualcpp-build-tools", toolset, [
40-
"--ignore-dependencies",
41-
"--params",
42-
"'/IncludeRequired'",
43-
])
37+
if (!isCI()) {
38+
// TODO enable this code path once its bugs are fixed
39+
// https://github.com/aminya/setup-cpp/issues/1
40+
warning("Installing MSVC is experimental and known to fail.")
41+
try {
42+
if (version === "2015") {
43+
toolset = "14.0.25420.1"
44+
await setupChocoPack("visualcpp-build-tools", toolset, [
45+
"--ignore-dependencies",
46+
"--params",
47+
"'/IncludeRequired'",
48+
])
4449

45-
VCTargetsPath = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"
46-
if (existsSync(VCTargetsPath)) {
47-
exportVariable("VCTargetsPath", VCTargetsPath)
50+
VCTargetsPath = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"
51+
if (existsSync(VCTargetsPath)) {
52+
exportVariable("VCTargetsPath", VCTargetsPath)
53+
}
54+
} else if (version === "2017") {
55+
toolset = "14.16"
56+
await setupChocoPack("visualstudio2017buildtools", "15.9.38.0", [
57+
"--package-parameters",
58+
"'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'",
59+
])
60+
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16" // TODO verify path
61+
} else if (version === "2019") {
62+
toolset = "14.29.30133"
63+
await setupChocoPack("visualstudio2019buildtools", "16.11.2.0", [
64+
"--package-parameters",
65+
"'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'",
66+
])
67+
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
4868
}
49-
} else if (version === "2017") {
50-
toolset = "14.16"
51-
await setupChocoPack("visualstudio2017buildtools", "15.9.38.0", [
52-
"--package-parameters",
53-
"'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'",
54-
])
55-
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16" // TODO verify path
56-
} else if (version === "2019") {
57-
toolset = "14.29.30133"
58-
await setupChocoPack("visualstudio2019buildtools", "16.11.2.0", [
59-
"--package-parameters",
60-
"'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'",
61-
])
62-
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
69+
} catch (e) {
70+
error(e as string | Error)
6371
}
64-
} catch (e) {
65-
error(e as string | Error)
6672
}
73+
// run vcvarsall.bat environment variables
6774
activateMSVC(VCTargetsPath, arch, toolset, sdk, uwp, spectre)
6875
}
6976

0 commit comments

Comments
 (0)