Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 596b3de

Browse files
committed
src: Do not set the --msvs_version= flag
In modern node-gyp, this flag only serves to limit node-gyp to using a specific version of Visual Studio. It can't make node-gyp find a version it wouldn't have found. Our checks are much less sophisticated at detecting usable installations of Visual Studio. We should let node-gyp use the install of Visual Studio/Build Tools it thinks is best. It will pick any usable Visual Studio install, preferring the newest if multiple are installed and usable. It generally will not pick one mistakenly that it actually can't use. Given that the stakes are "we might prevent a valid installation of Visual Studio from being used," and there is no benefit to be had, this flag should not be set.
1 parent 8eb9564 commit 596b3de

File tree

5 files changed

+0
-22
lines changed

5 files changed

+0
-22
lines changed

src/ci.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ class Ci extends Command
4848
]
4949
installArgs.push('--verbose') if options.argv.verbose
5050

51-
if vsArgs = @getVisualStudioFlags()
52-
installArgs.push(vsArgs)
53-
5451
fs.makeTreeSync(@atomDirectory)
5552

5653
env = _.extend({}, process.env, {HOME: @atomNodeDirectory, RUSTUP_HOME: config.getRustupHomeDirPath()})

src/command.coffee

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ class Command
112112
env.npm_config_arch = config.getElectronArch()
113113
env.npm_config_target_arch = config.getElectronArch() # for node-pre-gyp
114114

115-
getVisualStudioFlags: ->
116-
if vsVersion = config.getInstalledVisualStudioFlag()
117-
"--msvs_version=#{vsVersion}"
118-
119115
getNpmBuildFlags: ->
120116
["--target=#{@electronVersion}", "--disturl=#{config.getElectronUrl()}", "--arch=#{config.getElectronArch()}"]
121117

src/dedupe.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ class Dedupe extends Command
4343
dedupeArgs.push('--silent') if options.argv.silent
4444
dedupeArgs.push('--quiet') if options.argv.quiet
4545

46-
if vsArgs = @getVisualStudioFlags()
47-
dedupeArgs.push(vsArgs)
48-
4946
dedupeArgs.push(packageName) for packageName in options.argv._
5047

5148
fs.makeTreeSync(@atomDirectory)

src/install.coffee

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ class Install extends Command
7070
installArgs.push('--quiet') if options.argv.quiet
7171
installArgs.push('--production') if options.argv.production
7272

73-
if vsArgs = @getVisualStudioFlags()
74-
installArgs.push(vsArgs)
75-
7673
fs.makeTreeSync(@atomDirectory)
7774

7875
env = _.extend({}, process.env, {HOME: @atomNodeDirectory, RUSTUP_HOME: config.getRustupHomeDirPath()})
@@ -165,9 +162,6 @@ class Install extends Command
165162
installArgs.push('--quiet') if options.argv.quiet
166163
installArgs.push('--production') if options.argv.production
167164

168-
if vsArgs = @getVisualStudioFlags()
169-
installArgs.push(vsArgs)
170-
171165
fs.makeTreeSync(@atomDirectory)
172166

173167
env = _.extend({}, process.env, {HOME: @atomNodeDirectory, RUSTUP_HOME: config.getRustupHomeDirPath()})
@@ -378,9 +372,6 @@ class Install extends Command
378372
buildArgs.push(path.resolve(__dirname, '..', 'native-module'))
379373
buildArgs.push(@getNpmBuildFlags()...)
380374

381-
if vsArgs = @getVisualStudioFlags()
382-
buildArgs.push(vsArgs)
383-
384375
fs.makeTreeSync(@atomDirectory)
385376

386377
env = _.extend({}, process.env, {HOME: @atomNodeDirectory, RUSTUP_HOME: config.getRustupHomeDirPath()})

src/rebuild.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class Rebuild extends Command
3838
rebuildArgs.push(@getNpmBuildFlags()...)
3939
rebuildArgs.push(options.argv._...)
4040

41-
if vsArgs = @getVisualStudioFlags()
42-
rebuildArgs.push(vsArgs)
43-
4441
fs.makeTreeSync(@atomDirectory)
4542

4643
env = _.extend({}, process.env, {HOME: @atomNodeDirectory, RUSTUP_HOME: config.getRustupHomeDirPath()})

0 commit comments

Comments
 (0)