Changeset 244171 in webkit


Ignore:
Timestamp:
Apr 10, 2019 5:08:34 PM (5 years ago)
Author:
Fujii Hironori
Message:

[Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
https://bugs.webkit.org/show_bug.cgi?id=196760

Reviewed by Don Olmstead.

vswhere.exe has been bundled since Visual Studio 2017 version
15.2. We shouldn't download vswhere.exe.

  • Scripts/build-jsc: Do not call update-vswhere.py.
  • Scripts/build-webkit: Ditto.
  • Scripts/update-vswhere.py: Removed.
  • Scripts/webkitdirs.pm:

(requireModulesForVSWhere): Deleted.
(pickCurrentVisualStudioInstallation): Deleted.
(visualStudioInstallDirVSWhere): Return the latest installed VS
installation path by using the bundled vswhere.exe.
(setupCygwinEnv): Removed a unused variable $visualStudioPath.
(visualStudioInstallDirFallback): Removed.

Location:
trunk/Tools
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r244164 r244171  
     12019-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
     4        https://bugs.webkit.org/show_bug.cgi?id=196760
     5
     6        Reviewed by Don Olmstead.
     7
     8        vswhere.exe has been bundled since Visual Studio 2017 version
     9        15.2. We shouldn't download vswhere.exe.
     10
     11        * Scripts/build-jsc: Do not call update-vswhere.py.
     12        * Scripts/build-webkit: Ditto.
     13        * Scripts/update-vswhere.py: Removed.
     14        * Scripts/webkitdirs.pm:
     15        (requireModulesForVSWhere): Deleted.
     16        (pickCurrentVisualStudioInstallation): Deleted.
     17        (visualStudioInstallDirVSWhere): Return the latest installed VS
     18        installation path by using the bundled vswhere.exe.
     19        (setupCygwinEnv): Removed a unused variable $visualStudioPath.
     20        (visualStudioInstallDirFallback): Removed.
     21
    1222019-04-10  Aakash Jain  <aakash_jain@apple.com>
    223
  • trunk/Tools/Scripts/build-jsc

    r243676 r244171  
    126126if (isWinCairo() || (isJSCOnly() && isWindows())) {
    127127    (system("python Tools/Scripts/update-webkit-wincairo-libs.py") == 0) or die;
    128     system("python Tools/Scripts/update-vswhere.py");
    129128}
    130129
  • trunk/Tools/Scripts/build-webkit

    r237887 r244171  
    260260}
    261261
    262 if (isAnyWindows()) {
    263     system("python Tools/Scripts/update-vswhere.py");
    264 }
    265 
    266262# If asked to build just the WebKit project, overwrite the projects
    267263# list after all of the port specific tweaks have been made to
  • trunk/Tools/Scripts/webkitdirs.pm

    r243293 r244171  
    166166my $windowsSourceDir;
    167167my $winVersion;
    168 my $vsWhereFoundInstallation;
    169168
    170169# Defined in VCSUtils.
     
    647646}
    648647
    649 sub requireModulesForVSWhere
    650 {
    651     require Encode;
    652     require Encode::Locale;
    653     require JSON::PP;
    654 }
    655 
    656 sub pickCurrentVisualStudioInstallation
    657 {
    658     return $vsWhereFoundInstallation if defined $vsWhereFoundInstallation;
    659 
    660     requireModulesForVSWhere();
    661     determineSourceDir();
    662 
    663     # Prefer Enterprise, then Professional, then Community, then
    664     # anything else that provides MSBuild.
    665     foreach my $productType ((
    666         'Microsoft.VisualStudio.Product.Enterprise',
    667         'Microsoft.VisualStudio.Product.Professional',
    668         'Microsoft.VisualStudio.Product.Community',
    669         undef
    670     )) {
    671         my $command = "$sourceDir/WebKitLibraries/win/tools/vswhere -nologo -latest -format json -requires Microsoft.Component.MSBuild";
    672         if (defined $productType) {
    673             $command .= " -products $productType";
    674         }
    675         my $vsWhereOut = `$command`;
    676         my $installations = [];
    677         eval {
    678             $installations = JSON::PP::decode_json(Encode::encode('UTF-8' => Encode::decode(console_in => $vsWhereOut)));
    679         };
    680         print "Error getting Visual Studio Location: $@\n" if $@;
    681         undef $@;
    682 
    683         if (scalar @$installations) {
    684             my $installation = $installations->[0];
    685             $vsWhereFoundInstallation = $installation;
    686             return $installation;
    687         }
    688     }
    689     return undef;
     648sub visualStudioInstallDirVSWhere
     649{
     650    my $vswhere = File::Spec->catdir(programFilesPathX86(), "Microsoft Visual Studio", "Installer", "vswhere.exe");
     651    return unless -e $vswhere;
     652    open(my $handle, "-|", $vswhere, qw(-nologo -latest -requires Microsoft.Component.MSBuild -property installationPath)) || return;
     653    my $vsWhereOut = <$handle>;
     654    $vsWhereOut =~ s/\r?\n//;
     655    return $vsWhereOut;
    690656}
    691657
     
    699665    } else {
    700666        $vsInstallDir = visualStudioInstallDirVSWhere();
    701         if (not -e $vsInstallDir) {
    702             $vsInstallDir = visualStudioInstallDirFallback();
    703         }
     667        return unless defined $vsInstallDir;
    704668    }
    705669    chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin();
     
    707671    print "Using Visual Studio: $vsInstallDir\n";
    708672    return $vsInstallDir;
    709 }
    710 
    711 sub visualStudioInstallDirVSWhere
    712 {
    713     pickCurrentVisualStudioInstallation();
    714     if (defined($vsWhereFoundInstallation)) {
    715         return $vsWhereFoundInstallation->{installationPath};
    716     }
    717     return undef;
    718 }
    719 
    720 sub visualStudioInstallDirFallback
    721 {
    722     foreach my $productType ((
    723         'Enterprise',
    724         'Professional',
    725         'Community',
    726     )) {
    727         my $installdir = File::Spec->catdir(programFilesPathX86(),
    728             "Microsoft Visual Studio", "2017", $productType);
    729         my $msbuilddir = File::Spec->catdir($installdir,
    730             "MSBuild", "15.0", "bin");
    731         if (-e $installdir && -e $msbuilddir) {
    732             return $installdir;
    733         }
    734     }
    735     return undef;
    736673}
    737674
     
    18951832
    18961833    my $programFilesPath = programFilesPath();
    1897     my $visualStudioPath = File::Spec->catfile(visualStudioInstallDir(), qw(Common7 IDE devenv.com));
    18981834
    18991835    print "Building results into: ", baseProductDir(), "\n";
Note: See TracChangeset for help on using the changeset viewer.