Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Development

Otto van der Schaaf edited this page Apr 9, 2018 · 38 revisions

Getting Started

New Developers

  1. If you don't have a github account, make one. Then set up ssh keys

  2. Fork the ngx_pagespeed and mod_pagespeed repos

(Note: if you're a committer, skip the forking and see below instead.)

  1. Set up a development client:
# If you are not a committer: 
# update this to your ngx_pagespeed fork's url.
NGX_PAGESPEED_FORK=git@github.com:apache/incubator-pagespeed-ngx.git

git clone "$NGX_PAGESPEED_FORK" ngx_pagespeed
cd ngx_pagespeed
git submodule init
git submodule update

# Run these for working with the bleeding edge of of mod_pagespeed:
# pushd testing-dependencies/mod_pagespeed
# git checkout master
# popd

git submodule update --init --recursive --jobs=6

# If you are not a committer:
# edit .git/config to change the repo url for mod_pagespeed to be
# the one for your fork (if you need to change mod_pagespeed).

# Optionally - speed up the build by using concurrent jobs:
# export MAKEFLAGS=-j8
scripts/build_ngx_pagespeed.sh --devel

This will put an ngx_pagespeed checkout in your current directory, download mod_pagespeed, apache, and nginx inside that, then build PSOL, apache, and nginx from source. It will put the apache it builds in ~/apache2, because you only have to build it once and multiple checkouts/branches can share the same copy.

  1. Make changes to files.

  2. Run tests:

cd ~/ngx_pagespeed/testing_dependencies/mod_pagespeed/devel
make apache_test  # unit tests
make apache_debug_smoke_test  # system tests
make apache_debug_leak_test  # unit tests and smoke tests under valgrind
./checkin  # those tests, and many more, very slow

cd ~/ngx_pagespeed/
scripts/rebuild.sh
test/run_tests.sh
  1. Submit your changes back as a pull request. You'll need to make separate pull requests for ngx_pagespeed and mod_pagespeed changes

When pushing to github for a pull request, prefix your branch with your username. For example, I might call a branch jefftk-fix-submodules.

Committers

If you're a mod_pagespeed committer, then you don't need to fork, but you do need to change the subresource urls from https:// to git://.

To make changes that will affect both mod_pagespeed and ngx_pagespeed, start by checking out ngx_pagespeed, and mod_pagespeed will be pulled in as a testing dependency. This is needed to build PSOL -- the server-independent optimization library:

git clone git@github.com:apache/incubator-pagespeed-ngx.git ngx_pagespeed
cd ngx_pagespeed
git checkout USERNAME-new-branch-title
scripts/build_ngx_pagespeed.sh --devel

When you use this flow and edit inside mod_pagespeed, be sure you are working with mod_pagespeed at HEAD.

TODO(oschaaf): show minimal git command to update testing-dependencies/mod_pagespeed to HEAD.

If you are planning on working only in the core of PSOL or on the Apache-specific parts, you can check out mod_pagespeed directly, and start by building the debug binary and running unit tests and system tests.

git clone git@github.com:apache/incubator-pagespeed-mod.git mod_pagespeed
cd mod_pagespeed
git submodule update --init --recursive
git checkout USERNAME-new-branch-title
cd devel
# Build and run unit tests
make -j8 apache_test
# Build and run system-tests
make -j8 apache_debug_smoke_test

Developing

If you're developing mod_pagespeed, here are some other things you're likely to need:

Clone this wiki locally