diff --git a/docs/contributing/index.md b/docs/contributing/index.md index f4120eb95b8..0b270055e29 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -30,6 +30,7 @@ Lastly, working to improve static analysis tools will also make you a better PHP * [Editing callmaps](editing_callmaps.md) * [Adding a new issue type](adding_issues.md) +* [Packaging Psalm](packaging.md) ## Pull Requests diff --git a/docs/contributing/packaging.md b/docs/contributing/packaging.md new file mode 100644 index 00000000000..376a2d78d75 --- /dev/null +++ b/docs/contributing/packaging.md @@ -0,0 +1,19 @@ +## Using a Snapshot Build + +To obtain the latest development version of Psalm, a snapshot build can be +downloaded from GitHub at https://github.com/vimeo/psalm/archive/refs/heads/5.x.zip + +Snapshot builds typically include only the source code and exclude the `.git` +directory. As a result, Psalm cannot automatically determine its version or +revision when executing `composer install`, since this information is usually +derived from the `git` repository metadata that Composer relies on. + +To successfully install Psalm from a snapshot build, it is necessary to +manually specify the version using the `COMPOSER_ROOT_VERSION` environment +variable. This allows Composer to proceed with the installation of Psalm. + +The command to do so is as follows: + +```bash +COMPOSER_ROOT_VERSION=5.x-dev composer install +``` diff --git a/docs/running_psalm/installation.md b/docs/running_psalm/installation.md index 2d4f32d6b4a..8851e3e21b6 100644 --- a/docs/running_psalm/installation.md +++ b/docs/running_psalm/installation.md @@ -51,28 +51,23 @@ Alternatively, you can use Composer to install the Phar: ```bash composer require --dev psalm/phar ``` +# Alternative Installation Methods -## Using a Snapshot Build +The following methods are known to work for some users, but are **not** officially supported. -To obtain the latest development version of Psalm, a snapshot build can be -downloaded from GitHub at https://github.com/vimeo/psalm/archive/refs/heads/5.x.zip +## Installing with `composer` globally -Snapshot builds typically include only the source code and exclude the `.git` -directory. As a result, Psalm cannot automatically determine its version or -revision when executing `composer install`, since this information is usually -derived from the `git` repository metadata that Composer relies on. - -To successfully install Psalm from a snapshot build, it is necessary to -manually specify the version using the `COMPOSER_ROOT_VERSION` environment -variable. This allows Composer to proceed with the installation of Psalm. +```bash +composer global require vimeo/psalm +``` -The command to do so is as follows: +## Installing with `phive` ```bash -COMPOSER_ROOT_VERSION=5-dev composer install +phive install psalm ``` -## Installing Psalm on Linux +## Installing Psalm on Linux using a package manager Psalm is available across various Linux distributions, each typically equipped with its own package management system. To install Psalm, refer to the