-
Notifications
You must be signed in to change notification settings - Fork 6
Development
-
If you don't have a github account, make one. Then set up ssh keys
-
Fork the ngx_pagespeed and mod_pagespeed repos
(Note: if you're a committer, skip the forking and see below instead.)
- Set up a development client:
# If you are not a committer:
# update this to your ngx_pagespeed fork's url.
[email protected]:apache/incubator-pagespeed-ngx.git
git clone "$NGX_PAGESPEED_FORK" ngx_pagespeed
cd ngx_pagespeed
git submodule init
git submodule update
# Fix submodule URLs to point to GitHub
find ./ -iname .gitmodules -exec sed -i s,git://git.apache.org,https://github.com/apache,g {} \;
# 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.
-
Make changes to files.
-
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
- 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
.
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 [email protected]: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 [email protected]:apache/incubator-pagespeed-mod.git mod_pagespeed
cd mod_pagespeed
git submodule update --init --recursive
git checkout -b 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
If you're developing mod_pagespeed, here are some other things you're likely to need:
- Standing up a development server
- Debugging
- User-facing Documentation
- Differences between ngx_pagespeed and mod_pagespeed
- Travis: continuous integration system that runs our tests automatically on commits and PRs
- Memory Profiling
- Slurping
- Symbolizing backtraces
- Updating External Dependencies