php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Ext sockets fails to build in php:8.1.2 docker image

Open OneEyedSpaceFish opened this issue 4 years ago • 6 comments

Description

The following docker build:

FROM php:8.1.2-cli

RUN docker-php-ext-install sockets

Resulted in this build failure:

/usr/src/php/ext/sockets/sendrecvmsg.c: In function 'init_ancillary_registry':
/usr/src/php/ext/sockets/sendrecvmsg.c:128:19: error: invalid application of 'sizeof' to incomplete type 'struct cmsgcred'
  128 |  PUT_ENTRY(sizeof(struct cmsgcred), 0, 0, from_zval_write_ucred,
      |                   ^~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:99:17: note: in definition of macro 'PUT_ENTRY'
   99 |  entry.size   = sizev; \
      |                 ^~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:129:36: error: 'SCM_CREDS' undeclared (first use in this function)
  129 |    to_zval_read_ucred, SOL_SOCKET, SCM_CREDS);
      |                                    ^~~~~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:105:19: note: in definition of macro 'PUT_ENTRY'
  105 |  key.cmsg_type  = type; \
      |                   ^~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:129:36: note: each undeclared identifier is reported only once for each function it appears in
  129 |    to_zval_read_ucred, SOL_SOCKET, SCM_CREDS);
      |                                    ^~~~~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:105:19: note: in definition of macro 'PUT_ENTRY'
  105 |  key.cmsg_type  = type; \
      |                   ^~~~
make: *** [Makefile:213: sendrecvmsg.lo] Error 1

This issue seemingly introduced with the 8.1.2 docker image release, and all (including the latest build of 8.1.1 seems fine)

PHP Version

8.1.2

Operating System

php:8.1.2-cli@sha256:9e7ab0daaea86938ac6d32db046059856cfbfc54007ad404d4ee7210ab432dc3

OneEyedSpaceFish avatar Jan 21 '22 23:01 OneEyedSpaceFish

This is a duplicate of #7978, which already has been fixed; you may want to double-check.

cmb69 avatar Jan 21 '22 23:01 cmb69

@cmb69 Thanks for the quick reply! It seems that the root issue has been fixed, just like you say, but are you aware if this fix made it to the latest docker image as well? Should we expect another build?

It seems that this issue is present in most recent image.

OneEyedSpaceFish avatar Jan 21 '22 23:01 OneEyedSpaceFish

@OneEyedSpaceFish Correct. The Docker release probably happened automatically. It likely won't be fixed unless you patch 8.1.2 manually (my patch test is here), roll back to 8.1.1, or wait for 8.1.3

devsibwarra avatar Jan 21 '22 23:01 devsibwarra

@cmb69 @devsibwarra Awesome! Thanks guys!

OneEyedSpaceFish avatar Jan 21 '22 23:01 OneEyedSpaceFish

Note that the Docker releases are not managed by php.net developers, so we don't have any influence on these. :)

cmb69 avatar Jan 21 '22 23:01 cmb69

Opps, I didn't know that tbh. In that case, I must apologize for raising an useless bug ticket then. :/

Perhaps I should check, and raise this up with them. I'm personally happy to keep using 8.1.1, but they might want to update their builds nevertheless.

OneEyedSpaceFish avatar Jan 21 '22 23:01 OneEyedSpaceFish