0

mac: Use system httpd again

Our hermetic httpd doesn't have an arm binary, and getting one is
blocked on a bunch of things. Move back to system httpd for now.
See bug for details.

Morally reverts
https://chromium-review.googlesource.com/c/chromium/src/+/1446836

This adds third_party/blink/tools/apache_config/apache2-httpd-2.4-php7-prefork.conf
which is the same as third_party/blink/tools/apache_config/apache2-httpd-2.4-php7.conf
except with a mpm_prefork_module line added. This is needed
on 10.15 and 11.

Bug: 1190885
Cq-Include-Trybots: luci.chromium.try:mac10.12-blink-rel
Cq-Include-Trybots: luci.chromium.try:mac10.13-blink-rel
Cq-Include-Trybots: luci.chromium.try:mac10.14-blink-rel
Cq-Include-Trybots: luci.chromium.try:mac10.15-blink-rel
Cq-Include-Trybots: luci.chromium.try:mac11.0-blink-rel
Cq-Include-Trybots: luci.chromium.try:mac11.0.arm64-blink-rel
Change-Id: Icd7e14b3d94a596edbda76b44c51c49302617a36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3315499
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#948549}
This commit is contained in:
Nico Weber
2021-12-06 16:53:01 +00:00
committed by Chromium LUCI CQ
parent 61a0a2557a
commit 1156f94e35
40 changed files with 176 additions and 2100 deletions

@ -1185,10 +1185,6 @@ if (!is_ios) {
data_deps += [ "//build/win:copy_cdb_to_output" ]
}
if (is_mac) {
data += [ "//third_party/apache-mac/" ]
}
if (is_android) {
data += [
"//third_party/catapult/",

15
DEPS

@ -4067,21 +4067,6 @@ hooks = [
'--bucket', 'chromium-webrtc-resources',
'-d', 'src/third_party/opus/tests/resources'],
},
{
'name': 'apache_mac',
'pattern': '\\.sha1',
'condition': 'checkout_mac',
'action': [ 'python3',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--directory',
'--recursive',
'--no_auth',
'--num_threads=16',
'--bucket', 'chromium-apache-mac',
'src/third_party/apache-mac',
],
},
{
'name': 'apache_win32',
'pattern': '\\.sha1',

@ -37,10 +37,6 @@
/apache-win32/bin/iconv/*.so
/apache-win32/modules/*.so
/apache-win32/modules/*.dll
/apache-mac/bin/httpd
/apache-mac/bin/openssl
/apache-mac/lib/*.dylib
/apache-mac/libexec/apache2/*.so
/arcore-android-sdk/src/
/arcore-android-sdk/test-apks/arcore/*.apk
/asan

@ -1,3 +0,0 @@
monorail: {
component: "Internals>Network"
}

File diff suppressed because it is too large Load Diff

@ -1,2 +0,0 @@
davidben@chromium.org
dpranke@google.com

@ -1,38 +0,0 @@
Name: Apache2 (+ PHP and dependencies)
Short Name: httpd
URL: http://www.apache.org
Version: 2.4.38
Security Critical: no
License: Apache Version 2.0
License File: NOT_SHIPPED
Description:
This is a checked-in copy of Apache2 with OpenSSL, PHP, and dependencies for
Mac. It is used by the Blink layout tests. Binaries are built from:
apr 1.6.5
apr-util 1.6.1
httpd 2.4.38
openssl 1.1.1b
pcre 8.42
php 7.3.3
zlib 1.2.11
To update, use the build-apache-mac.sh script.
mkdir tmp
cd tmp
/path/to/build-apache-mac.sh
The files will be placed in the out directory. Copy these over and upload the
executables and DLLs to Google Storage, to the chromium-apache-mac bucket.
See http://g.co/bugatrooper in order to get permission to upload. Upload all
binaries with:
find bin lib libexec -type f -not -name '*.sha1' | upload_to_google_storage.py --bucket chromium-apache-mac -
Optionally, prune the files that were uploaded and run gclient runhooks to
verify that they are re-downloaded. Remember to clean up any temp files used in
the above process before uploading a CL. The CL should contain sha1 files but
not actual binaries.

@ -1 +0,0 @@
7d978b3cf5a1c1c23e26c1566e58fb796c9842eb

@ -1 +0,0 @@
97333a49db174d6a49b01895a899c7650cd4a297

@ -1,256 +0,0 @@
#!/bin/bash
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
# Update from https://www.zlib.net/
zlib_version="1.2.11"
zlib_sha256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1"
# Update from https://apr.apache.org/
apr_version="1.6.5"
apr_sha256="70dcf9102066a2ff2ffc47e93c289c8e54c95d8dda23b503f9e61bb0cbd2d105"
apr_util_version="1.6.1"
apr_util_sha256="b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459"
# Update from https://httpd.apache.org/download.cgi
httpd_version="2.4.38"
httpd_sha256="38d0b73aa313c28065bf58faf64cec12bf7c7d5196146107df2ad07541aa26a6"
# Update from https://www.openssl.org/source/
openssl_version="1.1.1b"
openssl_sha256="5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b43ea4b"
# Update from https://www.pcre.org/
pcre_version="8.42"
pcre_sha256="69acbc2fbdefb955d42a4c606dfde800c2885711d2979e356c0636efde9ec3b5"
# Update from https://secure.php.net/downloads.php
php_version="7.3.3"
php_sha256="9bde40cbf8608ae9c595a6643a02cf0c692c131e2b3619af3fd2af8425d8e677"
build="$PWD/build"
out="$PWD/out"
src="$PWD/src"
if [ -d "$build" ]; then
echo "$build already exists. Remove for a new build"
exit 1
fi
if [ -d "$out" ]; then
echo "$out already exists. Remove for a new build"
exit 1
fi
if [ -d "$src" ]; then
echo "$src already exists. Remove for a new build"
exit 1
fi
jobs=5
echo "Downloading sources"
curl_if_needed() {
if [ ! -f "$1" ]; then
curl -o "$1" "$2"
fi
}
curl_if_needed "apr-${apr_version}.tar.gz" "https://archive.apache.org/dist/apr/apr-${apr_version}.tar.gz"
curl_if_needed "apr-util-${apr_util_version}.tar.gz" "https://archive.apache.org/dist/apr/apr-util-${apr_util_version}.tar.gz"
curl_if_needed "httpd-${httpd_version}.tar.gz" "https://archive.apache.org/dist/httpd/httpd-${httpd_version}.tar.gz"
curl_if_needed "openssl-${openssl_version}.tar.gz" "https://www.openssl.org/source/openssl-${openssl_version}.tar.gz"
curl_if_needed "pcre-${pcre_version}.tar.gz" "https://ftp.pcre.org/pub/pcre/pcre-${pcre_version}.tar.gz"
curl_if_needed "php-${php_version}.tar.gz" "https://secure.php.net/distributions/php-${php_version}.tar.gz"
curl_if_needed "zlib-${zlib_version}.tar.gz" "https://www.zlib.net/zlib-${zlib_version}.tar.gz"
# Check hashes.
cat > SHA256SUMS <<EOT
${apr_sha256} apr-${apr_version}.tar.gz
${apr_util_sha256} apr-util-${apr_util_version}.tar.gz
${httpd_sha256} httpd-${httpd_version}.tar.gz
${openssl_sha256} openssl-${openssl_version}.tar.gz
${pcre_sha256} pcre-${pcre_version}.tar.gz
${php_sha256} php-${php_version}.tar.gz
${zlib_sha256} zlib-${zlib_version}.tar.gz
EOT
shasum -a 256 -c SHA256SUMS
mkdir "${build}"
mkdir "${src}"
cd "${src}"
export MACOSX_DEPLOYMENT_TARGET="10.10"
echo "Building zlib"
tar xf "../zlib-${zlib_version}.tar.gz"
cd "zlib-${zlib_version}"
./configure --prefix="${build}"
make -j"${jobs}"
make install
cd ..
echo "Building OpenSSL"
tar xf "../openssl-${openssl_version}.tar.gz"
cd "openssl-${openssl_version}"
./config no-tests --prefix="${build}"
make -j"${jobs}"
make install_sw
cd ..
echo "Building PCRE"
tar xf "../pcre-${pcre_version}.tar.gz"
cd "pcre-${pcre_version}"
./configure --prefix="${build}"
make -j"${jobs}"
make install
cd ..
echo "Building APR"
tar xf "../apr-${apr_version}.tar.gz"
cd "apr-${apr_version}"
./configure --prefix="${build}"
make -j"${jobs}"
make install
cd ..
echo "Building APR-util"
tar xf "../apr-util-${apr_util_version}.tar.gz"
cd "apr-util-${apr_util_version}"
./configure --prefix="${build}" --with-apr="${build}"
make -j"${jobs}"
make install
cd ..
echo "Building httpd"
tar xf "../httpd-${httpd_version}.tar.gz"
cd "httpd-${httpd_version}"
# See third_party/blink/tools/apache_config/apache2-httpd-2.4-php7.conf for the
# modules to enable. Build modules as shared libraries to match the LoadModule
# lines (the ServerRoot option will let httpd discover them), but we statically
# link dependencies to avoid runtime linker complications.
./configure --prefix="${build}" \
--enable-access-compat=shared \
--enable-actions=shared \
--enable-alias=shared \
--enable-asis=shared \
--enable-authz-core=shared \
--enable-authz-host=shared \
--enable-autoindex=shared \
--enable-cgi=shared \
--enable-env=shared \
--enable-headers=shared \
--enable-imagemap=shared \
--enable-include=shared \
--enable-log-config=shared \
--enable-mime=shared \
--enable-modules=none \
--enable-negotiation=shared \
--enable-rewrite=shared \
--enable-ssl=shared \
--enable-unixd=shared \
--libexecdir="${build}/libexec/apache2" \
--with-apr-util="${build}" \
--with-apr="${build}" \
--with-mpm=prefork \
--with-pcre="${build}" \
--with-ssl="${build}"
make -j"${jobs}"
make install
cd ..
echo "Building PHP"
tar xf "../php-${php_version}.tar.gz"
cd "php-${php_version}"
./configure --prefix="${build}" \
--disable-cgi \
--disable-cli \
--with-apxs2="${build}/bin/apxs" \
--with-zlib="${build}" \
--without-iconv
make -j"${jobs}"
make install
cd ..
bin_files="
bin/httpd
bin/openssl"
lib_files="
lib/libapr-1.0.dylib
lib/libaprutil-1.0.dylib
lib/libcrypto.1.1.dylib
lib/libpcre.1.dylib
lib/libpcrecpp.0.dylib
lib/libpcreposix.0.dylib
lib/libssl.1.1.dylib
lib/libz.1.2.11.dylib"
libexec_files="
libexec/apache2/libphp7.so
libexec/apache2/mod_access_compat.so
libexec/apache2/mod_actions.so
libexec/apache2/mod_alias.so
libexec/apache2/mod_asis.so
libexec/apache2/mod_authz_core.so
libexec/apache2/mod_authz_host.so
libexec/apache2/mod_autoindex.so
libexec/apache2/mod_cgi.so
libexec/apache2/mod_env.so
libexec/apache2/mod_headers.so
libexec/apache2/mod_imagemap.so
libexec/apache2/mod_include.so
libexec/apache2/mod_log_config.so
libexec/apache2/mod_mime.so
libexec/apache2/mod_negotiation.so
libexec/apache2/mod_rewrite.so
libexec/apache2/mod_ssl.so
libexec/apache2/mod_unixd.so"
license_files="
apr-${apr_version}/LICENSE
apr-${apr_version}/NOTICE
apr-util-${apr_util_version}/LICENSE
apr-util-${apr_util_version}/NOTICE
httpd-${httpd_version}/LICENSE
httpd-${httpd_version}/NOTICE
openssl-${openssl_version}/LICENSE
pcre-${pcre_version}/LICENCE
php-${php_version}/LICENSE"
echo "Copying files"
mkdir "${out}"
mkdir "${out}/bin"
mkdir "${out}/lib"
mkdir "${out}/libexec"
mkdir "${out}/libexec/apache2"
cat > "${out}/LICENSE" <<EOT
This directory contains binaries for Apache httpd, PHP, and their dependencies.
License and notices for each are listed below:
EOT
for f in ${license_files}; do
echo >> "${out}/LICENSE"
echo "=======================" >> "${out}/LICENSE"
echo >> "${out}/LICENSE"
echo "${f}:" >> "${out}/LICENSE"
cat "${src}/${f}" >> "${out}/LICENSE"
done
# zlib does not have a standalone LICENSE file. Extract it from the README
# instead.
echo >> "${out}/LICENSE"
echo "=======================" >> "${out}/LICENSE"
echo >> "${out}/LICENSE"
echo "From zlib-${zlib_version}/README:" >> "${out}/LICENSE"
sed -n -e '/^Copyright notice:/,//p' "${src}/zlib-${zlib_version}/README" >> "${out}/LICENSE"
for f in ${bin_files} ${lib_files} ${libexec_files}; do
cp "${build}/${f}" "${out}/${f}"
for lib in ${lib_files}; do
install_name_tool -change "${build}/${lib}" "@rpath/$(basename "${lib}")" "${out}/${f}"
done
done
for f in ${bin_files}; do
install_name_tool -add_rpath "@executable_path/../lib" "${out}/${f}"
done
for f in ${lib_files}; do
install_name_tool -id "@rpath/$(basename "${f}")" "${out}/${f}"
done
for f in ${libexec_files}; do
install_name_tool -id "@rpath/../libexec/$(basename "${f}")" "${out}/${f}"
done

@ -1 +0,0 @@
82485af4feb2f9f8f3f9ed2299eef177216967a5

@ -1 +0,0 @@
a0a0d57e0522296cba8e5cd892aca6d9eecef930

@ -1 +0,0 @@
d14646244c07a7992308ff9b0834d23ba0be650d

@ -1 +0,0 @@
0ae33eed29d0245ee9bd4cb9796dc5fa9b90b613

@ -1 +0,0 @@
24d435d9f1c8dcbdaadcee4c428d38cb198ef16c

@ -1 +0,0 @@
e750e84acc3c812545775d26165936313a5b19fb

@ -1 +0,0 @@
ceaaff3e2f711bff9fdebe42df07abf51a0dcbf1

@ -1 +0,0 @@
ce07e5c399249609c3a245acc990ad2057d49ed4

@ -1 +0,0 @@
1d0d045a799d92f56d0c4c7ab35f5e38ac804197

@ -1 +0,0 @@
521754107eb0685424396ae52a111053ec955a3b

@ -1 +0,0 @@
d7272800dd565ab3e582088a9db973f1e575a66f

@ -1 +0,0 @@
9b0a034a678d2f45171063eea25ab1ee0beddb4d

@ -1 +0,0 @@
a4ad67a59a7f0d20606466f2960096ace1b76bca

@ -1 +0,0 @@
ffa4b158d52635eefa0387fc2e94dc9300e642d5

@ -1 +0,0 @@
a8d9b5929acdd071f614ff189707e7ef4ec7f003

@ -1 +0,0 @@
5ffae7f779e6acf95bde12b5f8a6619a0ce77378

@ -1 +0,0 @@
d217c0f046ab073d7ce68de442d94f18e9da82a7

@ -1 +0,0 @@
b877ac91f077591dfb2719edd6841f095f59a07f

@ -1 +0,0 @@
bb4d657f9e551726e5542e1520a05c294d9eeed7

@ -1 +0,0 @@
4a47dce8e0b40626de33f68a1eb376d4730165f8

@ -1 +0,0 @@
2c24c421e8e99644963c0ce4dbcda0f6d0f06615

@ -1 +0,0 @@
b85143aa3578219cb3ed0f93073a2e19c29ba6c3

@ -1 +0,0 @@
8325494f9a2310abf35c1218e4be7a17e805634e

@ -1 +0,0 @@
9c20aac51ad40d9849badad125e1e266ca22576e

@ -1 +0,0 @@
df0f0915507419f98fc1fe44f3575d14707168e9

@ -1 +0,0 @@
29b970bbc1d17c029986cadf9af564d403fcbb01

@ -1 +0,0 @@
e503f4d92e5e5edb9a0cd91beed3f9f9c86de043

@ -0,0 +1,154 @@
ServerTokens Prod
Mutex file:/tmp/WebKit
PidFile "/tmp/WebKit/httpd.pid"
ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
Timeout 300
KeepAlive On
# Setting this value too low may change header size sometimes making flakey tests.
MaxKeepAliveRequests 0
KeepAliveTimeout 9999
MaxRequestWorkers 150
MaxConnectionsPerChild 100000
LoadModule mpm_prefork_module libexec/apache2/mod_mpm_prefork.so
LoadModule unixd_module libexec/apache2/mod_unixd.so
LoadModule access_compat_module libexec/apache2/mod_access_compat.so
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
LoadModule headers_module libexec/apache2/mod_headers.so
LoadModule ssl_module libexec/apache2/mod_ssl.so
LoadModule mime_module libexec/apache2/mod_mime.so
LoadModule asis_module libexec/apache2/mod_asis.so
LoadModule cgi_module libexec/apache2/mod_cgi.so
LoadModule env_module libexec/apache2/mod_env.so
LoadModule negotiation_module libexec/apache2/mod_negotiation.so
LoadModule imagemap_module libexec/apache2/mod_imagemap.so
LoadModule actions_module libexec/apache2/mod_actions.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php7_module libexec/apache2/libphp7.so
LoadModule autoindex_module libexec/apache2/mod_autoindex.so
ServerName 127.0.0.1
<Directory />
Options Indexes FollowSymLinks MultiViews ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
AccessFileName .htaccess
<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
Order allow,deny
Deny from all
Satisfy All
</Files>
UseCanonicalName On
HostnameLookups Off
PassEnv TMPDIR
LogLevel warn
ErrorLog "/tmp/WebKit/error_log"
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ServerSignature On
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage he .he
AddCharset ISO-8859-8 .iso8859-8
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage kr .kr
AddCharset ISO-2022-KR .iso-kr
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cs .cz .cs
AddLanguage ru .ru
AddLanguage zh-TW .zh-tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8
<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>
AddType application/x-tar .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddHandler cgi-script .cgi .pl
AddType text/html .shtml
AddHandler server-parsed .shtml
AddHandler send-as-is asis
AddType application/x-httpd-php .php
AddType application/x-httpd-php .bat
AddType application/x-httpd-php-source .phps
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
php_flag log_errors on
php_flag short_open_tag on
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
<VirtualHost *:8443>
ServerName 127.0.0.1
SSLEngine On
</VirtualHost>
#
# Apple-specific filesystem protection.
#
<Files "rsrc">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Directory ~ ".*\.\.namedfork">
Order allow,deny
Deny from all
Satisfy All
</Directory>

@ -108,14 +108,15 @@ class MacPort(base.Port):
#
def path_to_apache(self):
return self._path_from_chromium_base('third_party', 'apache-mac',
'bin', 'httpd')
return '/usr/sbin/httpd'
def path_to_apache_config_file(self):
config_file_basename = 'apache2-httpd-%s-php7.conf' % (
self._apache_version(), )
return self._filesystem.join(self.apache_config_directory(),
config_file_basename)
config_file_basename = 'apache2-httpd-' + self._apache_version()
if self.host.platform.os_version not in ['mac10.12']:
config_file_basename += '-php7'
if self.host.platform.os_version not in ['mac10.13', 'mac10.14']:
config_file_basename += '-prefork'
return self._filesystem.join(self.apache_config_directory(), config_file_basename + '.conf')
def _path_to_driver(self, target=None):
return self._build_path_with_target(target,

@ -66,7 +66,22 @@ class MacPortTest(port_testcase.PortTestCase):
def test_path_to_apache_config_file(self):
port = self.make_port()
port._apache_version = lambda: '2.4' # pylint: disable=protected-access
self.assertEqual(
port.path_to_apache_config_file(),
'/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4.conf')
def test_path_to_apache_config_file_on_10_13(self):
port = self.make_port(os_version='mac10.13', port_name='mac')
port._apache_version = lambda: '2.4' # pylint: disable=protected-access
self.assertEqual(
port.path_to_apache_config_file(),
'/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4-php7.conf'
)
def test_path_to_apache_config_file_on_10_15(self):
port = self.make_port(os_version='mac10.15', port_name='mac')
port._apache_version = lambda: '2.4' # pylint: disable=protected-access
self.assertEqual(
port.path_to_apache_config_file(),
'/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4-php7-prefork.conf'
)