fix SPC_NO_MUSL_PATH not working in .env.ini (#612)

* fix SPC_NO_MUSL_PATH not working in .env.ini

* use filter var instead of assuming var was defined in .env.ini

* CS fix and composer update

* update composer.lock

* fix LIBRARY_PATH and LD_LIBRARY_PATH

* Revert composer lock and cs-fixer options

* filter validate boolean

---------

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
Co-authored-by: crazywhalecc <jesse2061@outlook.com>
This commit is contained in:
Marc
2025-03-07 11:15:11 +01:00
committed by GitHub
parent 29ea46bd17
commit a95d034e98
2 changed files with 11 additions and 8 deletions

View File

@@ -57,10 +57,6 @@ class GlobalEnvManager
self::putenv("SPC_LINUX_DEFAULT_CXX={$arch}-linux-musl-g++");
self::putenv("SPC_LINUX_DEFAULT_AR={$arch}-linux-musl-ar");
}
self::putenv("SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD=LD_LIBRARY_PATH=/usr/local/musl/{$arch}-linux-musl/lib");
if (getenv('SPC_NO_MUSL_PATH') !== 'yes') {
self::putenv("PATH=/usr/local/musl/bin:/usr/local/musl/{$arch}-linux-musl/bin:" . getenv('PATH'));
}
}
// Init env.ini file, read order:
@@ -91,6 +87,11 @@ class GlobalEnvManager
'BSD' => self::applyConfig($ini['freebsd']),
default => null,
};
if (PHP_OS_FAMILY === 'Linux' && !filter_var(getenv('SPC_NO_MUSL_PATH'), FILTER_VALIDATE_BOOLEAN)) {
self::putenv("SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD=LD_LIBRARY_PATH=/usr/local/musl/{$arch}-linux-musl/lib");
self::putenv("PATH=/usr/local/musl/bin:/usr/local/musl/{$arch}-linux-musl/bin:" . getenv('PATH'));
}
}
public static function putenv(string $val): void