diff --git a/.github/run-emacs-27-2.sh b/.github/run-emacs-27-2.sh new file mode 100755 index 0000000..c9c1e49 --- /dev/null +++ b/.github/run-emacs-27-2.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# Build this package with Emacs 27.2 from nix-emacs-ci. +# +# CI does not cover Emacs 27 (see .github/workflows/test.yml), so this is the +# way to check the floor declared in Package-Requires by hand. +# +# nix-emacs-ci does not expose Emacs 27 on aarch64-darwin, only on +# x86_64-darwin, so on Apple Silicon this runs through Rosetta. That needs +# `extra-platforms = x86_64-darwin` in /etc/nix/nix.conf. Reaching the +# prebuilt binaries also needs your user in `trusted-users` there, otherwise +# the daemon silently ignores the substituter below and builds from source. +set -euo pipefail + +# Pinned rather than master, so that the Emacs you get today is the Emacs you +# got last time. nix-emacs-ci pins nixpkgs in its own flake.lock, so following +# master would change the derivation -- and on a platform without prebuilt +# binaries (see below) that means rebuilding Emacs from source. +NIX_EMACS_CI_REV=${NIX_EMACS_CI_REV:-ca88f42462347e8e17859645aa59b156617e98fb} +NIX_EMACS_CI=${NIX_EMACS_CI:-https://github.com/purcell/nix-emacs-ci/archive/${NIX_EMACS_CI_REV}.tar.gz} +EMACS_ATTR=${EMACS_ATTR:-emacs-27-2} + +case "$(uname -s)/$(uname -m)" in + Darwin/arm64) SYSTEM=x86_64-darwin ;; + Darwin/*) SYSTEM=x86_64-darwin ;; + Linux/x86_64) SYSTEM=x86_64-linux ;; + Linux/aarch64) SYSTEM=aarch64-linux ;; + *) echo "unsupported host: $(uname -s)/$(uname -m)" >&2; exit 1 ;; +esac + +cd "$(dirname "$0")/.." + +echo "==> Fetching ${EMACS_ATTR} for ${SYSTEM}" +emacs_path=$(nix-build --no-out-link \ + --option system "${SYSTEM}" \ + --option extra-substituters https://emacs-ci.cachix.org \ + --option extra-trusted-public-keys emacs-ci.cachix.org-1:B5FVOrxhXXrOL0S+tQ7USrhjMT5iOPH+QN9q0NItom4= \ + -A "${EMACS_ATTR}" \ + -E "import (fetchTarball \"${NIX_EMACS_CI}\")") + +export PATH="${emacs_path}/bin:${PATH}" +export EMACS="${emacs_path}/bin/emacs" + +echo "==> $("${EMACS}" --version | head -1)" + +# Stale .elc files silently win over newer .el, which would hide a failure. +find . -maxdepth 1 -name '*.elc' -delete +rm -rf .eask + +echo "==> eask install-deps" +eask install-deps + +echo "==> eask compile" +eask compile + +echo "==> OK" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d77a33..6cfecb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,12 @@ jobs: - 30.1 experimental: [false] include: + # Emacs 27.1 is the declared floor. Run it on Ubuntu only: its + # dependencies come from MELPA Stable via Eask.27 (MELPA's HEAD needs + # Emacs 28.1), and one platform is enough to catch a 27-specific break. + - os: ubuntu-latest + emacs-version: "27.2" + experimental: false - os: ubuntu-latest emacs-version: snapshot experimental: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f29d5b..e6244e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,11 @@ All notable changes of the `phpstan.el` are documented in this file using the [K * Fix `flycheck-phpstan` silently discarding the fallback warning when PHPStan produced no JSON report, hiding failures such as a broken configuration file behind a clean buffer. * Fix editor mode detection asking the wrong program for its version. Only the first element of the command line was probed, which is the container runtime for `(phpstan-executable . docker)` / `container` and `php` for a PHAR without the executable bit — so `docker --version` and `php --version` were parsed as PHPStan versions (`d1c06ef`, `Technologies`) and editor mode was silently disabled for every setup except a directly executable `phpstan`. * `phpstan-version` and `phpstan-editor-mode-available-p` now take the whole command line, as returned by `phpstan-get-executable-and-args`. A bare string is still accepted. `phpstan-version` no longer merges STDERR into the version string, which a container runtime pollutes with its progress report. +* Fix `declare-function` forms for `tramp` that quoted the function name and argument list (and misspelled `tramp` as `tamp`), so the byte compiler warned that `tramp-dissect-file-name` might not be defined at runtime. + +### Removed + +* Drop support for Emacs 26 and earlier. All files now require Emacs 27.1, which is also the floor of `php-mode` and `flycheck` themselves, so anything older could not have resolved its dependencies anyway. ## [0.9.0] diff --git a/Eask b/Eask index dfec247..6182245 100644 --- a/Eask +++ b/Eask @@ -15,7 +15,7 @@ (source 'gnu) (source 'melpa) -(depends-on "emacs" "24.3") +(depends-on "emacs" "27.1") (depends-on "compat") (depends-on "php-mode") (depends-on "php-runtime") diff --git a/Eask.27 b/Eask.27 new file mode 100644 index 0000000..5535597 --- /dev/null +++ b/Eask.27 @@ -0,0 +1,35 @@ +;; -*- mode: eask; lexical-binding: t -*- + +;; Emacs 27-only variant of `Eask'. Eask reads `Eask.27' in preference to +;; `Eask' on Emacs 27, so this redirects only that version to MELPA Stable. +;; +;; MELPA's php-mode and flycheck track Emacs master: flycheck HEAD requires +;; Emacs 28.1 and will not install on 27. MELPA Stable's releases still +;; support 27 (flycheck 36.0, php-mode 1.27.0), so the 27 CI job and the local +;; .github/run-emacs-27-2.sh check both use them. +;; +;; This is a copy of `Eask' with one line changed -- the `source'. Keep the +;; rest in sync with `Eask', which is the source of truth. + +(package "phpstan" + "0.9.0" + "Interface to PHPStan (PHP static analyzer)") + +(website-url "https://github.com/emacs-php/phpstan.el") +(keywords "tools" "php") + +(package-file "phpstan.el") +(files "*.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'gnu) +(source 'melpa-stable) + +(depends-on "emacs" "27.1") +(depends-on "compat") +(depends-on "php-mode") +(depends-on "php-runtime") +(depends-on "flycheck") + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 diff --git a/README.org b/README.org index ed8ef86..543e14b 100644 --- a/README.org +++ b/README.org @@ -5,7 +5,7 @@ #+END_HTML Emacs interface to [[https://github.com/phpstan/phpstan][PHPStan]], includes checker for [[http://www.flycheck.org/en/latest/][Flycheck]]. ** Support version -- Emacs 26+ +- Emacs 27.1+ - PHPStan latest/dev-master (NOT support 0.9 seriese) - PHP 7.1+ or Docker runtime diff --git a/flycheck-phpstan.el b/flycheck-phpstan.el index c8af850..ee8094b 100644 --- a/flycheck-phpstan.el +++ b/flycheck-phpstan.el @@ -7,7 +7,7 @@ ;; Version: 0.9.0 ;; Keywords: tools, php ;; Homepage: https://github.com/emacs-php/phpstan.el -;; Package-Requires: ((emacs "25.1") (flycheck "26") (phpstan "0.9.0")) +;; Package-Requires: ((emacs "27.1") (flycheck "26") (phpstan "0.9.0")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/flymake-phpstan.el b/flymake-phpstan.el index ec93028..80bc794 100644 --- a/flymake-phpstan.el +++ b/flymake-phpstan.el @@ -7,7 +7,7 @@ ;; Version: 0.9.0 ;; Keywords: tools, php ;; Homepage: https://github.com/emacs-php/phpstan.el -;; Package-Requires: ((emacs "26.1") (phpstan "0.9.0")) +;; Package-Requires: ((emacs "27.1") (phpstan "0.9.0")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify diff --git a/phpstan-hover.el b/phpstan-hover.el index 09f1ebd..b5ef1d9 100644 --- a/phpstan-hover.el +++ b/phpstan-hover.el @@ -6,7 +6,7 @@ ;; Created: 16 Feb 2026 ;; Keywords: tools, php ;; Homepage: https://github.com/emacs-php/phpstan.el -;; Package-Requires: ((emacs "26.1") (phpstan "0.9.0")) +;; Package-Requires: ((emacs "27.1") (phpstan "0.9.0")) ;; License: GPL-3.0-or-later ;;; Commentary: diff --git a/phpstan.el b/phpstan.el index 8269675..b0b5ddb 100644 --- a/phpstan.el +++ b/phpstan.el @@ -7,7 +7,7 @@ ;; Version: 0.9.0 ;; Keywords: tools, php ;; Homepage: https://github.com/emacs-php/phpstan.el -;; Package-Requires: ((emacs "25.1") (compat "30") (php-mode "1.22.3") (php-runtime "0.2")) +;; Package-Requires: ((emacs "27.1") (compat "30") (php-mode "1.22.3") (php-runtime "0.2")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify @@ -63,8 +63,8 @@ (require 'php) (require 'json) (require 'tramp) - (declare-function 'tramp-dissect-file-name "tramp" '(name &optional nodefault)) - (declare-function 'tramp-file-name-localname "tamp" '(cl-x))) + (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault)) + (declare-function tramp-file-name-localname "tramp" (cl-x))) ;; Variables: (defgroup phpstan nil