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

Create a linux binary without Docker image #1396

Open
ptondereau opened this issue Feb 20, 2025 · 3 comments
Open

Create a linux binary without Docker image #1396

ptondereau opened this issue Feb 20, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@ptondereau
Copy link

ptondereau commented Feb 20, 2025

What happened?

Hello 👋🏻

For some reason, I can't use the Docker image because I need to compile a private PHP extension with SPC (which works well with SPC).
I see in the documentation that ./build-static.sh should also work for Linux host, but unfortunately, it stops at this step: https://github.com/dunglas/frankenphp/blob/main/build-static.sh#L305-L312

I've made a reproducer with my fork here to show you all related errors: https://github.com/ptondereau/frankenphp/actions/runs/13431813021/job/37525204733

From my POV, I think these errors are maybe related to SPC building PHP with musl instead of using glibc in a Linux environment, but not sure 😅

Build Type

Official static build

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Nothing

Relevant log output

@ptondereau ptondereau added the bug Something isn't working label Feb 20, 2025
@dunglas
Copy link
Owner

dunglas commented Feb 20, 2025

Indeed, to build a static binary, the host must musl for now.

@ptondereau
Copy link
Author

Ok I think it's related to crazywhalecc/static-php-cli#376

@crazywhalecc
Copy link
Contributor

crazywhalecc commented Feb 21, 2025

For static-php-cli, it supports multiple distributions by default. When it detects that the environment is not musl (alpine), it will automatically download the pre-built musl-toolchain for normal installation. For frankenphp, if we want to build in a non-musl environment, we only need to use the same musl-toolchain when using embed at the end, but in any case, we must modify the build-static.sh file.

I'm currently working on making a GNU based static binary available, but it's still a work in progress, and it’s another topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants