mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 23:35:40 +08:00
Fix docker doctor fix pkgroot volume overwrite bug
This commit is contained in:
@@ -29,6 +29,18 @@ class PkgConfigCheck
|
||||
return CheckResult::ok($pkgconf);
|
||||
}
|
||||
|
||||
#[AsCheckItem('if pkg-config is working', level: 799)]
|
||||
public function checkPkgConfigFunctional(): CheckResult
|
||||
{
|
||||
$pkgconf = PkgConfigUtil::findPkgConfig();
|
||||
// check if pkg-config is functional
|
||||
[$ret, $output] = shell()->execWithResult("{$pkgconf} --version", false);
|
||||
if ($ret === 0) {
|
||||
return CheckResult::ok(implode(' ', $output));
|
||||
}
|
||||
return CheckResult::fail('pkg-config is not functional', 'install-pkgconfig');
|
||||
}
|
||||
|
||||
#[AsFixItem('install-pkgconfig')]
|
||||
public function installPkgConfig(): bool
|
||||
{
|
||||
|
||||
@@ -40,6 +40,10 @@ class GlobalEnvManager
|
||||
if (is_unix()) {
|
||||
self::addPathIfNotExists(BUILD_BIN_PATH);
|
||||
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
|
||||
// internally use `WORKING_DIR/pkgroot-private` to avoid volume mount issues in Docker
|
||||
if (is_dir(WORKING_DIR . '/pkgroot-private/bin')) {
|
||||
self::addPathIfNotExists(WORKING_DIR . '/pkgroot-private/bin');
|
||||
}
|
||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class PkgConfigUtil
|
||||
{
|
||||
// Find pkg-config executable
|
||||
$find_list = [
|
||||
WORKING_DIR . '/pkgroot-private/bin/pkg-config', // used in Docker build, which is installed inside the container to avoid volume mounting issues
|
||||
PKG_ROOT_PATH . '/bin/pkg-config',
|
||||
BUILD_BIN_PATH . '/pkg-config',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user