Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: Add option for enabling pagespeed, option for additional modules #33708

Closed
wants to merge 4 commits into from

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Jan 10, 2018

Motivation for this change

Make it easier to configure nginx servers using modules beyond those bundled by default, especially to automate the boilerplate required to use pagespeed.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

cc @3noch @adisbladis

@dtzWill
Copy link
Member Author

dtzWill commented Feb 5, 2018

@GrahamcOfBorg test nginx-pagespeed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

error: attribute ‘nginx-pagespeed’ in selection path ‘tests.nginx-pagespeed’ not found

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

error: attribute 'nginx-pagespeed' in selection path 'tests.nginx-pagespeed' not found

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘psol-1.13.35.2’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/development/libraries/psol/generic.nix:9 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

make[1]: Leaving directory '/build/nginx-1.12.2'
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2
shrinking /nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2/bin/nginx
strip is /nix/store/xmpjypwjmp2qi1chs5kr0hacnh161ls4-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2/bin
patching script interpreter paths in /nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2
checking for references to /build in /nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2...
/nix/store/j53wj3v8vjh6fpkd1qwbh1s3llhcfm0c-nginx-1.12.2
/nix/store/dilwjma3i6aicbi5gd6a1p3fzk4m9gs1-psol-1.13.35.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

test -d '/nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/logs' \
	|| mkdir -p '/nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/logs'
make[1]: Leaving directory '/tmp/nix-build-nginx-1.12.2.drv-0/nginx-1.12.2'
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2
shrinking /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/bin/nginx
strip is /nix/store/5qj61lcvzlap87rf6blvf8p577d482bv-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/bin 
patching script interpreter paths in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2
checking for references to /tmp/nix-build-nginx-1.12.2.drv-0 in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2...

@dtzWill dtzWill force-pushed the feature/nginx-pagespeed-nixos branch from 11509fc to 7f8181d Compare February 13, 2018 22:00
@dtzWill
Copy link
Member Author

dtzWill commented Feb 13, 2018

Eep, apologies about that. Dishonor on me and my family. :(.

@GrahamcOfBorg test nginx-pagespeed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

cannot build derivation '/nix/store/ifxv75bg73z8czi3h9bvjqm230hla22d-unit-nginx.service.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/113dyxahq52l7l1693nrs4jimzdwkcks-system-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/77cf4i1lx4g40vvrqdywnrz3gn2niq7c-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/l69l8jaqbjzmi13gk58md60dv0mna4b8-nixos-system-webserver-18.03.git.7f8181d.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rwspyna68883l8qc3qq8lfjb81mw5i4x-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/mbzycn5q7ndn0c9dd6an2dayiaqcxvx1-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/0dwvvk9bnsbzriakgf4plvgy2zmnzw6z-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/k0rh09r0a87mxqlfxpwq9k95hnha0spy-nixos-test-driver-nginx-pagespeed.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/py97mp16a4irji509i37yc5mik52c8zq-vm-test-run-nginx-pagespeed.drv': 1 dependencies couldn't be built
error: build of '/nix/store/py97mp16a4irji509i37yc5mik52c8zq-vm-test-run-nginx-pagespeed.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

webserver# [    8.087609] systemd-shutdown[1]: All filesystems unmounted.
webserver# [    8.090730] ACPI: Preparing to enter system sleep state S5
webserver# [    8.091163] reboot: Power down
vde_switch: EOF data port: Interrupted system call
collecting coverage data
syncing
test script finished in 9.12s
vde_switch: EOF on stdin, cleaning up and exiting
cleaning up
/nix/store/2kg2nnbp6cycck2cghbwzcbrqrzcrmqj-vm-test-run-nginx-pagespeed

@dtzWill
Copy link
Member Author

dtzWill commented Feb 13, 2018

Haha, neat! FWIW aarch64 is because of builder's shell.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
./configure: auto/os/linux: line 21: syntax error: support for $((arith)) is disabled
builder for '/nix/store/79mq11kgvav5msl27id1h6xn7zj8h42f-nginx-1.12.2.drv' failed with exit code 2
error: build of '/nix/store/79mq11kgvav5msl27id1h6xn7zj8h42f-nginx-1.12.2.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

	|| mkdir -p '/nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2/logs'
test -d '/nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2/html' \
	|| cp -R html '/nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2'
test -d '/nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2/logs' \
	|| mkdir -p '/nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2/logs'
make[1]: Leaving directory '/private/tmp/nix-build-nginx-1.12.2.drv-0/nginx-1.12.2'
post-installation fixup
strip is /nix/store/5a88zk3jgimdmzg8rfhvm93kxib3njf9-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2/bin
patching script interpreter paths in /nix/store/mddwj2kacypkxxkl0gvk2wchymipx4r4-nginx-1.12.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

test -d '/nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/logs' \
	|| mkdir -p '/nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/logs'
make[1]: Leaving directory '/tmp/nix-build-nginx-1.12.2.drv-0/nginx-1.12.2'
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2
shrinking /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/bin/nginx
strip is /nix/store/5qj61lcvzlap87rf6blvf8p577d482bv-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2/bin 
patching script interpreter paths in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2
checking for references to /tmp/nix-build-nginx-1.12.2.drv-0 in /nix/store/8s9laic3cc3nivq9izqll31q8p2f6raz-nginx-1.12.2...

@dtzWill
Copy link
Member Author

dtzWill commented Feb 20, 2018

Needs minor touch-up for package vs cfg.package after preStart improvement, otherwise config is evaluated with wrong nginx (that doesn't have extra modules such as pagespeed built in), I have a branch with this fix.

@Ericson2314 Ericson2314 removed their request for review February 24, 2018 02:26
@dtzWill
Copy link
Member Author

dtzWill commented Feb 27, 2018

Will just use this locally then, it's a bit much to go ahead with without more general interest.

@dtzWill dtzWill closed this Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants