From 757af25d8fca4a68124ec9960b056c39b8e0a0a2 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 1 Nov 2025 00:49:50 +0800 Subject: [PATCH] Suggestions --- src/SPC/builder/unix/UnixBuilderBase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index 8122bf2c..5d4abbfc 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -238,7 +238,7 @@ abstract class UnixBuilderBase extends BuilderBase } elseif (!$no_strip_option && PHP_OS_FAMILY === 'Linux') { shell() ->exec("objcopy --only-keep-debug {$src} {$src}.debug") // extract debug symbols - ->exec("objcopy --strip-debug --add-gnu-debuglink={$src}.debug {$src}") // link debug symbols + ->exec("objcopy --add-gnu-debuglink={$src}.debug {$src}") // link debug symbols ->exec("strip --strip-unneeded {$src}"); // strip unneeded symbols $copy_files[] = "{$src}.debug"; } @@ -274,7 +274,10 @@ abstract class UnixBuilderBase extends BuilderBase if (!file_exists($file)) { throw new SPCInternalException("Deploy failed. Cannot find file: {$file}"); } - FileSystem::copy($file, BUILD_BIN_PATH . '/' . basename($file)); + // ignore copy to self + if (realpath($file) !== realpath(BUILD_BIN_PATH . '/' . basename($file))) { + shell()->exec('cp ' . escapeshellarg($file) . ' ' . escapeshellarg(BUILD_BIN_PATH . '/')); + } } }