Skip to content

Commit 757af25

Browse files
committed
Suggestions
1 parent 5e3e7ec commit 757af25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected function deployBinary(int $type): void
238238
} elseif (!$no_strip_option && PHP_OS_FAMILY === 'Linux') {
239239
shell()
240240
->exec("objcopy --only-keep-debug {$src} {$src}.debug") // extract debug symbols
241-
->exec("objcopy --strip-debug --add-gnu-debuglink={$src}.debug {$src}") // link debug symbols
241+
->exec("objcopy --add-gnu-debuglink={$src}.debug {$src}") // link debug symbols
242242
->exec("strip --strip-unneeded {$src}"); // strip unneeded symbols
243243
$copy_files[] = "{$src}.debug";
244244
}
@@ -274,7 +274,10 @@ protected function deployBinary(int $type): void
274274
if (!file_exists($file)) {
275275
throw new SPCInternalException("Deploy failed. Cannot find file: {$file}");
276276
}
277-
FileSystem::copy($file, BUILD_BIN_PATH . '/' . basename($file));
277+
// ignore copy to self
278+
if (realpath($file) !== realpath(BUILD_BIN_PATH . '/' . basename($file))) {
279+
shell()->exec('cp ' . escapeshellarg($file) . ' ' . escapeshellarg(BUILD_BIN_PATH . '/'));
280+
}
278281
}
279282
}
280283

0 commit comments

Comments
 (0)