Title: [182089] trunk
Revision
182089
Author
mmaxfi...@apple.com
Date
2015-03-27 16:08:01 -0700 (Fri, 27 Mar 2015)

Log Message

Support building WTF on Windows without Cygwin
https://bugs.webkit.org/show_bug.cgi?id=143084

Reviewed by Brent Fulgham.

Tools:
Windows without Cygwin doesn't have curl, unzip, or grep. Luckily, Perl does all of these things.
This patch also migrates to using File::Spec->catfile() for directory separators.

* Scripts/update-webkit-dependency:
(wanted):
* Scripts/update-webkit-support-libs:
(wanted):
(downloadExpectedVersionNumber):
(zipFileVersion):
(toUnixPath): Deleted.
* Scripts/webkitdirs.pm:
(determineSourceDir):
(windowsSourceSourceDir):
(windowsLibrariesDir):
(windowsOutputDir):
(checkInstalledTools):
(buildVisualStudioProject):

Source/WTF:
Windows doesn't have "touch".

* WTF.vcxproj/WTFGenerated.make:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (182088 => 182089)


--- trunk/Source/WTF/ChangeLog	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Source/WTF/ChangeLog	2015-03-27 23:08:01 UTC (rev 182089)
@@ -1,3 +1,14 @@
+2015-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Support building WTF on Windows without Cygwin
+        https://bugs.webkit.org/show_bug.cgi?id=143084
+
+        Reviewed by Brent Fulgham.
+
+        Windows doesn't have "touch".
+
+        * WTF.vcxproj/WTFGenerated.make:
+
 2015-03-26  Alex Christensen  <achristen...@webkit.org>
 
         Progress towards CMake on Mac.

Modified: trunk/Source/WTF/WTF.vcxproj/WTFGenerated.make (182088 => 182089)


--- trunk/Source/WTF/WTF.vcxproj/WTFGenerated.make	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Source/WTF/WTF.vcxproj/WTFGenerated.make	2015-03-27 23:08:01 UTC (rev 182089)
@@ -1,5 +1,5 @@
 all: WTFHeaderDetection.h
-    @touch "%ConfigurationBuildDir%\buildfailed"
+    @type NUL > "%ConfigurationBuildDir%\buildfailed"
     @perl build-generated-files.pl "%ConfigurationBuildDir%" "$(WEBKIT_LIBRARIES)" "$(DEBUGSUFFIX)" "%PlatformArchitecture%"
 !IF "$(OFFICIAL_BUILD)"!="1"
     -@python2.7 work-around-vs-dependency-tracking-bugs.py

Modified: trunk/Tools/ChangeLog (182088 => 182089)


--- trunk/Tools/ChangeLog	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Tools/ChangeLog	2015-03-27 23:08:01 UTC (rev 182089)
@@ -1,3 +1,28 @@
+2015-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Support building WTF on Windows without Cygwin
+        https://bugs.webkit.org/show_bug.cgi?id=143084
+
+        Reviewed by Brent Fulgham.
+
+        Windows without Cygwin doesn't have curl, unzip, or grep. Luckily, Perl does all of these things.
+        This patch also migrates to using File::Spec->catfile() for directory separators.
+
+        * Scripts/update-webkit-dependency:
+        (wanted):
+        * Scripts/update-webkit-support-libs:
+        (wanted):
+        (downloadExpectedVersionNumber):
+        (zipFileVersion):
+        (toUnixPath): Deleted.
+        * Scripts/webkitdirs.pm:
+        (determineSourceDir):
+        (windowsSourceSourceDir):
+        (windowsLibrariesDir):
+        (windowsOutputDir):
+        (checkInstalledTools):
+        (buildVisualStudioProject):
+
 2015-03-27  Alex Christensen  <achristen...@webkit.org>
 
         Fix WinCairo bot.

Modified: trunk/Tools/Scripts/update-webkit-dependency (182088 => 182089)


--- trunk/Tools/Scripts/update-webkit-dependency	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Tools/Scripts/update-webkit-dependency	2015-03-27 23:08:01 UTC (rev 182089)
@@ -70,7 +70,7 @@
 my $sourceDir = sourceDir();
 my $file = getLibraryName($libsURL);
 my $zipFile = "$file.zip"; 
-my $webkitLibrariesDir = $ENV{'WEBKIT_LIBRARIES'} || "$sourceDir/WebKitLibraries/win";
+my $webkitLibrariesDir = $ENV{'WEBKIT_LIBRARIES'} || File::Spec->catdir($sourceDir, "WebKitLibraries", "win");
 my $tmpRelativeDir = File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR => 1, CLEANUP => 1);
 my $tmpAbsDir = File::Spec->rel2abs($tmpRelativeDir);
 
@@ -80,7 +80,7 @@
 
 if (defined $modified_time) {
 
-    open NEW, ">", "$tmpAbsDir/$file.headers";
+    open NEW, ">", File::Spec->catfile($tmpAbsDir, "$file.headers");
     print NEW "Last-Modified: " . time2str($modified_time) . "\n";
     close NEW;
 
@@ -91,14 +91,14 @@
     my $headerURL = $libsURL;
     $headerURL =~ s/\.zip$/\.headers/;
 
-    my $result = getstore($headerURL, "$tmpAbsDir/$file.headers");
+    my $result = getstore($headerURL, File::Spec->catfile($tmpAbsDir, "$file.headers"));
 
     if (!is_success($result)) {
         print STDERR "Couldn't check Last-Modified date of new $zipFile.\n";
         print STDERR "Please ensure that Perl can use LWP::Simple to connect to HTTPS urls, and that $libsURL is reachable.\n";
         print STDERR "You may have to run \$ cpan LWP::Protocol::https\n";
 
-        if (! -f "$webkitLibrariesDir/$file.headers") {
+        if (! -f File::Spec->catfile($webkitLibrariesDir, "$file.headers")) {
             print STDERR "Unable to check Last-Modified date and no version of $file to fall back to.\n";
             exit 1;
         }
@@ -108,11 +108,11 @@
     }
 }
 
-if (open NEW, "$tmpAbsDir/$file.headers") {
+if (open NEW, File::Spec->catfile($tmpAbsDir, "$file.headers")) {
     my $new = lastModifiedToUnixTime(<NEW>);
     close NEW;
 
-    if (defined $new && open OLD, "$webkitLibrariesDir/$file.headers") {
+    if (defined $new && open OLD, File::Spec->catfile($webkitLibrariesDir, "$file.headers")) {
         my $old = lastModifiedToUnixTime(<OLD>);
         close OLD;
         if (defined $old && abs($new - $old) < $newnessThreshold) {
@@ -124,10 +124,10 @@
 
 print "Downloading $zipFile...\n\n";
 print "$libsURL\n";
-my $result = getstore($libsURL, "$tmpAbsDir/$zipFile");
+my $result = getstore($libsURL, File::Spec->catfile($tmpAbsDir, $zipFile));
 die "Couldn't download $zipFile!" if is_error($result);
 
-my $zip = Archive::Zip->new("$tmpAbsDir/$zipFile");
+my $zip = Archive::Zip->new(File::Spec->catfile($tmpAbsDir, $zipFile));
 $result = $zip->extractTree("", $tmpAbsDir);
 die "Couldn't unzip $zipFile." if $result != AZ_OK;
 
@@ -135,8 +135,8 @@
 
 sub wanted
 {
-    my $relativeName = File::Spec->abs2rel($File::Find::name, "$tmpAbsDir/$file/$prefixInZip");
-    my $destination = "$webkitLibrariesDir/$relativeName";
+    my $relativeName = File::Spec->abs2rel($File::Find::name, File::Spec->catdir($tmpAbsDir, $file, $prefixInZip));
+    my $destination = File::Spec->catfile($webkitLibrariesDir, $relativeName);
 
     if (-d $_) {
         mkdir $destination;
@@ -146,9 +146,9 @@
     copy($_, $destination);
 }
 
-File::Find::find(\&wanted, "$tmpAbsDir/$file");
+File::Find::find(\&wanted, File::Spec->catfile($tmpAbsDir, $file));
 
-$result = move("$tmpAbsDir/$file.headers", $webkitLibrariesDir);
+$result = move(File::Spec->catfile($tmpAbsDir, "$file.headers"), $webkitLibrariesDir);
 print STDERR "Couldn't move $file.headers to $webkitLibrariesDir" . ".\n" if $result == 0;
 
 print "The $file has been sucessfully installed in\n $webkitLibrariesDir\n";

Modified: trunk/Tools/Scripts/update-webkit-support-libs (182088 => 182089)


--- trunk/Tools/Scripts/update-webkit-support-libs	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Tools/Scripts/update-webkit-support-libs	2015-03-27 23:08:01 UTC (rev 182089)
@@ -32,11 +32,14 @@
 use strict;
 use warnings;
 
+use Archive::Zip qw( :ERROR_CODES );
+use File::Copy;
 use File::Find;
 use File::Temp ();
 use File::Spec;
 use FindBin;
 use lib $FindBin::Bin;
+use LWP::Simple;
 use webkitdirs;
 
 use constant NOTAVERSION => "-1";
@@ -44,9 +47,9 @@
 my $sourceDir = sourceDir();
 my $file = "WebKitSupportLibrary";
 my $zipFile = "$file.zip"; 
-my $zipDirectory = toUnixPath($ENV{'WEBKITSUPPORTLIBRARIESZIPDIR'}) || $sourceDir;
+my $zipDirectory = $ENV{'WEBKITSUPPORTLIBRARIESZIPDIR'} || $sourceDir;
 my $pathToZip = File::Spec->catfile($zipDirectory, $zipFile);
-my $webkitLibrariesDir = toUnixPath($ENV{'WEBKIT_LIBRARIES'}) || "$sourceDir/WebKitLibraries/win";
+my $webkitLibrariesDir = $ENV{'WEBKIT_LIBRARIES'} || File::Spec->catdir($sourceDir, "WebKitLibraries", "win");
 my $versionFile = $file . "Version";
 my $pathToVersionFile = File::Spec->catfile($webkitLibrariesDir, $versionFile);
 my $tmpRelativeDir = File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR => 1, CLEANUP => 1);
@@ -71,37 +74,30 @@
     exit;
 }
 
-my $result = system "unzip", "-q", "-d", $tmpAbsDir, $pathToZip;
-die "Couldn't unzip $zipFile." if $result;
+my $zip = Archive::Zip->new($pathToZip);
+my $result = $zip->extractTree("", $tmpAbsDir);
+die "Couldn't unzip $zipFile." if $result != AZ_OK;
 
 print "\nInstalling $file...\n";
 
 sub wanted
 {
-    my $relativeName = File::Spec->abs2rel($File::Find::name, "$tmpAbsDir/$file/win");
-    my $destination = "$webkitLibrariesDir/$relativeName";
+    my $relativeName = File::Spec->abs2rel($File::Find::name, File::Spec->catdir($tmpAbsDir, "$file", "win"));
+    my $destination = File::Spec->catfile($webkitLibrariesDir, $relativeName);
 
     if (-d $_) {
         mkdir $destination;
         return;
     }
 
-    system "cp", $_, $destination;
+    copy($_, $destination);
 }
 
-File::Find::find(\&wanted, "$tmpAbsDir/$file");
+File::Find::find(\&wanted, File::Spec->catfile($tmpAbsDir, $file));
 
 print "The $file has been sucessfully installed in\n $webkitLibrariesDir\n";
 exit;
 
-sub toUnixPath
-{
-    my $path = shift;
-    return unless $path;
-    chomp($path = `cygpath -u '$path'`);
-    return $path;
-}
-
 sub extractedVersion
 {
     if (open VERSION, "<", $pathToVersionFile) {
@@ -114,14 +110,15 @@
 
 sub downloadExpectedVersionNumber
 {
-    chomp(my $expectedVersion = `curl -s --sslv3 -k $versionFileURL`);
-    return WEXITSTATUS($?) ? NOTAVERSION : $expectedVersion;
+    chomp(my $expectedVersion = get($versionFileURL));
+    return defined $expectedVersion ? $expectedVersion : NOTAVERSION;
 }
 
 sub zipFileVersion
 {
     return NOTAVERSION unless -f $pathToZip;
-    chomp(my $zipFileVersion = `unzip -p "$pathToZip" $file/win/$versionFile`);
+    my $zip = Archive::Zip->new($pathToZip);
+    chomp(my $zipFileVersion = $zip->contents("$file/win/$versionFile"));
     return $zipFileVersion;
 }
 

Modified: trunk/Tools/Scripts/webkitdirs.pm (182088 => 182089)


--- trunk/Tools/Scripts/webkitdirs.pm	2015-03-27 23:01:37 UTC (rev 182088)
+++ trunk/Tools/Scripts/webkitdirs.pm	2015-03-27 23:08:01 UTC (rev 182089)
@@ -144,14 +144,14 @@
 
     # walks up path checking each directory to see if it is the main WebKit project dir, 
     # defined by containing Sources, WebCore, and WebKit
-    until ((-d "$sourceDir/Source" && -d "$sourceDir/Source/WebCore" && -d "$sourceDir/Source/WebKit") || (-d "$sourceDir/Internal" && -d "$sourceDir/OpenSource"))
+    until ((-d File::Spec->catdir($sourceDir, "Source") && -d File::Spec->catdir($sourceDir, "Source", "WebCore") && -d File::Spec->catdir($sourceDir, "Source", "WebKit")) || (-d File::Spec->catdir($sourceDir, "Internal") && -d File::Spec->catdir($sourceDir, "OpenSource")))
     {
         if ($sourceDir !~ s|/[^/]+$||) {
             die "Could not find top level webkit directory above source directory using FindBin.\n";
         }
     }
 
-    $sourceDir = "$sourceDir/OpenSource" if -d "$sourceDir/OpenSource";
+    $sourceDir = File::Spec->catdir($sourceDir, "OpenSource") if -d File::Spec->catdir($sourceDir, "OpenSource");
 }
 
 sub currentPerlPath()
@@ -1433,17 +1433,17 @@
 
 sub windowsSourceSourceDir()
 {
-    return windowsSourceDir() . "\\Source";
+    return File::Spec->catdir(windowsSourceDir(), "Source");
 }
 
 sub windowsLibrariesDir()
 {
-    return windowsSourceDir() . "\\WebKitLibraries\\win";
+    return File::Spec->catdir(windowsSourceDir(), "WebKitLibraries", "win");
 }
 
 sub windowsOutputDir()
 {
-    return windowsSourceDir() . "\\WebKitBuild";
+    return File::Spec->catdir(windowsSourceDir(), "WebKitBuild");
 }
 
 sub fontExists($)
@@ -1456,26 +1456,20 @@
 
 sub checkInstalledTools()
 {
-    # SVN 1.7.10 is known to be compatible with current servers. SVN 1.8.x seems to be missing some authentication
-    # protocols we use for svn.webkit.org:
-    my $svnVersion = `svn --version 2> NUL | grep "\\sversion"`;
-    chomp($svnVersion);
-    if (!$? and $svnVersion =~ /1\.8\./) {
-        print "svn 1.7.10 is known to be compatible with our servers. You are running $svnVersion,\nwhich may not work properly.\n"
-    }
-
     # environment variables. Avoid until this is corrected.
     my $pythonVer = `python --version 2>&1`;
     die "You must have Python installed to build WebKit.\n" if ($?);
 
     # cURL 7.34.0 has a bug that prevents authentication with opensource.apple.com (and other things using SSL3).
-    my $curlVer = `curl --version 2> NUL | grep "curl"`;
-    chomp($curlVer);
-    if (!$? and $curlVer =~ /libcurl\/7\.34\.0/) {
-        print "cURL version 7.34.0 has a bug that prevents authentication with SSL v2 or v3.\n";
-        print "cURL 7.33.0 is known to work. The cURL projects is preparing an update to\n";
-        print "correct this problem.\n\n";
-        die "Please install a working cURL and try again.\n";
+    my $curlVer = `curl --version 2> NUL`;
+    if (!$? and $curlVer =~ "(.*curl.*)") {
+        $curlVer = $1;
+        if ($curlVer =~ /libcurl\/7\.34\.0/) {
+            print "cURL version 7.34.0 has a bug that prevents authentication with SSL v2 or v3.\n";
+            print "cURL 7.33.0 is known to work. The cURL projects is preparing an update to\n";
+            print "correct this problem.\n\n";
+            die "Please install a working cURL and try again.\n";
+        }
     }
 
     # MathML requires fonts that do not ship with Windows (at least through Windows 8). Warn the user if they are missing
@@ -1675,7 +1669,7 @@
 
     my $platform = "/p:Platform=" . (isWin64() ? "x64" : "Win32");
     my $logPath = File::Spec->catdir($baseProductDir, $configuration);
-    File::Path->make_path($logPath) unless -d $logPath or $logPath eq ".";
+    make_path($logPath) unless -d $logPath or $logPath eq ".";
 
     my $errorLogFile = File::Spec->catfile($logPath, "webkit_errors.log");
     chomp($errorLogFile = `cygpath -w "$errorLogFile"`) if isCygwin();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to