Skip to content

Commit 05781fc

Browse files
WeizhongXChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
Install httpd-php to third_party/apache_mac
Also set up the path to httpd and config file properly. We continue to use system httpd for mac10.12 and mac10.13, as the 3pp htppd is built targeting newer version of Mac. Bug: 1190885 Change-Id: If1e5264d26bcf384cb02e23facbd09fc9b33a2a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3524265 Reviewed-by: Nico Weber <[email protected]> Commit-Queue: Weizhong Xia <[email protected]> Cr-Commit-Position: refs/heads/main@{#981444}
1 parent 52fea34 commit 05781fc

File tree

9 files changed

+31
-186
lines changed

9 files changed

+31
-186
lines changed

BUILD.gn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,10 @@ if (!is_ios) {
11871187
data_deps += [ "//build/win:copy_cdb_to_output" ]
11881188
}
11891189

1190+
if (is_mac) {
1191+
data += [ "//third_party/apache-mac/" ]
1192+
}
1193+
11901194
if (is_android) {
11911195
data += [
11921196
"//third_party/catapult/",

DEPS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,17 @@ deps = {
524524
'condition': '(host_os == "linux")',
525525
},
526526

527+
'src/third_party/apache-mac': {
528+
'packages': [
529+
{
530+
'package': 'infra/3pp/tools/httpd-php/${{platform}}',
531+
'version': 'version:[email protected]',
532+
},
533+
],
534+
'dep_type': 'cipd',
535+
'condition': '(host_os == "mac")',
536+
},
537+
527538
'src/android_webview/tools/cts_archive': {
528539
'packages': [
529540
{

third_party/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
/androidx/libs/
2929
/angle
3030
/angle_dx11
31+
/apache-mac/LICENSE
32+
/apache-mac/bin/*
33+
/apache-mac/lib/*
34+
/apache-mac/libexec/*
3135
/apache-portable-runtime/src
3236
/apache-win32/bin/*.exe
3337
/apache-win32/bin/*.dll

third_party/blink/tools/apache_config/apache2-httpd-2.4-prefork.conf

Lines changed: 0 additions & 151 deletions
This file was deleted.

third_party/blink/tools/blinkpy/common/system/platform_info.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ def __init__(self, sys_module, platform_module, filesystem_module,
6565
def is_mac(self):
6666
return self.os_name == 'mac'
6767

68-
def is_mac_monterey(self):
69-
if not self.is_mac():
70-
return False
71-
72-
command = ['sw_vers', '-productVersion']
73-
version = self._executive.run_command(command).strip()
74-
return version.startswith('12.')
75-
7668
def is_win(self):
7769
return self.os_name == 'win'
7870

third_party/blink/tools/blinkpy/common/system/platform_info_mock.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ def __init__(self,
4545
def is_mac(self):
4646
return self.os_name == 'mac'
4747

48-
def is_mac_monterey(self):
49-
return False
50-
5148
def is_linux(self):
5249
return self.os_name == 'linux'
5350

third_party/blink/tools/blinkpy/web_tests/port/mac.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,19 @@ def operating_system(self):
108108
#
109109

110110
def path_to_apache(self):
111-
return '/usr/sbin/httpd'
111+
# use system httpd on mac10.12, mac10.13. The httpd from cipd does not work on
112+
# these platforms as that is compiled toward newer version of mac.
113+
if self.host.platform.os_version in ['mac10.12', 'mac10.13']:
114+
return '/usr/sbin/httpd'
115+
return self._path_from_chromium_base(
116+
'third_party', 'apache-mac', 'bin', 'httpd')
112117

113118
def path_to_apache_config_file(self):
114-
# TODO(crbug.com/1190885): Workaround for Monterey, should be reverted
115-
# once we build chromium specific httpd.
116-
if self.host.platform.is_mac_monterey():
117-
config_file_name = "apache2-httpd-2.4-prefork.conf"
118-
return self._filesystem.join(self.apache_config_directory(), config_file_name)
119-
120-
config_file_basename = 'apache2-httpd-' + self._apache_version()
121-
if self.host.platform.os_version not in ['mac10.12']:
122-
config_file_basename += '-php7'
123-
if self.host.platform.os_version not in ['mac10.13', 'mac10.14']:
124-
config_file_basename += '-prefork'
125-
return self._filesystem.join(self.apache_config_directory(), config_file_basename + '.conf')
119+
if self.host.platform.os_version in ['mac10.12']:
120+
config_file_basename = 'apache2-httpd-%s.conf' % (self._apache_version(),)
121+
else:
122+
config_file_basename = 'apache2-httpd-%s-php7.conf' % (self._apache_version(),)
123+
return self._filesystem.join(self.apache_config_directory(), config_file_basename)
126124

127125
def _path_to_driver(self, target=None):
128126
return self._build_path_with_target(target,

third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,3 @@ def test_path_to_apache_config_file_on_10_13(self):
7777
port.path_to_apache_config_file(),
7878
'/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4-php7.conf'
7979
)
80-
81-
def test_path_to_apache_config_file_on_10_15(self):
82-
port = self.make_port(os_version='mac10.15', port_name='mac')
83-
port._apache_version = lambda: '2.4' # pylint: disable=protected-access
84-
self.assertEqual(
85-
port.path_to_apache_config_file(),
86-
'/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4-php7-prefork.conf'
87-
)

third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,11 @@ def __init__(self, port_obj, output_dir, additional_dirs,
121121
'-c', 'TypesConfig "%s"' % mime_types_path,
122122
'-c', 'CustomLog "%s" common' % self._access_log_path,
123123
'-c', 'ErrorLog "%s"' % self._error_log_path,
124+
'-c', 'PHPINIDir "%s"' % php_ini_dir,
124125
'-c', 'PidFile %s' % self._pid_file,
125126
'-c', 'SSLCertificateFile "%s"' % cert_file,
126127
'-c', 'DefaultType None',
127128
]
128-
if not self._port_obj.host.platform.is_mac_monterey():
129-
start_cmd += ['-c', 'PHPINIDir "%s"' % php_ini_dir]
130-
131129
# yapf: enable
132130

133131
if self._is_win:

0 commit comments

Comments
 (0)