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

Add embed sanity check and spc-config command #573

Merged
merged 11 commits into from
Dec 13, 2024
Merged

Conversation

crazywhalecc
Copy link
Owner

@crazywhalecc crazywhalecc commented Dec 10, 2024

What does this PR do?

Example

# spc-config
bin/spc spc-config apcu,pgsql,openssl,curl --with-libs=nghttp2 --libs

# Output:
# -L/home/jerry/project/static-php-cli/buildroot/lib -lphp -lc -lcurl -lnghttp2 -lpq -lpgport -lpgcommon -lreadline -lncurses -lssl -lcrypto -lxml2 -lz -liconv -lcharset

# Build in embed SAPI
/usr/local/musl/bin/x86_64-linux-musl-gcc path-to-code.c $(bin/spc spc-config $EXTENSIONS) -static -o test
./test

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If it's an extension or dependency update, make sure adding related extensions in src/global/test-extensions.php.
  • If you changed the behavior of static-php-cli, update docs in ./docs/.
  • If you updated config/xxx.json content, run bin/spc dev:sort-config xxx.

@crazywhalecc crazywhalecc added enhancement New feature or request kind/php-and-sapi Issues related to php source and SAPI mixed PR This PR contains multiple updates labels Dec 10, 2024
@crazywhalecc
Copy link
Owner Author

That being said, one way or another it would be great to be able to retrieve the list of libs to pass to the compiler and linker for using static-php-cli in scripts!

@dunglas To prevent bugs like pgsql from happening again, I introduced embed sanity check and spc-config (replace php-config). This may improve FrankenPHP's build script.

If you have any suggestions, that would be great.

@dunglas
Copy link
Contributor

dunglas commented Dec 10, 2024

Wow, thank you, great enhancement for us.

@crazywhalecc crazywhalecc merged commit 1bc7bc3 into main Dec 13, 2024
15 checks passed
@crazywhalecc crazywhalecc deleted the feat/embed-enhance branch December 13, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/php-and-sapi Issues related to php source and SAPI mixed PR This PR contains multiple updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add embed SAPI sanity check php embed sapi:undefinded reference to 'sigsetjmp'
2 participants