-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
reduce php binary to minimum #7
base: main
Are you sure you want to change the base?
Conversation
@@ -40,7 +40,7 @@ WORKDIR /src/sqlite | |||
RUN emcc -Oz -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_NORMALIZE -c sqlite3.c -o sqlite3.o | |||
|
|||
FROM build_tool as php_src | |||
ARG PHP_BRANCH=PHP-8.3.0 | |||
ARG PHP_BRANCH=PHP-8.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG PHP_BRANCH=PHP-8.4.0 | |
ARG PHP_BRANCH=PHP-8.4 |
(It would be even better to use the latest tag).
You could likely reduce the size more by compressing the final file using these tricks: https://rustwasm.github.io/book/reference/code-size.html |
actually everything is built-in emcc: https://emscripten.org/docs/optimizing/Optimizing-Code.html#how-to-optimize-code and I found -O2 to be the most optimized when it comes to building PHP. The thing we need to do is serve the .wasm gzipped. Also emcc already uses wasm-opt. |
I'm interested to build this reproducibly with Nix! |
@drupol what's the problem with Nix it should work |
Clone this branch, then run: