You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On ankane/onnxruntime v0.3.9, running OnnxRuntime\Vendor::check (as a post-install-cmd script) aborts composer install:
> OnnxRuntime\Vendor::check
Downloading ONNX Runtime...
Script OnnxRuntime\Vendor::check handling the post-install-cmd event terminated with an exception
In Vendor.php line 59:
file_get_contents(https://github.com/microsoft/onnxruntime/releases/download/v1.32.0/onnxruntime-linux-x64-1.32.0.tgz): Failed to open stream: HTTP
request failed! HTTP/1.1 404 Not Found
Some searching around suggests github.com/microsoft/onnxruntime has returned 404 since about 18 November 2026, so the release tarballs can't be downloaded.
And then downloads one time per environment. My choice of source might not be ideal, but I need it only for a tiny feature running tiny face detection model in a picture. This was easy to cook up, pasting for anyones inspiration while more proper source is suggested or found for this.
If that library source is evasive, maybe it could be a configurable URL source for the ONNX config.
<?phpdeclare(strict_types=1);
namespaceApp\Console\Commands;
useIlluminate\Console\Attributes\Description;
useIlluminate\Console\Attributes\Signature;
useIlluminate\Console\Command;
useIlluminate\Support\Facades\File;
useIlluminate\Support\Facades\Http;
useOnnxRuntime\Vendor;
useZipArchive;
/** * Installs the ONNX Runtime shared library from the official PyPI wheel (a plain zip). * * Workaround for OnnxRuntime\Vendor::check, which downloads from github.com/microsoft/onnxruntime * releases (offline since 2026-11-18). To update: bump the constants to the wheel matching * OnnxRuntime\Vendor::VERSION (cp312 manylinux URLs + sha256 from https://pypi.org/pypi/onnxruntime/{version}/json). * * @codeCoverageIgnore Real download path isn't exercised in tests; the checksum guard is covered by InstallOnnxRuntimeTest. */
#[Signature('onnx:install {--force : Download again even if the library exists}')]
#[Description('Downloads the ONNX Runtime library (linux x86_64 / aarch64) from PyPI into storage.')]
class InstallOnnxRuntime extends Command
{
publicconstVERSION = '1.32.0';
/** Wheel URL and sha256 per `php_uname('m')`. */publicconstWHEELS = [
'x86_64' => [
'https://files.pythonhosted.org/packages/a3/81/55845186c20cba59f614991f4065dea148e48eeb9749893768c85ce64327/onnxruntime-1.32.0-cp312-cp312-manylinux_2_28_x86_64.whl',
'99e1074c4b2197accd5073052a465361be17b89c093b8ffb6e6bd8f986c52df8',
],
'aarch64' => [
'https://files.pythonhosted.org/packages/4a/8f/1e43fb994513c7c7a9c6965272ef89d963c1bd4080993a6267bf913701d1/onnxruntime-1.32.0-cp312-cp312-manylinux_2_28_aarch64.whl',
'e36c187006e7a7c8b8d6d57f1a209dd63f52430dca6c282b177718ad6b841054',
],
];
publicconstWHEEL_ENTRY = 'onnxruntime/capi/libonnxruntime.so.1.32.0';
publicstaticfunctionlibraryPath(): string
{
returnstorage_path('app/onnxruntime/libonnxruntime.so.'.self::VERSION);
}
publicfunctionhandle(): int
{
if (Vendor::VERSION !== self::VERSION) {
$this->error('ankane/onnxruntime expects ONNX Runtime '.Vendor::VERSION.', this command installs '.self::VERSION.'. Update its constants.');
returnself::FAILURE;
}
$wheel = PHP_OS_FAMILY === 'Linux' ? (self::WHEELS[php_uname('m')] ?? null) : null;
if ($wheel === null) {
$this->warn('ONNX Runtime install skipped: only linux '.implode(' / ', array_keys(self::WHEELS)).' is supported.');
returnself::SUCCESS;
}
[$wheelUrl, $wheelSha256] = $wheel;
$target = self::libraryPath();
if (File::exists($target) && ! $this->option('force')) {
$this->info('ONNX Runtime '.self::VERSION.' found.');
returnself::SUCCESS;
}
$this->line('Downloading ONNX Runtime '.self::VERSION.'…');
File::ensureDirectoryExists(dirname($target));
$wheelFile = $target.'.whl';
try {
Http::timeout(300)->sink($wheelFile)->get($wheelUrl)->throw();
if (! hash_equals($wheelSha256, hash_file('sha256', $wheelFile))) {
$this->error('Checksum mismatch for '.$wheelUrl);
returnself::FAILURE;
}
$library = $this->extractLibrary($wheelFile);
if ($library === null) {
$this->error(self::WHEEL_ENTRY.' not found in the wheel.');
returnself::FAILURE;
}
File::put($target.'.tmp', $library);
File::move($target.'.tmp', $target);
} finally {
File::delete($wheelFile);
}
$this->info("ONNX Runtime installed to {$target}");
returnself::SUCCESS;
}
privatefunctionextractLibrary(string$wheel): ?string
{
$zip = newZipArchive;
if ($zip->open($wheel) !== true) {
returnnull;
}
$library = $zip->getFromName(self::WHEEL_ENTRY);
$zip->close();
return$library === false ? null : $library;
}
}
Activity
PacificBird commentedon Nov 24, 2026
In my docker builds to get around this I've removed the
Vendor::checkfrom composer.json and added this after the composer install step:Pilskalns commentedon Nov 24, 2026
Yes, I'm doing a similar workaround thing from a Laravel project:
And then downloads one time per environment. My choice of source might not be ideal, but I need it only for a tiny feature running tiny face detection model in a picture. This was easy to cook up, pasting for anyones inspiration while more proper source is suggested or found for this.
If that library source is evasive, maybe it could be a configurable URL source for the ONNX config.