Modified: trunk/Tools/Scripts/build-webkit (224265 => 224266)
--- trunk/Tools/Scripts/build-webkit 2017-11-01 00:21:20 UTC (rev 224265)
+++ trunk/Tools/Scripts/build-webkit 2017-11-01 00:29:19 UTC (rev 224266)
@@ -245,10 +245,6 @@
(system("perl Tools/Scripts/update-webkit-support-libs") == 0) or die;
}
-if (isAnyWindows()) {
- system("python Tools/Scripts/update-vswhere.py");
-}
-
# If asked to build just the WebKit project, overwrite the projects
# list after all of the port specific tweaks have been made to
# build options, etc.
Deleted: trunk/Tools/Scripts/update-vswhere.py (224265 => 224266)
--- trunk/Tools/Scripts/update-vswhere.py 2017-11-01 00:21:20 UTC (rev 224265)
+++ trunk/Tools/Scripts/update-vswhere.py 2017-11-01 00:29:19 UTC (rev 224266)
@@ -1,42 +0,0 @@
-#! /usr/bin/env python
-#
-# Copyright (C) 2017 Sony Interactive Entertainment Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import importlib
-import sys
-import os
-import stat
-
-download = importlib.import_module('download-latest-github-release')
-
-repo = 'Microsoft/vswhere'
-file = 'vswhere.exe'
-output = 'WebKitLibraries/win/tools'
-
-result = download.main(['-o', output, repo, file])
-
-if result == download.Status.COULD_NOT_FIND:
- sys.exit(1)
-
-os.chmod(os.path.join(output, file), 0777)
Modified: trunk/Tools/Scripts/webkitdirs.pm (224265 => 224266)
--- trunk/Tools/Scripts/webkitdirs.pm 2017-11-01 00:21:20 UTC (rev 224265)
+++ trunk/Tools/Scripts/webkitdirs.pm 2017-11-01 00:29:19 UTC (rev 224266)
@@ -35,8 +35,6 @@
use Config;
use Cwd qw(realpath);
use Digest::MD5 qw(md5_hex);
-use Encode;
-use Encode::Locale;
use FindBin;
use File::Basename;
use File::Find;
@@ -44,7 +42,6 @@
use File::Spec;
use File::Temp qw(tempdir);
use File::stat;
-use JSON::PP;
use List::Util;
use POSIX;
use Time::HiRes qw(usleep);
@@ -163,8 +160,6 @@
my $windowsSourceDir;
my $winVersion;
my $willUseVCExpressWhenBuilding = 0;
-my $vsWhereFoundInstallation;
-my $vsWhereLegacyInstallation;
# Defined in VCSUtils.
sub exitStatus($);
@@ -594,71 +589,6 @@
return $programFilesPathX86;
}
-sub pickCurrentVisualStudioInstallation
-{
- return $vsWhereFoundInstallation if defined $vsWhereFoundInstallation;
-
- determineSourceDir();
-
- # Prefer Enterprise, then Professional, then Community, then
- # anything else that provides MSBuild.
- foreach my $productType ((
- 'Microsoft.VisualStudio.Product.Enterprise',
- 'Microsoft.VisualStudio.Product.Professional',
- 'Microsoft.VisualStudio.Product.Community',
- undef
- )) {
- my $command = "$sourceDir/WebKitLibraries/win/tools/vswhere -nologo -latest -format json -requires Microsoft.Component.MSBuild";
- if (defined $productType) {
- $command .= " -products $productType";
- }
- my $vsWhereOut = `$command`;
- my $installations = [];
- eval {
- $installations = decode_json Encode::encode('UTF-8' => Encode::decode(console_in => $vsWhereOut));
- };
- print "Error getting Visual Studio Location: $@\n" if $@;
- undef $@;
-
- if (scalar @$installations) {
- my $installation = $installations->[0];
- $vsWhereFoundInstallation = $installation;
- return $installation;
- }
- }
- return undef;
-}
-
-sub pickLegacyVisualStudioInstallation
-{
- return $vsWhereLegacyInstallation if defined $vsWhereLegacyInstallation;
-
- determineSourceDir();
-
- my $vsWhereOut = `$sourceDir/WebKitLibraries/win/tools/vswhere -nologo -legacy -format json`;
- my $installations_all = [];
- eval {
- $installations_all = decode_json Encode::encode('UTF-8' => Encode::decode(console_in => $vsWhereOut));
- };
- print "Error getting Visual Studio Legacy Location: $@\n" if $@;
- undef $@;
-
- # It's possible that a non-legacy installation without msbuild
- # would not be found by the latest, but would be found by this
- # vswhere call, and we want to skip those, so check for versions
- # with an installation version before 15.0.
- my @installations = grep { (+$_->{installationVersion}) < 15 } @$installations_all;
-
- # We don't get much information that would let us choose between
- # legacy installations, so we'll take the first.
- if (scalar @installations) {
- my $installation = $installations[0];
- $vsWhereLegacyInstallation = $installation;
- return $installation;
- }
- return undef;
-}
-
sub visualStudioInstallDir
{
return $vsInstallDir if defined $vsInstallDir;
@@ -667,14 +597,10 @@
$vsInstallDir = $ENV{'VSINSTALLDIR'};
$vsInstallDir =~ s|[\\/]$||;
} else {
- $vsInstallDir = visualStudioInstallDirVSWhere();
+ $vsInstallDir = File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio", "2017", "Community");
if (not -e $vsInstallDir) {
- $vsInstallDir = visualStudioInstallDirLegacy();
+ $vsInstallDir = File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio 14.0");
}
- if (not -e $vsInstallDir) {
- $vsInstallDir = visualStudioInstallDirFallback();
- print "Fallback $vsInstallDir\n";
- }
}
chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin();
@@ -682,56 +608,14 @@
return $vsInstallDir;
}
-sub visualStudioInstallDirVSWhere
-{
- pickCurrentVisualStudioInstallation();
- if (defined($vsWhereFoundInstallation)) {
- return $vsWhereFoundInstallation->{installationPath};
- }
- return undef;
-}
-
-sub visualStudioInstallDirLegacy
-{
- pickLegacyVisualStudioInstallation();
- if (defined($vsWhereLegacyInstallation)) {
- return $vsWhereLegacyInstallation->{installationPath};
- }
- return undef;
-}
-
-sub visualStudioInstallDirFallback
-{
- foreach my $productType ((
- 'Enterprise',
- 'Professional',
- 'Community',
- )) {
- my $installdir = File::Spec->catdir(programFilesPathX86(),
- "Microsoft Visual Studio", "2017", $productType);
- my $msbuilddir = File::Spec->catdir($installdir,
- "MSBuild", "15.0", "bin");
- if (-e $installdir && -e $msbuilddir) {
- return $installdir;
- }
- }
- return File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio 14.0");
-}
-
sub msBuildInstallDir
{
return $msBuildInstallDir if defined $msBuildInstallDir;
- my $version = visualStudioVersion();
- if ($version >= 15.0) {
- my $installDir = visualStudioInstallDir();
- $msBuildInstallDir = File::Spec->catdir($installDir,
- "MSBuild", $version, "bin");
- } else {
- $msBuildInstallDir = File::Spec->catdir(programFilesPathX86(),
- "MSBuild", "14.0", "Bin")
+ $msBuildInstallDir = File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin");
+ if (not -e $msBuildInstallDir) {
+ $msBuildInstallDir = File::Spec->catdir(programFilesPathX86(), "MSBuild", "14.0", "Bin");
}
-
chomp($msBuildInstallDir = `cygpath "$msBuildInstallDir"`) if isCygwin();
print "Using MSBuild: $msBuildInstallDir\n";
@@ -743,30 +627,13 @@
return $vsVersion if defined $vsVersion;
my $installDir = visualStudioInstallDir();
- $vsVersion = visualStudioVersionFromInstallDir($installDir);
+ $vsVersion = ($installDir =~ /Microsoft Visual Studio ([0-9]+\.[0-9]*)/) ? $1 : "14";
+
print "Using Visual Studio $vsVersion\n";
return $vsVersion;
}
-sub visualStudioVersionFromInstallDir
-{
- my ($dir) = @_;
- my $version;
-
- if ($dir =~ m|Microsoft Visual Studio[/\\]2017|) {
- $version = "15.0";
- }
-
- if (!defined($version)) {
- if ($dir =~ /Microsoft Visual Studio ([0-9]+\.[0-9]*)/) {
- $version = $1;
- }
- }
-
- return $version;
-}
-
sub determineConfigurationForVisualStudio
{
return if defined $configurationForVisualStudio;
@@ -2217,11 +2084,7 @@
push @args, "Ninja";
}
} elsif (isAnyWindows() && isWin64()) {
- if (visualStudioVersion() >= 15) {
- push @args, '-G "Visual Studio 15 2017 Win64"';
- } else {
- push @args, '-G "Visual Studio 14 2015 Win64"';
- }
+ push @args, '-G "Visual Studio 14 2015 Win64"';
}
# Do not show progress of generating bindings in interactive Ninja build not to leave noisy lines on tty
push @args, '-DSHOW_BINDINGS_GENERATION_PROGRESS=1' unless ($willUseNinja && -t STDOUT);