Remove Nix files from Tools

https://bugs.webkit.org/show_bug.cgi?id=127418

Reviewed by Csaba Osztrogonác.

* Scripts/build-webkit:
* Scripts/update-webkit-libs-jhbuild:
* Scripts/webkitdirs.pm:
(determineArchitecture):
(argumentsForConfiguration):
(jscProductDir):
(builtDylibPathForName):
(isAppleWebKit):
(launcherPath):
(launcherName):
(checkRequiredSystemConfig):
(copyInspectorFrontendFiles):
(jhbuildWrapperPrefixIfNeeded):
(buildCMakeProjectOrExit):
(cmakeBasedPortName):
* Scripts/webkitpy/common/config/ports.py:
(DeprecatedPort.port):
(EflWK2Port.build_webkit_command):
* Scripts/webkitpy/port/factory.py:
(platform_options):
(PortFactory):
* Scripts/webkitpy/port/nix.py: Removed.
* Scripts/webkitpy/port/nix_unittest.py: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9e4b6433
2014-01-22 Jinwoo Song <jinwoo7.song@samsung.com>
Remove Nix files from Tools
https://bugs.webkit.org/show_bug.cgi?id=127418
Reviewed by Csaba Osztrogonác.
* Scripts/build-webkit:
* Scripts/update-webkit-libs-jhbuild:
* Scripts/webkitdirs.pm:
(determineArchitecture):
(argumentsForConfiguration):
(jscProductDir):
(builtDylibPathForName):
(isAppleWebKit):
(launcherPath):
(launcherName):
(checkRequiredSystemConfig):
(copyInspectorFrontendFiles):
(jhbuildWrapperPrefixIfNeeded):
(buildCMakeProjectOrExit):
(cmakeBasedPortName):
* Scripts/webkitpy/common/config/ports.py:
(DeprecatedPort.port):
(EflWK2Port.build_webkit_command):
* Scripts/webkitpy/port/factory.py:
(platform_options):
(PortFactory):
* Scripts/webkitpy/port/nix.py: Removed.
* Scripts/webkitpy/port/nix_unittest.py: Removed.
2014-01-21 Benjamin Poulain <benjamin@webkit.org>
Add Ian and Ricky to the contributor list
......
......@@ -64,43 +64,9 @@ my $noWebKit1 = 0;
my $noWebKit2 = 0;
my $coverageSupport = 0;
my $startTime = time();
my $curl = 0;
my $opengles2 = 0;
my @features = getFeatureOptionList();
# Update defaults for the Nix port
if (isNix()) {
# Instead of use FeatureList.pm to list enabled features, tell the compiler to
# parse Source/WTF/wtf/Platform.h and get the default values of all feature flags
# from the result.
my $portDefine = "BUILDING_".uc(cmakeBasedPortName())."__";
my $definitions = `gcc -E -P -dM -D$portDefine -I Source/WTF Source/WTF/wtf/Platform.h | grep '^#define ENABLE_\\w\\+ \[01\]\$\\|^#define WTF_USE_\\w\\+ \[01\]\$' | cut -d' ' -f2-3`;
my %featureDefaults;
foreach (split(/\n/, $definitions)) {
my @macroDefinition = split(/ /);
$featureDefaults{$macroDefinition[0]} = $macroDefinition[1];
}
@features = ();
foreach (sort keys %featureDefaults) {
next if (!/^ENABLE/);
my $optionName = lc $_;
$optionName =~ s/^enable_//;
$optionName =~ s/_/-/g;
my $descName = $optionName;
$descName =~ s/-/ /g;
push @features, {
option => $optionName,
desc => "Toggle $descName support",
define => $_,
default => $featureDefaults{$_}
};
}
}
# Additional environment parameters
push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'});
......@@ -129,7 +95,6 @@ Usage: $programName [options] [options to pass to build system]
--coverage Enable Code Coverage support (Mac only)
--efl Build the EFL port
--nix Build the Nix port
--gtk Build the GTK+ port
--wincairo Build using Cairo (rather than CoreGraphics) on Windows
--wince Build the WinCE port
......@@ -146,9 +111,6 @@ Usage: $programName [options] [options to pass to build system]
--no-webkit1 Omit WebKit1 code from the build (EFL/GTK only)
--no-webkit2 Omit WebKit2 code from the build
--curl Use libCurl as network backend (Nix only)
--opengles2 Use EGL and OpenGLES2 instead of GLX (Nix only)
EOF
my %options = (
......@@ -164,8 +126,6 @@ my %options = (
'no-webkit1' => \$noWebKit1,
'no-webkit2' => \$noWebKit2,
'coverage' => \$coverageSupport,
'curl' => \$curl,
'opengles2' => \$opengles2,
);
# Build usage text and options list from features
......@@ -292,24 +252,6 @@ if (isInspectorFrontend()) {
@projects = ("Source/WebInspectorUI");
}
if (isNix()) {
if ($noWebKit2) {
print STDERR "Nix is a WebKit2 port, you can't disable WebKit2 on it!\n";
exit 1;
}
# By default we build using all of the available CPUs.
$makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/;
$cmakeArgs = "-DWTF_USE_CURL=ON " . $cmakeArgs if $curl;
$cmakeArgs = "-DWTF_USE_OPENGL_ES_2=ON " . $cmakeArgs if $opengles2;
# We remove CMakeCache to avoid the bots to reuse cached flags when
# we enable new features. This forces a reconfiguration.
removeCMakeCache();
buildCMakeProjectOrExit($clean, "Nix", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
}
if (isEfl() || isGtkCMake()) {
# By default we build using all of the available CPUs.
$makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/;
......
......@@ -24,17 +24,15 @@ use Getopt::Long qw(:config pass_through);
my $platformEfl = 0;
my $platformGtk = 0;
my $platformNix = 0;
my $getOptionsResult = GetOptions(
'efl' => \$platformEfl,
'gtk' => \$platformGtk,
'nix' => \$platformNix
);
my $platform = "";
if (!$getOptionsResult) {
die "No platform specified for " . basename($0) .". Use --gtk, --efl or --nix.\n";
die "No platform specified for " . basename($0) .". Use --gtk or --efl.\n";
} else {
if ($platformEfl) {
$platform = "efl";
......@@ -42,9 +40,6 @@ if (!$getOptionsResult) {
if ($platformGtk) {
$platform = "gtk";
}
if ($platformNix) {
$platform = "nix";
}
}
sub getMD5HashForFile($)
......@@ -126,7 +121,7 @@ delete $ENV{AR_FLAGS} if exists $ENV{AR_FLAGS};
chdir(relativeScriptsDir() . "/../jhbuild") or die $!;
my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+", "nix" => "Nix" );
my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+" );
if (-e getJhbuildPath() && jhbuildConfigurationChanged()) {
cleanJhbuild();
......
......@@ -96,7 +96,6 @@ my $isWinCE;
my $isWinCairo;
my $isWin64;
my $isEfl;
my $isNix;
my $isInspectorFrontend;
my $isWK2;
my $shouldTargetWebProcess;
......@@ -311,7 +310,7 @@ sub determineArchitecture
$architecture = 'armv7';
}
}
} elsif (isEfl() || isNix() || isGtkCMake()) {
} elsif (isEfl() || isGtkCMake()) {
my $host_processor = "";
$host_processor = `cmake --system-information | grep CMAKE_SYSTEM_PROCESSOR`;
if ($host_processor =~ m/^CMAKE_SYSTEM_PROCESSOR \"([^"]+)\"/) {
......@@ -321,13 +320,13 @@ sub determineArchitecture
}
}
if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl() || isNix())) {
if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) {
# Fall back to output of `arch', if it is present.
$architecture = `arch`;
chomp $architecture;
}
if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl() || isNix())) {
if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) {
# Fall back to output of `uname -m', if it is present.
$architecture = `uname -m`;
chomp $architecture;
......@@ -377,7 +376,6 @@ sub argumentsForConfiguration()
push(@args, '--gtk') if isGtkAutotools();
push(@args, '--gtkcmake') if isGtkCMake();
push(@args, '--efl') if isEfl();
push(@args, '--nix') if isNix();
push(@args, '--wincairo') if isWinCairo();
push(@args, '--wince') if isWinCE();
push(@args, '--inspector-frontend') if isInspectorFrontend();
......@@ -541,7 +539,7 @@ sub productDir
sub jscProductDir
{
my $productDir = productDir();
$productDir .= "/bin" if (isEfl() || isNix() || isGtkCMake());
$productDir .= "/bin" if (isEfl() || isGtkCMake());
$productDir .= "/Programs" if isGtkAutotools();
return $productDir;
......@@ -804,9 +802,6 @@ sub builtDylibPathForName
}
return "$configurationProductDir/lib/libewebkit.so";
}
if (isNix()) {
return "$configurationProductDir/lib/libWebKitNix.so";
}
if (isWinCE()) {
return "$configurationProductDir/$libraryName";
}
......@@ -941,18 +936,6 @@ sub isGtkCMake()
return $isGtkCMake;
}
sub determineIsNix()
{
return if defined($isNix);
$isNix = checkForArgumentAndRemoveFromARGV("--nix");
}
sub isNix()
{
determineIsNix();
return $isNix;
}
sub isGtkAutotools()
{
determineIsGtkAutotools();
......@@ -1108,7 +1091,7 @@ sub isCrossCompilation()
sub isAppleWebKit()
{
return !(isGtk() or isEfl() or isWinCE() or isNix());
return !(isGtk() or isEfl() or isWinCE());
}
sub isAppleMacWebKit()
......@@ -1299,7 +1282,7 @@ sub relativeScriptsDir()
sub launcherPath()
{
my $relativeScriptsPath = relativeScriptsDir();
if (isGtk() || isEfl() || isWinCE() || isNix()) {
if (isGtk() || isEfl() || isWinCE()) {
return "$relativeScriptsPath/run-launcher";
} elsif (isAppleWebKit()) {
return "$relativeScriptsPath/run-safari";
......@@ -1316,8 +1299,6 @@ sub launcherName()
return "EWebLauncher/MiniBrowser";
} elsif (isWinCE()) {
return "WinCELauncher";
} elsif (isNix()) {
return "MiniBrowser";
}
}
......@@ -1340,7 +1321,7 @@ sub checkRequiredSystemConfig
print "most likely fail. The latest Xcode is available from the App Store.\n";
print "*************************************************************\n";
}
} elsif (isGtk() or isEfl() or isWindows() or isNix()) {
} elsif (isGtk() or isEfl() or isWindows()) {
my @cmds = qw(bison gperf flex);
my @missing = ();
my $oldPath = $ENV{PATH};
......@@ -1567,7 +1548,7 @@ sub copyInspectorFrontendFiles
}
} elsif (isAppleWinWebKit() || isWinCairo()) {
$inspectorResourcesDirPath = $productDir . "/WebKit.resources/inspector";
} elsif (isGtk() || isNix()) {
} elsif (isGtk()) {
my $prefix = $ENV{"WebKitInstallationPrefix"};
$inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/webkit-1.0/webinspector";
} elsif (isEfl()) {
......@@ -1883,8 +1864,6 @@ sub jhbuildWrapperPrefixIfNeeded()
push(@prefix, "--efl");
} elsif (isGtk()) {
push(@prefix, "--gtk");
} elsif (isNix()) {
push(@prefix, "--nix");
}
push(@prefix, "run");
......@@ -1979,10 +1958,6 @@ sub buildCMakeProjectOrExit($$$$@)
system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!;
}
if (isNix() && checkForArgumentAndRemoveFromARGV("--update-nix")) {
system("perl", "$sourceDir/Tools/Scripts/update-webkitnix-libs") == 0 or die $!;
}
$returnCode = exitStatus(generateBuildSystemFromCMakeProject($port, $prefixPath, @cmakeArgs));
exit($returnCode) if $returnCode;
......@@ -2001,7 +1976,6 @@ sub cmakeBasedPortName()
{
return "Efl" if isEfl();
return "WinCE" if isWinCE();
return "Nix" if isNix();
return "GTK" if isGtkCMake();
return "";
}
......
......@@ -71,7 +71,6 @@ class DeprecatedPort(object):
"qt-wk2": QtWK2Port,
"efl": EflPort,
"efl-wk2": EflWK2Port,
"nix": NixPort,
}
default_port = {
"Windows": WinPort,
......@@ -232,14 +231,3 @@ class EflWK2Port(DeprecatedPort):
command.append("--no-webkit1")
command.append(super(EflWK2Port, self).makeArgs())
return command
class NixPort(DeprecatedPort):
port_flag_name = "nix"
def build_webkit_command(self, build_style=None):
command = super(NixPort, self).build_webkit_command(build_style=build_style)
command.append("--nix")
command.append("--update-nix")
command.append(super(NixPort, self).makeArgs())
return command
......@@ -47,8 +47,6 @@ def platform_options(use_globs=False):
optparse.make_option('--efl', action='store_const', dest='platform',
const=('efl*' if use_globs else 'efl'),
help=('Alias for --platform=efl*' if use_globs else 'Alias for --platform=efl')),
optparse.make_option('--nix', action='store_const', dest='platform',
const=('nix'), help=('Alias for --platform=nix')),
optparse.make_option('--gtk', action='store_const', dest='platform',
const=('gtk*' if use_globs else 'gtk'),
help=('Alias for --platform=gtk*' if use_globs else 'Alias for --platform=gtk')),
......@@ -78,7 +76,6 @@ def _builder_options(builder_name):
class PortFactory(object):
PORT_CLASSES = (
'efl.EflPort',
'nix.NixPort',
'gtk.GtkPort',
'mac.MacPort',
'mock_drt.MockDRTPort',
......
# Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved.
# Copyright (C) 2011 Samsung Electronics. All rights reserved.
# Copyright (C) 2012 Intel Corporation
# Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
# OWNER OR 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.
"""WebKit Nix implementation of the Port interface."""
import os
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.port.base import Port
from webkitpy.port.pulseaudio_sanitizer import PulseAudioSanitizer
class NixPort(Port):
port_name = 'nix'
def _wk2_port_name(self):
return 'nix'
@classmethod
def determine_full_port_name(cls, host, options, port_name):
"""Determine the port name based on host and options values."""
# Currently the only "port" instance supported by Nix is "nix". Reimplementing
# this method avoids changing port name to nix-wk2, which is the default
# behavior in base.py.
return port_name
def __init__(self, *args, **kwargs):
super(NixPort, self).__init__(*args, **kwargs)
self._jhbuild_wrapper_path = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--nix', 'run']
self.set_option_default('wrapper', ' '.join(self._jhbuild_wrapper_path))
self.set_option_default('webkit_test_runner', True)
self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix')
self._pulseaudio_sanitizer = PulseAudioSanitizer()
def _port_flag_for_scripts(self):
return "--nix"
def setup_test_run(self):
self._pulseaudio_sanitizer.unload_pulseaudio_module()
def setup_environ_for_server(self, server_name=None):
env = super(NixPort, self).setup_environ_for_server(server_name)
# If DISPLAY environment variable is unset in the system
# e.g. on build bot, remove DISPLAY variable from the dictionary
if not 'DISPLAY' in os.environ:
del env['DISPLAY']
env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib')
if self.webprocess_cmd_prefix:
env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix
return env
def default_timeout_ms(self):
# Tests run considerably slower under gdb
# or valgrind.
if self.get_option('webprocess_cmd_prefix'):
return 350 * 1000
return super(NixPort, self).default_timeout_ms()
def clean_up_test_run(self):
super(NixPort, self).clean_up_test_run()
self._pulseaudio_sanitizer.restore_pulseaudio_module()
def _generate_all_test_configurations(self):
return [TestConfiguration(version=self._version, architecture='x86', build_type=build_type) for build_type in self.ALL_BUILD_TYPES]
def _path_to_driver(self):
return self._build_path('bin', self.driver_name())
def _path_to_image_diff(self):
return self._build_path('bin', 'ImageDiff')
def _image_diff_command(self, *args, **kwargs):
return self._jhbuild_wrapper_path + super(NixPort, self)._image_diff_command(*args, **kwargs)
def _search_paths(self):
return [self.port_name]
def show_results_html_file(self, results_filename):
run_launcher_args = ["file://%s" % results_filename]
self._run_script("run-launcher", run_launcher_args)
def _port_specific_expectations_files(self):
paths = self._search_paths()
if self.get_option('webkit_test_runner'):
paths.append('wk2')
return list(([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in paths]))
def default_baseline_search_path(self):
return map(self._webkit_baseline_path, ['nix', 'wk2'])
# Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
#
# 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
# 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 unittest2 as unittest
import os
from copy import deepcopy
from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.system.systemhost_mock import MockSystemHost
from webkitpy.port import port_testcase
from webkitpy.port.nix import NixPort
from webkitpy.tool.mocktool import MockOptions
class NixPortTest(port_testcase.PortTestCase):
port_name = 'nix'
port_maker = NixPort
search_paths_cases = [
{'search_paths': ['nix', 'wk2'], 'os_name':'linux'}]
expectation_files_cases = [
{'search_paths': ['', 'nix', 'wk2'], 'os_name':'linux'}]
def _assert_search_path(self, search_paths, os_name):
host = MockSystemHost(os_name=os_name)
port = self.make_port(port_name=self.port_name, host=host, options=MockOptions(webkit_test_runner=True))
absolute_search_paths = map(port._webkit_baseline_path, search_paths)
unittest.TestCase.assertEqual(self, port.baseline_search_path(), absolute_search_paths)
def _assert_expectations_files(self, search_paths, os_name):
host = MockSystemHost(os_name=os_name)
port = self.make_port(port_name=self.port_name, host=host, options=MockOptions(webkit_test_runner=True))
unittest.TestCase.assertEqual(self, port.expectations_files(), search_paths)
def test_baseline_search_path(self):
for case in self.search_paths_cases:
self._assert_search_path(**case)
def test_expectations_files(self):
for case in self.expectation_files_cases:
expectations_case = deepcopy(case)
expectations_case['search_paths'] = map(lambda path: '/mock-checkout/LayoutTests/TestExpectations' if not path else '/mock-checkout/LayoutTests/platform/%s/TestExpectations' % (path), expectations_case['search_paths'])
self._assert_expectations_files(**expectations_case)
def test_default_timeout_ms(self):
unittest.TestCase.assertEqual(self, self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 80000)
unittest.TestCase.assertEqual(self, self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 80000)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment