mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 11:25:35 +08:00
Compare commits
3 Commits
2591b48abe
...
9ee7d7769a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee7d7769a | ||
|
|
2440a65d8e | ||
|
|
839931d65f |
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@@ -115,6 +115,7 @@ jobs:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
- macos-14
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
@@ -154,4 +155,4 @@ jobs:
|
||||
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --with-php=${{ matrix.php }} --debug
|
||||
|
||||
- name: "Run Build Tests (build)"
|
||||
run: bin/spc build $(php src/globals/test-extensions.php cmd) --build-cli --build-micro --build-fpm --debug
|
||||
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php libs_cmd) --build-cli --build-micro --build-fpm --debug
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Console\Command\ListCommand;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const VERSION = '2.1.0-beta.1';
|
||||
public const VERSION = '2.1.0-beta.2';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -104,6 +104,9 @@ class BuildCliCommand extends BuildCommand
|
||||
SourcePatcher::patchHardcodedINI($custom_ini);
|
||||
}
|
||||
|
||||
// add static-php-cli.version to main.c, in order to debug php failure more easily
|
||||
SourcePatcher::patchSPCVersionToPHP($this->getApplication()->getVersion());
|
||||
|
||||
// start to build
|
||||
$builder->buildPHP($rule);
|
||||
|
||||
|
||||
@@ -296,4 +296,20 @@ class SourcePatcher
|
||||
$lines[$line_num + 1] = "\t" . '"$(LINK)" /nologo $(PHP_GLOBAL_OBJS_RESP) $(CLI_GLOBAL_OBJS_RESP) $(STATIC_EXT_OBJS_RESP) $(STATIC_EXT_LIBS) $(ASM_OBJS) $(LIBS) $(LIBS_CLI) $(BUILD_DIR)\php.exe.res /out:$(BUILD_DIR)\php.exe $(LDFLAGS) $(LDFLAGS_CLI) /ltcg /nodefaultlib:msvcrt /nodefaultlib:msvcrtd /ignore:4286';
|
||||
FileSystem::writeFile(SOURCE_PATH . '/php-src/Makefile', implode("\r\n", $lines));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add additional `static-php-cli.version` ini value for PHP source.
|
||||
*
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public static function patchSPCVersionToPHP(string $version = 'unknown'): void
|
||||
{
|
||||
// detect patch
|
||||
$file = FileSystem::readFile(SOURCE_PATH . '/php-src/main/main.c');
|
||||
if (!str_contains($file, 'static-php-cli.version')) {
|
||||
logger()->debug('Inserting static-php-cli.version to php-src');
|
||||
$file = str_replace('PHP_INI_BEGIN()', "PHP_INI_BEGIN()\n\tPHP_INI_ENTRY(\"static-php-cli.version\",\t\"{$version}\",\tPHP_INI_ALL,\tNULL)", $file);
|
||||
FileSystem::writeFile(SOURCE_PATH . '/php-src/main/main.c', $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ if (PHP_OS_FAMILY === 'Windows') {
|
||||
echo match ($argv[1]) {
|
||||
'extensions' => $final_extensions,
|
||||
'libs' => $final_libs,
|
||||
'libs_cmd' => ($final_libs === '' ? '' : (' --with-libs="' . $final_libs . '"')),
|
||||
'cmd' => $final_extensions_cmd . ($final_libs === '' ? '' : (' --with-libs="' . $final_libs . '"')),
|
||||
default => '',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user