Add sendmail and switch build to wasixcc#11
Conversation
0c40eb6 to
c85e31d
Compare
There was a problem hiding this comment.
Pull request overview
This PR transitions the PHP WASIX build system from using direct LLVM/Clang toolchain to the wasixcc wrapper toolchain, and adds the sendmail dependency to support PHP mail functionality through a standard sendmail executable instead of a custom Rust-based WASIX sendmail library.
Changes:
- Replaced manual LLVM 20/21 toolchain setup with wasixcc wrapper toolchain
- Added sendmail/sendmail package dependency to wasmer-32.toml and wasmer-64.toml
- Removed custom wasix_sendmail C integration code and Rust library dependency from ext/standard/mail.c and config.m4
- Removed SMTP configuration parameters from execution scripts
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wasmer-64.toml | Added sendmail/sendmail dependency |
| wasmer-32.toml | Added sendmail/sendmail dependency |
| wasix-execute.sh | Removed SMTP configuration parameters |
| wasix-execute-eh.sh | Removed SMTP configuration parameters |
| wasix-configure.sh | Replaced LLVM toolchain with wasixcc, simplified build flags, removed SYSROOT and WASIX_SENDMAIL_LIBS |
| wasix-configure-eh.sh | Replaced LLVM toolchain with wasixcc, simplified build flags, removed SYSROOT and WASIX_SENDMAIL_LIBS |
| ext/standard/mail.c | Removed custom wasix_sendmail integration code, now uses standard sendmail_path |
| ext/standard/config.m4 | Removed WASIX_SENDMAIL_LIBS build configuration |
| .github/workflows/wasix-pr.yaml | Replaced LLVM 21 installation with wasixcc installation action, updated tool version checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ext/standard/mail.c
Outdated
| php_mail_free_argv(&args); | ||
| return -1; | ||
| } | ||
|
|
There was a problem hiding this comment.
pipe(pipefd) creates fds without close-on-exec. In a multi-threaded process, concurrent calls to mail()/posix_spawn can cause unrelated children to inherit these pipe fds, potentially preventing EOF delivery and hanging the sendmail process (same class of issue documented in ext/fileinfo/libmagic/compress.c). Prefer creating the pipe with O_CLOEXEC (pipe2) or setting FD_CLOEXEC via fcntl on both ends before spawning.
| #ifdef FD_CLOEXEC | |
| /* Ensure pipe fds are not unintentionally inherited by unrelated children */ | |
| if (fcntl(pipefd[0], F_SETFD, FD_CLOEXEC) == -1 | |
| || fcntl(pipefd[1], F_SETFD, FD_CLOEXEC) == -1 | |
| ) { | |
| php_error_docref(NULL, E_WARNING, "Could not set FD_CLOEXEC on pipe for mail delivery: %s", strerror(errno)); | |
| close(pipefd[0]); | |
| close(pipefd[1]); | |
| php_mail_free_argv(&args); | |
| return -1; | |
| } | |
| #endif |
Arshia001
left a comment
There was a problem hiding this comment.
LGTM overall; a few questions, and I find copilot's comment about pinning the wasixcc version valid.
8141a49 to
076dd5d
Compare
2acc058 to
db228cc
Compare
|
LGTM! |
Add sendmail and switch build to wasixcc