Skip to content

Add sendmail and switch build to wasixcc#11

Merged
Arshia001 merged 6 commits into8.3.21-wasixfrom
zebreus-8.3.21-wasix
Feb 17, 2026
Merged

Add sendmail and switch build to wasixcc#11
Arshia001 merged 6 commits into8.3.21-wasixfrom
zebreus-8.3.21-wasix

Conversation

@zebreus
Copy link

@zebreus zebreus commented Feb 3, 2026

Add sendmail and switch build to wasixcc

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

php_mail_free_argv(&args);
return -1;
}

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
#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

Copilot uses AI. Check for mistakes.
Copy link

@Arshia001 Arshia001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall; a few questions, and I find copilot's comment about pinning the wasixcc version valid.

@zebreus zebreus force-pushed the zebreus-8.3.21-wasix branch 3 times, most recently from 8141a49 to 076dd5d Compare February 17, 2026 09:42
@Arshia001
Copy link

LGTM!

@Arshia001 Arshia001 merged commit 6636324 into 8.3.21-wasix Feb 17, 2026
3 checks passed
@Arshia001 Arshia001 deleted the zebreus-8.3.21-wasix branch February 17, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants