diff --git a/.forgejo/workflows/docker.yaml b/.forgejo/workflows/docker.yaml index 7944c61..4c8b3b2 100644 --- a/.forgejo/workflows/docker.yaml +++ b/.forgejo/workflows/docker.yaml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - php-version: ["8.0", "8,1", "8.2", "8.3", "8.4"] + php-version: ["8.0", "8,1", "8.2", "8.3", "8.4", "8.5"] variant: [""] name: haze-${{ matrix.php-version }}${{ matrix.variant }} diff --git a/README.md b/README.md index 6407db8..87debd4 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ haze start [database] [php-version] [services] [vX.Y.Z] Where `database` is one of `sqlite`, `mysql`, `mariadb`, `pgsql` or `oracle` with an optional version (e.g. `pgsql:12`), defaults to `sqlite`. And -`php-version` is one of `8.0`, `8.1`, `8.2`, `8.3` or `8.4`, defaults to the -maximum version support by the current Nextcloud version. +`php-version` is one of `8.0`, `8.1`, `8.2`, `8.3`, `8.4` or `8.5`, defaults to +the maximum version support by the current Nextcloud version. Each php version also comes with a `-dbg` variant that has php compiled in debug mode and can be used for debugging php itself with gdb. diff --git a/flake.lock b/flake.lock index 4ffb480..a7766b8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1760924934, - "narHash": "sha256-tuuqY5aU7cUkR71sO2TraVKK2boYrdW3gCSXUkF4i44=", + "lastModified": 1763938834, + "narHash": "sha256-j8iB0Yr4zAvQLueCZ5abxfk6fnG/SJ5JnGUziETjwfg=", "owner": "ipetkov", "repo": "crane", - "rev": "c6b4d5308293d0d04fcfeee92705017537cad02f", + "rev": "d9e753122e51cee64eb8d2dddfe11148f339f5a2", "type": "github" }, "original": { @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1764593611, - "narHash": "sha256-6SdexcO69Dlu14YN2xuB1A6JHWSrcqMj7Na9oK7IT2M=", + "lastModified": 1773062095, + "narHash": "sha256-u+cK9IoJokO4YzQwMc2s8Vti0RL/LVSrROOEn2opc5U=", "owner": "nix-community", "repo": "flakelight", - "rev": "0d63256401341f528dd628f1a8e96d3afecade7a", + "rev": "c99e4d5f40e578cb2d8f460ea2bbd5dc26316d24", "type": "github" }, "original": { @@ -60,11 +60,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1763591898, - "narHash": "sha256-aHSMj7CIa9EJYxdf05wOWRGp0KRsT/TAox7uwVSdDb8=", + "lastModified": 1772297202, + "narHash": "sha256-UEzHO/tCmhPhr8RpWtbm1MTa7ABobwt3nCjrcuDAPm0=", "ref": "refs/heads/main", - "rev": "2d9b2da2c9f384f93ef977c48f8ee35ce586529b", - "revCount": 66, + "rev": "8690e1514863b934de12f2a503c9431d186ce30b", + "revCount": 68, "type": "git", "url": "https://codeberg.org/icewind/mill-scale.git" }, @@ -75,11 +75,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764522689, - "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", + "lastModified": 1772822230, + "narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", + "rev": "71caefce12ba78d84fe618cf61644dce01cf3a96", "type": "github" }, "original": { @@ -90,11 +90,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1772956932, - "narHash": "sha256-M0yS4AafhKxPPmOHGqIV0iKxgNO8bHDWdl1kOwGBwRY=", + "lastModified": 1772173633, + "narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "608d0cadfed240589a7eea422407a547ad626a14", + "rev": "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6", "type": "github" }, "original": { @@ -141,11 +141,11 @@ ] }, "locked": { - "lastModified": 1761964689, - "narHash": "sha256-Zo3LQQDz+64EQ9zor/WmeNTFLoZkjmhp0UY3G0D3seE=", + "lastModified": 1764557621, + "narHash": "sha256-kX5PoY8hQZ80+amMQgOO9t8Tc1JZ70gYRnzaVD4AA+o=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "63d22578600f70d293aede6bc737efef60ebd97f", + "rev": "93316876c2229460a5d6f5f052766cc4cef538ce", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 991f5e8..9934eb7 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,7 @@ ]; packages = { + "haze-image-php-8.5" = pkgs: pkgs.haze-image-php-85; "haze-image-php-8.4" = pkgs: pkgs.haze-image-php-84; "haze-image-php-8.3" = pkgs: pkgs.haze-image-php-83; "haze-image-php-8.2" = pkgs: pkgs.haze-image-php-82; diff --git a/nix/image/bootstrap.sh b/nix/image/bootstrap.sh index 50c14c2..a00a950 100755 --- a/nix/image/bootstrap.sh +++ b/nix/image/bootstrap.sh @@ -9,7 +9,7 @@ echo "# Options in here overwrite the builtin php.ini" > /config/php.ini echo "# xdebug.mode = debug" >> /config/php.ini echo "# xdebug.start_with_request = yes" >> /config/php.ini chmod 0777 /config/php.ini -PHP_INI_DIR="$(php --ini | grep 'Scan' | cut -d ' ' -f7)" +PHP_INI_DIR="$(php --ini | grep 'Scan' | cut -d ' ' -f7 | tr -d '"')" ln -s /config/php.ini "$PHP_INI_DIR/zz_extra.ini" HAZE_UID=${HAZE_UID:-www-data} diff --git a/nix/overlay.nix b/nix/overlay.nix index 1f927f8..276b70e 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,5 +1,6 @@ final: prev: { haze = final.callPackage ./package.nix {}; + haze-image-php-85 = final.callPackage ./image/haze.nix {php = final.php85;}; haze-image-php-84 = final.callPackage ./image/haze.nix {php = final.php84;}; haze-image-php-83 = final.callPackage ./image/haze.nix {php = final.php83;}; haze-image-php-82 = final.callPackage ./image/haze.nix {php = final.php82;}; diff --git a/src/php.rs b/src/php.rs index 0842ec2..2d037bc 100644 --- a/src/php.rs +++ b/src/php.rs @@ -21,20 +21,18 @@ use tokio::time::{sleep, timeout}; #[allow(dead_code)] pub enum PhpVersion { #[default] + Php85, Php84, Php83, Php82, Php81, Php80, - Php74, - Php73, + Php85Dbg, Php84Dbg, Php83Dbg, Php82Dbg, Php81Dbg, Php80Dbg, - Php74Dbg, - Php73Dbg, } pub const PHP_MEMORY_LIMIT: i64 = 2 * 1024 * 1024 * 1024; @@ -44,24 +42,20 @@ impl FromStr for PhpVersion { fn from_str(s: &str) -> Result { match s { - "7" => Ok(PhpVersion::Php74), - "7.3" => Ok(PhpVersion::Php73), - "7.4" => Ok(PhpVersion::Php74), "8" => Ok(PhpVersion::Php81), "8.0" => Ok(PhpVersion::Php80), "8.1" => Ok(PhpVersion::Php81), "8.2" => Ok(PhpVersion::Php82), "8.3" => Ok(PhpVersion::Php83), "8.4" => Ok(PhpVersion::Php84), - "7-dbg" => Ok(PhpVersion::Php74Dbg), - "7.3-dbg" => Ok(PhpVersion::Php73Dbg), - "7.4-dbg" => Ok(PhpVersion::Php74Dbg), + "8.5" => Ok(PhpVersion::Php84), "8-dbg" => Ok(PhpVersion::Php80Dbg), "8.0-dbg" => Ok(PhpVersion::Php80Dbg), "8.1-dbg" => Ok(PhpVersion::Php81Dbg), "8.2-dbg" => Ok(PhpVersion::Php82Dbg), "8.3-dbg" => Ok(PhpVersion::Php83Dbg), "8.4-dbg" => Ok(PhpVersion::Php84Dbg), + "8.5-dbg" => Ok(PhpVersion::Php85Dbg), _ => Err(()), } } @@ -73,53 +67,47 @@ impl PhpVersion { } pub fn image(&self) -> &'static str { - // for now only 7.4 match self { - PhpVersion::Php73 => "icewind1991/haze:7.3", - PhpVersion::Php74 => "icewind1991/haze:7.4", PhpVersion::Php80 => "icewind1991/haze:8.0", PhpVersion::Php81 => "icewind1991/haze:8.1", PhpVersion::Php82 => "icewind1991/haze:8.2", PhpVersion::Php83 => "icewind1991/haze:8.3", PhpVersion::Php84 => "icewind1991/haze:8.4", - PhpVersion::Php73Dbg => "icewind1991/haze:7.3-dbg", - PhpVersion::Php74Dbg => "icewind1991/haze:7.4-dbg", + PhpVersion::Php85 => "icewind1991/haze:8.5", PhpVersion::Php80Dbg => "icewind1991/haze:8.0-dbg", PhpVersion::Php81Dbg => "icewind1991/haze:8.1-dbg", PhpVersion::Php82Dbg => "icewind1991/haze:8.2-dbg", PhpVersion::Php83Dbg => "icewind1991/haze:8.3-dbg", PhpVersion::Php84Dbg => "icewind1991/haze:8.4-dbg", + PhpVersion::Php85Dbg => "icewind1991/haze:8.5-dbg", } } pub fn name(&self) -> &'static str { match self { - PhpVersion::Php73 => "7.3", - PhpVersion::Php74 => "7.4", PhpVersion::Php80 => "8.0", PhpVersion::Php81 => "8.1", PhpVersion::Php82 => "8.2", PhpVersion::Php83 => "8.3", PhpVersion::Php84 => "8.4", - PhpVersion::Php73Dbg => "7.3-dbg", - PhpVersion::Php74Dbg => "7.4-dbg", + PhpVersion::Php85 => "8.4", PhpVersion::Php80Dbg => "8.0-dbg", PhpVersion::Php81Dbg => "8.1-dbg", PhpVersion::Php82Dbg => "8.2-dbg", PhpVersion::Php83Dbg => "8.3-dbg", PhpVersion::Php84Dbg => "8.4-dbg", + PhpVersion::Php85Dbg => "8.4-dbg", } } pub fn from_number(major: u8, minor: u8) -> Option { match (major, minor) { - (7, 3) => Some(PhpVersion::Php73), - (7, 4) => Some(PhpVersion::Php74), (8, 0) => Some(PhpVersion::Php80), (8, 1) => Some(PhpVersion::Php81), (8, 2) => Some(PhpVersion::Php82), (8, 3) => Some(PhpVersion::Php83), (8, 4) => Some(PhpVersion::Php84), + (8, 5) => Some(PhpVersion::Php85), _ => None, } } @@ -127,27 +115,25 @@ impl PhpVersion { pub fn max_minor(major: u8) -> u8 { match major { 7 => 4, - 8 => 4, + 8 => 5, _ => 0, } } pub fn all() -> impl Iterator { [ - PhpVersion::Php73, - PhpVersion::Php74, PhpVersion::Php80, PhpVersion::Php81, PhpVersion::Php82, PhpVersion::Php83, PhpVersion::Php84, - PhpVersion::Php73Dbg, - PhpVersion::Php74Dbg, + PhpVersion::Php85, PhpVersion::Php80Dbg, PhpVersion::Php81Dbg, PhpVersion::Php82Dbg, PhpVersion::Php83Dbg, PhpVersion::Php84Dbg, + PhpVersion::Php85Dbg, ] .into_iter() }