Skip to content

Commit 39beb68

Browse files
committed
artifact: use {pkg_root_path} template in rust and go_win extract
Switch the rust and go_win downloaders from baking PKG_ROOT_PATH into the extract path at download time to the {pkg_root_path} template, which ArtifactExtractor resolves at extract time. This keeps the path stable across runs where pkg_root_path differs between download and extract (e.g. containerised vs host builds).
1 parent 7ae5d74 commit 39beb68

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/Package/Artifact/go_win.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class go_win
2020
])]
2121
public function downBinary(ArtifactDownloader $downloader): DownloadResult
2222
{
23-
$pkgroot = PKG_ROOT_PATH;
24-
2523
// get version
2624
[$version] = explode("\n", default_shell()->executeCurl('https://go.dev/VERSION?m=text', retries: $downloader->getRetry()) ?: '');
2725
if ($version === '') {
@@ -52,7 +50,7 @@ public function downBinary(ArtifactDownloader $downloader): DownloadResult
5250
throw new DownloaderException("Hash mismatch for downloaded go-win binary. Expected {$hash}, got {$file_hash}");
5351
}
5452

55-
return DownloadResult::archive(basename($path), ['url' => $url, 'version' => $version], extract: "{$pkgroot}/go-win", verified: true, version: $version);
53+
return DownloadResult::archive(basename($path), ['url' => $url, 'version' => $version], extract: '{pkg_root_path}/go-win', verified: true, version: $version);
5654
}
5755

5856
#[CustomBinaryCheckUpdate('go-win', ['windows-x86_64'])]

src/Package/Artifact/rust.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function downBinary(ArtifactDownloader $downloader): DownloadResult
4646
$download_url = "https://static.rust-lang.org/dist/rust-{$latest_version}-{$arch}-unknown-linux-{$distro}.tar.xz";
4747
$path = DOWNLOAD_PATH . DIRECTORY_SEPARATOR . basename($download_url);
4848
default_shell()->executeCurlDownload($download_url, $path, retries: $downloader->getRetry());
49-
return DownloadResult::archive(basename($path), ['url' => $download_url, 'version' => $latest_version], extract: PKG_ROOT_PATH . '/rust-install', verified: false, version: $latest_version);
49+
return DownloadResult::archive(basename($path), ['url' => $download_url, 'version' => $latest_version], extract: '{pkg_root_path}/rust-install', verified: false, version: $latest_version);
5050
}
5151

5252
#[CustomBinaryCheckUpdate('rust', [

0 commit comments

Comments
 (0)