Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux c++ support using musl-cross-make toolchains #231

Merged
merged 42 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
830f379
add --disable-opcache-jit option for alpine
DubbleClick Oct 16, 2023
46b0ecf
allow patching of extra_libs before make on linux too
DubbleClick Oct 16, 2023
658e8e7
use arch-linux-musl toolchains
DubbleClick Oct 16, 2023
64dfb57
don't add -liconv on linux (cannot find library when specified that w…
DubbleClick Oct 16, 2023
a7265bf
add -static linker flag to libicu compilation
DubbleClick Oct 16, 2023
a4dc177
install libxml2 and snappy into /lib instead of /lib64
DubbleClick Oct 16, 2023
a83a457
fix pgsql build on non-alpine
DubbleClick Oct 16, 2023
da1cbeb
introduce library_path and ld_library_path options to linuxbuilder (s…
DubbleClick Oct 16, 2023
0007043
fix imagemagick and postgresql builds with different libs
DubbleClick Oct 17, 2023
6dfd353
fix order of imagick libs
DubbleClick Oct 17, 2023
75b9d66
use ar and ld from musl-tools (uses gold-ld and can handle wrong lib …
DubbleClick Oct 17, 2023
ca1189b
use ld.gold (revert this if you think this doesn't add benefit)
DubbleClick Oct 19, 2023
b6409bd
optimize install musl wrapper and cross make function
crazywhalecc Oct 22, 2023
d56c060
remove `--enable-wrapper=gcc` for fix-musl
crazywhalecc Oct 22, 2023
6cc7e6c
add comment for hard-coded musl version
crazywhalecc Oct 22, 2023
5cfba6e
Merge branch 'main' into cplus
crazywhalecc Oct 22, 2023
8191444
refactor musl tool doctor
crazywhalecc Oct 22, 2023
99150e2
add putenv wrapper
crazywhalecc Oct 22, 2023
5934e5e
fix doctor phpunit test
crazywhalecc Oct 22, 2023
c84eb72
[mixed] refactor with putenv, fix imagemagick and c++ build
crazywhalecc Oct 22, 2023
8a70da6
change instanceof check
crazywhalecc Oct 22, 2023
9b9644f
simplify download error message
crazywhalecc Oct 23, 2023
8dcec73
let bzip2 use correct CC and AR
crazywhalecc Oct 23, 2023
c24dc8f
create helper method to pass environment variables to 'make'
DubbleClick Oct 24, 2023
e00908d
Merge remote-tracking branch 'DubbleClick/cplus' into cplus
crazywhalecc Oct 26, 2023
e84a246
add back required -lgomp for imagick extension
DubbleClick Oct 27, 2023
d40f2ca
simplify libpng compilation
DubbleClick Oct 27, 2023
2e47e8a
specify --with-openssl-dir in php ./configure
DubbleClick Oct 27, 2023
b4f9235
Merge branch 'main' into cplus
DubbleClick Oct 29, 2023
90b2e55
update sqlite version
crazywhalecc Oct 29, 2023
2768dc0
adjust doctor for os and linux musl check
crazywhalecc Oct 29, 2023
6b848da
disable musl-gcc wrapper
DubbleClick Oct 29, 2023
ed8837f
let postgresql use -lc++ in bsd and macos
crazywhalecc Oct 30, 2023
98b906d
Merge remote-tracking branch 'origin/main' into cplus
crazywhalecc Oct 30, 2023
e637cce
use prompts to ask
crazywhalecc Oct 30, 2023
aee040d
use prompts to show table
crazywhalecc Oct 30, 2023
e158cc5
update composer lock
crazywhalecc Oct 30, 2023
d5405ce
update to the release version
crazywhalecc Oct 30, 2023
bfc56cf
refactor build var generation
DubbleClick Oct 30, 2023
12cc422
merge main
DubbleClick Oct 30, 2023
8747266
make it rc8
DubbleClick Oct 30, 2023
0b37080
a good coding font is very important
crazywhalecc Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SPC/doctor/item/LinuxMuslCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function checkMusl(): CheckResult
}

$musl_wrapper_lib = sprintf('/lib/ld-musl-%s.so.1', php_uname('m'));
if (file_exists($musl_wrapper_lib)) {
if (file_exists($musl_wrapper_lib) && file_exists('/usr/local/musl/bin/musl-gcc')) {
crazywhalecc marked this conversation as resolved.
Show resolved Hide resolved
return CheckResult::ok();
}
return CheckResult::fail('musl-wrapper is not installed on your system', 'fix-musl-wrapper');
Expand Down Expand Up @@ -71,7 +71,7 @@ public function fixMusl(): bool
Downloader::downloadSource($musl_version_name, $musl_source);
FileSystem::extractSource($musl_version_name, DOWNLOAD_PATH . "/{$musl_version_name}.tar.gz");
logger()->info('Installing musl wrapper');
shell(true)->cd(SOURCE_PATH . "/{$musl_version_name}")
shell()->cd(SOURCE_PATH . "/{$musl_version_name}")
->exec('./configure')
->exec('make -j')
->exec("{$prefix}make install");
Expand Down Expand Up @@ -106,7 +106,7 @@ public function fixMuslCrossMake(): bool
Downloader::downloadSource('musl-compile', $musl_compile_source);
logger()->info('Extracting musl-cross');
FileSystem::extractSource('musl-compile', DOWNLOAD_PATH . "/{$arch}-musl-toolchain.tgz");
shell(true)->exec($prefix . 'cp -rf ' . SOURCE_PATH . '/musl-compile/* /usr/local/musl');
shell()->exec($prefix . 'cp -rf ' . SOURCE_PATH . '/musl-compile/* /usr/local/musl');
return true;
} catch (RuntimeException) {
return false;
Expand Down
4 changes: 3 additions & 1 deletion src/SPC/doctor/item/OSCheckList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace SPC\doctor\item;

use SPC\builder\linux\SystemUtil;
use SPC\builder\traits\UnixSystemUtilTrait;
use SPC\doctor\AsCheckItem;
use SPC\doctor\CheckResult;
Expand All @@ -18,6 +19,7 @@ public function checkOS(): ?CheckResult
if (!in_array(PHP_OS_FAMILY, ['Darwin', 'Linux', 'BSD'])) {
return CheckResult::fail('Current OS is not supported');
}
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . ', supported');
$distro = PHP_OS_FAMILY === 'Linux' ? (' ' . SystemUtil::getOSRelease()['dist']) : '';
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . $distro . ', supported');
}
}