Skip to content

main/io build directory missing from PHP_ADD_BUILD_DIR, breaks out-of-tree (VPATH) builds - #22913

Merged
bukka merged 1 commit into
php:masterfrom
mati75:fix-main-io-builddir
Aug 2, 2026
Merged

main/io build directory missing from PHP_ADD_BUILD_DIR, breaks out-of-tree (VPATH) builds#22913
bukka merged 1 commit into
php:masterfrom
mati75:fix-main-io-builddir

Conversation

@mati75

@mati75 mati75 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Building PHP 8.6.0alpha3 in an out-of-tree build directory (VPATH build, e.g. Debian's separate fpm-build/cli-build dirs) fails while compiling the new main/io/*.c files:

main/io/php_io_copy_freebsd.c:1: fatal error: opening dependency file main/io/php_io_copy_freebsd.dep: No such file or directory
compilation terminated.
make[2]: *** [Makefile:1841: main/io/php_io_copy_freebsd.lo] Error 1

The same error occurs for php_io.c, php_io_copy_linux.c, php_io_copy_solaris.c, and php_io_copy_macos.c.

configure.ac registers the sources via PHP_ADD_SOURCES([main/io], ...), but the main/io directory was never added to the PHP_ADD_BUILD_DIR([...]) list that configure uses to pre-create build directories for VPATH builds. Every other directory containing sources (main, main/poll, main/streams, TSRM, Zend, etc.) is listed there; main/io was simply omitted when the new I/O subsystem was introduced. As a result, main/io/ never gets created in the build tree, and the compiler can't write the .dep/.o files into it.

PHP_ADD_SOURCES([main/io], ...) adds the new I/O subsystem sources
(php_io.c, php_io_copy_*.c) to the build, but main/io was never added
to the PHP_ADD_BUILD_DIR list. Since only directories in that list get
pre-created for out-of-tree (VPATH) builds, main/io/ never existed in
such build trees, causing:

  fatal error: opening dependency file main/io/php_io_copy_freebsd.dep:
  No such file or directory

for every file in main/io/ when building outside the source tree
(e.g. Debian's separate fpm-build/cli-build directories).

Add main/io to PHP_ADD_BUILD_DIR, alongside the other source
directories (main, main/poll, main/streams, TSRM, Zend, ...).
@petk

petk commented Jul 29, 2026

Copy link
Copy Markdown
Member

Cc @bukka

Also, the io headers should be rechecked in this context. In Windows, they are specified as public but in Autotools not. Yet in GitHub yaml file they are marked as ABI break. 🤷‍♂️

@bukka
bukka merged commit 395b298 into php:master Aug 2, 2026
18 checks passed
@bukka

bukka commented Aug 2, 2026

Copy link
Copy Markdown
Member

only main/php_io.h should be exported. The rest is internal.

@LamentXU123

Copy link
Copy Markdown
Member

I file a PR to remove them on Windows: #23003

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.

Can't build php-8.6.0alpha3: php_io.c:180:1: fatal error: opening dependency file main/io/php_io.dep: No such file or directory

4 participants