Compare commits

...

14 Commits

Author SHA1 Message Date
Otto van der Schaaf e6931ba037 Release version 1.12.34.3 2017-09-28 14:48:58 +02:00
Otto van der Schaaf f4124cb5d1 Correct the ngx_pagespeed-specific release version 2017-09-28 14:47:22 +02:00
Otto van der Schaaf cf57d720e0 nginx-1.13.4: use preprocessor define instead of const for comparison
Address a mistake I made in https://github.com/pagespeed/ngx_pagespeed/pull/1458

While testing the draft for 1.12.34.3 I noticed that older nginx
versions would fail to compile. Switch kNginx13_1_4 to a #define so we
can use it to properly compare.

Note: this will have to be backported to master
2017-09-28 14:47:22 +02:00
PikachuEXE 6320f71a7c Fix compiling issue with older nginx (#1470) 2017-09-28 14:47:22 +02:00
Otto van der Schaaf f5eccb7618 Adress @jmarantz his comment from #1453's review (#1458)
PR #1453 was merged too soon, using this PR to address
https://github.com/pagespeed/ngx_pagespeed/pull/1453#discussion_r134222719

(Sorry Josh!)
2017-09-28 14:47:22 +02:00
Otto van der Schaaf 257c2bcb54 nginx 1.13.4: Fix compilation error (#1453)
* Compilation of ngx_pagespeed broke with the following commit in
nginx: https://github.com/nginx/nginx/commit/129b06dc5dfab7b4513a4f274b3778cd9b8a6a22
This change intends to unbreak it while maintaining backwards
compatibility.

Fixes https://github.com/pagespeed/ngx_pagespeed/issues/1451
2017-09-28 14:47:22 +02:00
Otto van der Schaaf b70c70ecb9 Revert "stop crashing when unplugged" (#1400)
This is just for the branch. 1.12.34.2 will be marked as
stable, backing out this change avoids having to test a new
beta.

This reverts commit 149c47ace4.
2017-03-30 22:28:09 +02:00
Jeff Kaufman 149c47ace4 stop crashing when unplugged 2017-01-19 13:49:59 -05:00
Jeff Kaufman 0ca15283c8 travis: send emails to new pagespeed-ci group instead of individual devs 2016-12-19 13:47:02 -05:00
Jeff Kaufman f3c64ca8a2 Version 1.12.34.2 2016-12-14 10:26:08 -05:00
Jeff Kaufman ecd323ea60 config: use Release binaries when building with --with-debug if that's all that's available (#1332)
* config: use Release binaries when building with --with-debug if that's all that's available

* prompt the user before going ahead and using release binaries

* exit 1, reword message
2016-12-14 10:15:35 -05:00
Steve Hill a1fc37a9f2 Version 1.12.34.1 2016-12-06 13:29:20 -05:00
hillsp 4c51a5ce60 Add format_binary_url.sh (#1331) 2016-12-06 13:25:36 -05:00
hillsp 0dfc12ffe2 Delete prepare_psol.sh (#1310)
Replaced with install/build_psol.sh  in mod_pagespeed.
2016-12-06 12:07:44 -05:00
8 changed files with 66 additions and 107 deletions
+1 -6
View File
@@ -42,9 +42,4 @@ compiler:
- gcc - gcc
notifications: notifications:
email: email:
- cheesy@google.com - pagespeed-ci@googlegroups.com
- jefftk@google.com
- morlovich@google.com
- jmarantz@google.com
- huibao@google.com
- jcrowell@google.com
+1 -4
View File
@@ -1,4 +1 @@
In a release this file would contain the URL to download the pre-compiled PSOL https://dl.google.com/dl/page-speed/psol/1.12.34.2-$BIT_SIZE_NAME.tar.gz
binary, but on development branches (like this one) you have to build PSOL from
source yourself. See:
https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source
+20 -1
View File
@@ -26,7 +26,8 @@ if [ "$mod_pagespeed_dir" = "unset" ] ; then
if [ ! -e "$mod_pagespeed_dir" ] ; then if [ ! -e "$mod_pagespeed_dir" ] ; then
echo "ngx_pagespeed: pagespeed optimization library not found:" echo "ngx_pagespeed: pagespeed optimization library not found:"
psol_binary_url="$(cat $ngx_addon_dir/PSOL_BINARY_URL)" psol_binary_url="$($ngx_addon_dir/scripts/format_binary_url.sh \
$ngx_addon_dir/PSOL_BINARY_URL)"
if [[ "$psol_binary_url" != https://* ]]; then if [[ "$psol_binary_url" != https://* ]]; then
echo " echo "
This is a development branch of ngx_pagespeed, which means there is no This is a development branch of ngx_pagespeed, which means there is no
@@ -76,6 +77,8 @@ fi
if [ "$NGX_DEBUG" = "YES" ]; then if [ "$NGX_DEBUG" = "YES" ]; then
buildtype=Debug buildtype=Debug
# If we're using a psol tarball that doesn't contain Debug/ (which is the case
# from 1.12 onward) then this will be overriden to buildtype=Release below.
else else
buildtype=Release buildtype=Release
fi fi
@@ -143,6 +146,22 @@ if [ "$psol_binary" = "unset" ] ; then
psol_binary="\ psol_binary="\
$mod_pagespeed_dir/pagespeed/automatic/pagespeed_automatic.a" $mod_pagespeed_dir/pagespeed/automatic/pagespeed_automatic.a"
else else
if ! [ -d "$ngx_addon_dir/psol/lib/$buildtype" ]; then
echo "
You have set --with-debug for building nginx, but precompiled Debug binaries for
PSOL, which ngx_pagespeed depends on, aren't available. If you're trying to
debug PSOL you need to build it from source. If you just want to run nginx with
debug-level logging you can use the Release binaries."
echo -n "
Use the available Release binaries?"
read -p " [Y/n] " yn
if [[ "$yn" == N* || "$yn" == n* ]]; then
echo "Cancelled."
exit 1
fi
buildtype=Release
fi
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name" psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
psol_binary="$psol_library_dir/pagespeed_automatic.a" psol_binary="$psol_library_dir/pagespeed_automatic.a"
fi fi
+1 -1
View File
@@ -428,7 +428,7 @@ Not deleting $directory; name is suspiciously short. Something is wrong."
elif [ -e PSOL_BINARY_URL ]; then elif [ -e PSOL_BINARY_URL ]; then
# Releases after 1.11.33.4 there is a PSOL_BINARY_URL file that tells us # Releases after 1.11.33.4 there is a PSOL_BINARY_URL file that tells us
# where to look. # where to look.
psol_url="$(cat PSOL_BINARY_URL)" psol_url="$(scripts/format_binary_url.sh PSOL_BINARY_URL)"
if [[ "$psol_url" != https://* ]]; then if [[ "$psol_url" != https://* ]]; then
fail "Got bad psol binary location information: $psol_url" fail "Got bad psol binary location information: $psol_url"
fi fi
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
set -u
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) <url_file>" >&2
exit 1
fi
url_file=$1
if [ ! -e "$url_file" ]; then
echo "Url file '$url_file' missing!" >&2
fi
# The size names must match install/build_psol.sh in mod_pagespeed
if [ "$(uname -m)" = x86_64 ]; then
bit_size_name=x64
else
bit_size_name=ia32
fi
sed -e 's/$BIT_SIZE_NAME\b/'$bit_size_name'/g' $url_file
-94
View File
@@ -1,94 +0,0 @@
#!/bin/bash
#
# Copyright 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: jefftk@google.com (Jeff Kaufman)
#
# Usage:
# scripts/prepare_psol.sh /path/to/mod_pagespeed/src
#
# Creates a directory psol/ and copies headers and a few source files from a
# depot_tools (glient) checkout into psol/include. Along with creating
# binaries, this is a step in preparing psol.tar.gz for distribution.
#
set -u # check for undefined variables
set -e # exit on failed commands
if [ "$(basename "$PWD")" != "ngx_pagespeed" ] ; then
echo "$(basename $0) must be invoked from the ngx_pagespeed directory"
exit 1
fi
if [ $# -ne 1 ] ; then
echo "Usage: $(basename $0) /path/to/mod_pagespeed/src"
exit 1
fi
MOD_PAGESPEED_SRC="$1"
if [ "$(basename "$(dirname "$MOD_PAGESPEED_SRC")")/$( \
basename "$MOD_PAGESPEED_SRC")" != "mod_pagespeed/src" ] ; then
echo "Usage: $(basename $0) /path/to/mod_pagespeed/src"
exit 1
fi
if [ -e psol ] ; then
echo "A psol/ directory already exists. Move it somewhere else and rerun."
exit 1
fi
mkdir psol/
# Copy over the .h files, plus a few selected .cc and .c files.
rsync -arvz "$MOD_PAGESPEED_SRC/" "psol/include/" --prune-empty-dirs \
--exclude=".svn" \
--exclude=".git" \
--include='*.h' \
--include='*/' \
--include="apr_thread_compatible_pool.cc" \
--include="serf_url_async_fetcher.cc" \
--include="apr_mem_cache.cc" \
--include="key_value_codec.cc" \
--include="apr_memcache2.c" \
--include="loopback_route_fetcher.cc" \
--include="add_headers_fetcher.cc" \
--include="console_css_out.cc" \
--include="console_out.cc" \
--include="dense_hash_map" \
--include="dense_hash_set" \
--include="sparse_hash_map" \
--include="sparse_hash_set" \
--include="sparsetable" \
--include="mod_pagespeed_console_out.cc" \
--include="mod_pagespeed_console_css_out.cc" \
--include="mod_pagespeed_console_html_out.cc" \
--exclude='*'
mkdir -p psol/lib/Debug/linux/ia32
mkdir -p psol/lib/Debug/linux/x64
mkdir -p psol/lib/Release/linux/ia32
mkdir -p psol/lib/Release/linux/x64
# Log that we did this.
SVN_REVISION="$(svn info $MOD_PAGESPEED_SRC | grep Revision | awk '{print $2}')"
SVN_TAG="$(svn info $MOD_PAGESPEED_SRC | grep URL | awk -F/ '{print $(NF-1)}')"
DATE="$(date +%F)"
echo "${DATE}: Copied from mod_pagespeed ${SVN_TAG}@r${SVN_REVISION} ($USER)" \
>> psol/include_history.txt
echo
echo "Output is in psol/include. Now put binaries in psol/lib following"
echo "https://github.com/pagespeed/ngx_pagespeed/wiki/Building-Release-Binaries"
echo "and then you can distribute PSOL."
+15 -1
View File
@@ -84,6 +84,7 @@ extern ngx_module_t ngx_pagespeed;
// Needed for SystemRewriteDriverFactory to use shared memory. // Needed for SystemRewriteDriverFactory to use shared memory.
#define PAGESPEED_SUPPORT_POSIX_SHARED_MEM #define PAGESPEED_SUPPORT_POSIX_SHARED_MEM
#define NGINX_1_13_4 1013004
net_instaweb::NgxRewriteDriverFactory* active_driver_factory = NULL; net_instaweb::NgxRewriteDriverFactory* active_driver_factory = NULL;
@@ -3007,13 +3008,17 @@ ngx_int_t ps_preaccess_handler(ngx_http_request_t* r) {
ph = cmcf->phase_engine.handlers; ph = cmcf->phase_engine.handlers;
i = r->phase_handler; i = r->phase_handler;
// move handlers before try_files && content phase // move handlers before try_files && content phase
// As of nginx 1.13.4 we will be right before the try_files module
#if (nginx_version < NGINX_1_13_4)
while (ph[i + 1].checker != ngx_http_core_try_files_phase && while (ph[i + 1].checker != ngx_http_core_try_files_phase &&
ph[i + 1].checker != ngx_http_core_content_phase) { ph[i + 1].checker != ngx_http_core_content_phase) {
ph[i] = ph[i + 1]; ph[i] = ph[i + 1];
ph[i].next--; ph[i].next--;
i++; i++;
} }
#endif
// insert ps phase handler // insert ps phase handler
ph[i].checker = ps_phase_handler; ph[i].checker = ps_phase_handler;
@@ -3069,8 +3074,17 @@ ngx_int_t ps_init(ngx_conf_t* cf) {
ngx_http_core_main_conf_t* cmcf = static_cast<ngx_http_core_main_conf_t*>( ngx_http_core_main_conf_t* cmcf = static_cast<ngx_http_core_main_conf_t*>(
ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module)); ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module));
int phase = NGX_HTTP_PREACCESS_PHASE;
// As of nginx 1.13.4, try_files has changed.
// https://github.com/nginx/nginx/commit/129b06dc5dfab7b4513a4f274b3778cd9b8a6a22
#if (nginx_version >= NGINX_1_13_4)
phase = NGX_HTTP_PRECONTENT_PHASE;
#endif
ngx_http_handler_pt* h = static_cast<ngx_http_handler_pt*>( ngx_http_handler_pt* h = static_cast<ngx_http_handler_pt*>(
ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers)); ngx_array_push(&cmcf->phases[phase].handlers));
if (h == NULL) { if (h == NULL) {
return NGX_ERROR; return NGX_ERROR;
} }
+4
View File
@@ -87,6 +87,10 @@ NgxRewriteDriverFactory::NgxRewriteDriverFactory(
shut_down_(false) { shut_down_(false) {
InitializeDefaultOptions(); InitializeDefaultOptions();
default_options()->set_beacon_url("/ngx_pagespeed_beacon"); default_options()->set_beacon_url("/ngx_pagespeed_beacon");
// Put in the version of the ngx-pagespeed release. We don't release mod_pagespeed
// so we cannot rely on PSOL to hand us to right version. Note that if we perform
// another release, this must be either updated or removed.
default_options()->set_x_header_value("1.12.34.3-0");
SystemRewriteOptions* system_options = dynamic_cast<SystemRewriteOptions*>( SystemRewriteOptions* system_options = dynamic_cast<SystemRewriteOptions*>(
default_options()); default_options());
system_options->set_file_cache_clean_inode_limit(500000); system_options->set_file_cache_clean_inode_limit(500000);