oschaaf commented on issue #1695:
URL: 
https://github.com/apache/incubator-pagespeed-ngx/issues/1695#issuecomment-647424399


   FWIW, I checked, and I could build nginx 1.17.0 with ngx_pagespeed@head 
against mod_pagespeed@head without any trouble.
   
   Leaving the hack and slash script I used to test as a breadcrumb, maybe 
someone else finds it useful (possibly future me :-)).
   High level that creates ~/working dir and ends up producing a working 
nginx/ngx_pagespeed binary.
   
   - Builds a release version of `pagespeed_automatic.a` from mod_pagespeed 
using an Ubuntu 16.04 docker image. We build this with a relatively old gcc 
version for compatibility reasons. 
   - Builds nginx/ngx_pagespeed directly on the machine, consuming the artifact 
from the step above. Further configuring nginx is a matter of modifying the 
`./configure` line. (My dev machine used clang-10, but this ought to just work 
with most gcc/clang versions)
   
   ```bash
   set -xue
   
   PREFIX=${PREFIX:-${USER}}
   
   mkdir -p ~/workdir
   cd ~/workdir
   
   if [ ! -d incubator-pagespeed-mod ]; then
     git clone --recursive --jobs=10 
https://github.com/apache/incubator-pagespeed-mod.git
   fi
   
   echo "                                                                       
                                                                                
                                                                                
 
   incubator-pagespeed-mod/out/                                                 
                                                                                
                                                                                
 
   incubator-pagespeed-mod/tools/                                               
                                                                                
                                                                                
 
   incubator-pagespeed-mod/log/                                                 
                                                                                
                                                                                
 
   incubator-pagespeed-mod/third_party/                                         
                                                                                
                                                                                
 
   incubator-pagespeed-mod/.git/                                                
                                                                                
                                                                                
 
   " > .dockerignore
   
   docker build --tag "${PREFIX}/pagespeed-dev:latest" -f- . <<EOF              
                                                                                
                                                                                
 
     FROM ubuntu:xenial                                                         
                                                                                
                                                                                
 
     WORKDIR "/build/"                                                          
                                                                                
                                                                                
 
     RUN apt update && apt install -y sudo lsb-core                             
                                                                                
                                                                                
 
     COPY incubator-pagespeed-mod/ /build                                       
                                                                                
                                                                                
 
     RUN install/run_with_log.sh log/install_packages.log                       
                                                                                
                                                                                
 
     RUN install/install_required_packages.sh --additional_dev_packages         
                                                                                
                                                                                
 
   EOF                                                                          
                                                                                
                                                                                
 
   
   docker run -v $(pwd):/build/ -it  pagespeed:latest /bin/bash -c \
   "                                                                            
                                                                                
                                                                                
 
   set -xueo pipefail                                                           
                                                                                
                                                                                
 
   pushd incubator-pagespeed-mod                                                
                                                                                
                                                                                
 
   export MAKEFLAGS=\"-j$(nproc)\"                                              
                                                                                
                                                                                
 
   build/gyp_chromium --depth=.                                                 
                                                                                
                                                                                
 
   pushd pagespeed/automatic                                                    
                                                                                
                                                                                
 
   make BUILDTYPE=Release -C ../../pagespeed/automatic all                      
                                                                                
                                                                                
 
   "
   
   git clone https://github.com/apache/incubator-pagespeed-ngx.git
   wget http://nginx.org/download/nginx-1.17.0.tar.gz
   tar -xvzf nginx-1.17.0.tar.gz
   
   cd nginx-1.17.0
   export MAKEFLAGS=-j$(nproc)
   MOD_PAGESPEED_DIR="$(pwd)/../incubator-pagespeed-mod/" ./configure 
--with-cc-opt="-Wno-error" --add-module="$(pwd)/../incubator-pagespeed-ngx"
   make
   
   echo "nginx binary build. you can cd into nginx-1.17.0 and make install"
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to