Merge pull request #176063 from Izorkin/update-unit

unit: 1.26.1 -> 1.27.0

authored by Guillaume Girol and committed by GitHub df9f6848 5e78a8ac

+30 -10
+11 -6
nixos/tests/web-servers/unit-php.nix
··· 10 10 services.unit = { 11 11 enable = true; 12 12 config = pkgs.lib.strings.toJSON { 13 - listeners."*:9080".application = "php_80"; 14 - applications.php_80 = { 15 - type = "php 8.0"; 13 + listeners."*:9081".application = "php_81"; 14 + applications.php_81 = { 15 + type = "php 8.1"; 16 16 processes = 1; 17 17 user = "testuser"; 18 18 group = "testgroup"; 19 19 root = "${testdir}/www"; 20 20 index = "info.php"; 21 - options.file = "${pkgs.unit.usedPhp80}/lib/php.ini"; 21 + options.file = "${pkgs.unit.usedPhp81}/lib/php.ini"; 22 22 }; 23 23 }; 24 24 }; ··· 34 34 }; 35 35 }; 36 36 testScript = '' 37 + machine.start() 38 + 37 39 machine.wait_for_unit("unit.service") 40 + machine.wait_for_open_port(9081) 38 41 39 42 # Check so we get an evaluated PHP back 40 - response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9080/") 41 - assert "PHP Version ${pkgs.unit.usedPhp80.version}" in response, "PHP version not detected" 43 + response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/") 44 + assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected" 42 45 43 46 # Check so we have database and some other extensions loaded 44 47 for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: 45 48 assert ext in response, f"Missing {ext} extension" 49 + 50 + machine.shutdown() 46 51 ''; 47 52 })
+19 -4
pkgs/servers/http/unit/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, nixosTests, which 2 2 , pcre2 3 3 , withPython3 ? true, python3, ncurses 4 - , withPHP80 ? true, php80 4 + , withPHP80 ? false, php80 5 + , withPHP81 ? true, php81 5 6 , withPerl532 ? false, perl532 6 7 , withPerl534 ? true, perl534 7 8 , withPerldevel ? false, perldevel 8 - , withRuby_2_7 ? false, ruby_2_7 9 + , withRuby_2_7 ? true, ruby_2_7 10 + , withRuby_3_0 ? false, ruby_3_0 11 + , withRuby_3_1 ? false, ruby_3_1 9 12 , withSSL ? true, openssl ? null 10 13 , withIPv6 ? true 11 14 , withDebug ? false ··· 24 27 }; 25 28 26 29 php80-unit = php80.override phpConfig; 30 + php81-unit = php81.override phpConfig; 27 31 28 32 in stdenv.mkDerivation rec { 29 - version = "1.26.1"; 33 + version = "1.27.0"; 30 34 pname = "unit"; 31 35 32 36 src = fetchFromGitHub { 33 37 owner = "nginx"; 34 38 repo = pname; 35 39 rev = version; 36 - sha256 = "sha256-rTT7EJSHepGOwNXVqlOBOhZayZQXyNo3B2Oa1oLf2FI="; 40 + sha256 = "sha256-H/WIrCyocEO/HZfVMyI9IwD565JsUIzC8n1qUYmCvWc="; 37 41 }; 38 42 39 43 nativeBuildInputs = [ which ]; ··· 41 45 buildInputs = [ pcre2.dev ] 42 46 ++ optionals withPython3 [ python3 ncurses ] 43 47 ++ optional withPHP80 php80-unit 48 + ++ optional withPHP81 php81-unit 44 49 ++ optional withPerl532 perl532 45 50 ++ optional withPerl534 perl534 46 51 ++ optional withPerldevel perldevel 47 52 ++ optional withRuby_2_7 ruby_2_7 53 + ++ optional withRuby_3_0 ruby_3_0 54 + ++ optional withRuby_3_1 ruby_3_1 48 55 ++ optional withSSL openssl; 49 56 50 57 configureFlags = [ ··· 58 65 59 66 # Optionally add the PHP derivations used so they can be addressed in the configs 60 67 usedPhp80 = optionals withPHP80 php80-unit; 68 + usedPhp81 = optionals withPHP81 php81-unit; 61 69 62 70 postConfigure = '' 63 71 ${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"} 64 72 ${optionalString withPHP80 "./configure php --module=php80 --config=${php80-unit.unwrapped.dev}/bin/php-config --lib-path=${php80-unit}/lib"} 73 + ${optionalString withPHP81 "./configure php --module=php81 --config=${php81-unit.unwrapped.dev}/bin/php-config --lib-path=${php81-unit}/lib"} 65 74 ${optionalString withPerl532 "./configure perl --module=perl532 --perl=${perl532}/bin/perl"} 66 75 ${optionalString withPerl534 "./configure perl --module=perl534 --perl=${perl534}/bin/perl"} 67 76 ${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"} 68 77 ${optionalString withRuby_2_7 "./configure ruby --module=ruby27 --ruby=${ruby_2_7}/bin/ruby"} 78 + ${optionalString withRuby_3_0 "./configure ruby --module=ruby30 --ruby=${ruby_3_0}/bin/ruby"} 79 + ${optionalString withRuby_3_1 "./configure ruby --module=ruby31 --ruby=${ruby_3_1}/bin/ruby"} 80 + ''; 81 + 82 + postInstall = '' 83 + rmdir $out/state 69 84 ''; 70 85 71 86 passthru.tests.unit-php = nixosTests.unit-php;