diff --git a/CHANGELOG.md b/CHANGELOG.md index d1dc7a4a..7170d1d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file, in reverse - [#238](https://github.com/scoutapp/scout-apm-php/pull/238) Add scheduled CI run every month to ensure compatibility with dependency updates - [#240](https://github.com/scoutapp/scout-apm-php/pull/240) Add support for psr/log ^1.0|^2.0|^3.0, and added Roave/BackwardCompatibilityCheck to CI +- [#241](https://github.com/scoutapp/scout-apm-php/pull/241) Added support for aarch64 Linux and arm64 M1 Macs ### Changed diff --git a/src/Config/Source/DerivedSource.php b/src/Config/Source/DerivedSource.php index d1d40555..0f9b9b61 100644 --- a/src/Config/Source/DerivedSource.php +++ b/src/Config/Source/DerivedSource.php @@ -75,7 +75,21 @@ private function architecture(): string { $unameArch = php_uname('m'); - if (in_array($unameArch, ['i686', 'x86_64'], true)) { + /** + * On new M1 Macs (arm64), we can still use x86_64 build + * + * @link https://github.com/scoutapp/scout-apm-php/issues/239 + */ + if ($unameArch === 'arm64') { + return 'x86_64'; + } + + /** + * aarch64 reported for some Linux environments, e.g. "AWS Graviton" + * + * @link https://github.com/scoutapp/scout-apm-php/issues/239 + */ + if (in_array($unameArch, ['i686', 'x86_64', 'aarch64'], true)) { return $unameArch; } @@ -87,7 +101,7 @@ private function coreAgentTriple(): string /** * Since the `musl`-based agent should work on `glibc`-based systems, we can hard-code this now. * - * @see https://github.com/scoutapp/scout-apm-php/issues/166 + * @link https://github.com/scoutapp/scout-apm-php/issues/166 */ $platform = 'unknown-linux-musl';