Re: [PECL-DEV] Re: Using arginfo generating stubs in PECL extensions

2020-12-11 Thread Remi Collet

Le 11/12/2020 à 19:16, Calvin Buckley a écrit :


Interestingly, it *does* seem to keep the legacy arginfo header. Going
back to question #2/#4 (since the build system hasn't changed, just
what gets made by phpize et al), running make with "-d", it appears GNU
make deletes it because it's an "intermediate file". Ugh, I wonder if
this is a bug in the PHP makefile infra. It'd explain why the other
arginfo header stays. That is:

[...]
Successfully remade target file 'all'.
Removing intermediate files...
rm /home/calvin/src/pecl-database-ibm_db2/ibm_db2_arginfo.h


I also encounter this once... on one project... when the generated
files were not used yet (dev phase). This stop to happen when files
are really used (don't really understand why).

This usually not happen, and is not expected.


Remi

--
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php



[PECL-DEV] Re: Using arginfo generating stubs in PECL extensions

2020-12-11 Thread Calvin Buckley
On Fri, 2020-12-11 at 19:02 +0100, Christoph M. Becker wrote:

> > 3. Are the headers that get generated have any guarantees on
> > usability
> > in PHP 7.x?
> 
> They are not usable on PHP 7 due to some missing macros.  It is
> possible
> to use define the macros for older PHP versions, but you may be
> better
> off (at least for BC reasons) to add @generate-legacy-arginfo to the
> stub file; this should generate a _legacy_arginfo.h file for
> inclusion
> when building for PHP 7.

Interestingly, it *does* seem to keep the legacy arginfo header. Going
back to question #2/#4 (since the build system hasn't changed, just
what gets made by phpize et al), running make with "-d", it appears GNU
make deletes it because it's an "intermediate file". Ugh, I wonder if
this is a bug in the PHP makefile infra. It'd explain why the other
arginfo header stays. That is:

[...]
Successfully remade target file 'all'.
Removing intermediate files...
rm /home/calvin/src/pecl-database-ibm_db2/ibm_db2_arginfo.h

> > 5. Actually downloading PHP-Parser during build is really
> > unexpected. I
> > assume if I have it on my include path it won't do that, but for
> > isolated builds it could be really confusing. I assume if I ship
> > arginfo header in a release tarball, it won't do that?
> 
> Indeed.  If _arginfo.h is available and up to date (there is a SHA1
> hash
> in the file), rebuilding should not happen.

OK. The PHP-Parser is still unexpected, but I'm OK with it if it
doesn't affect packagers and the expectation is they'd patch both files
in the package if they do need to change that.

-- 
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php



[PECL-DEV] Re: Using arginfo generating stubs in PECL extensions

2020-12-11 Thread Christoph M. Becker
On 11.12.2020 at 16:39, Calvin Buckley wrote:

> Might be better in php-internals (haven't subbed yet), but:
>
> I noticed one of the new facilities in PHP 8 was generating arginfo
> from a PHP stub. This is pretty useful for reasons elaborated
> elsewhere, but I'm wondering how this should be used for PECL
> extensions. I noticed what PHP itself does is keep the generated
> arginfo header. My questions are:
>
> 1. Should this be used at all PECL extensions yet? That is, is this
> some PHP facility that isn't ready for external usage yet?

It's fine to use it right away.

> 2. I noticed the build system deletes the stub after it's built the
> object files. Since I might want to keep the header (for PHP 7.x
> users), this is a bit annoying, especially as PHP itself keeps them.

I don't think that this is supposed to happen.  Is there some extension
specific clean-up involved?

> 3. Are the headers that get generated have any guarantees on usability
> in PHP 7.x?

They are not usable on PHP 7 due to some missing macros.  It is possible
to use define the macros for older PHP versions, but you may be better
off (at least for BC reasons) to add @generate-legacy-arginfo to the
stub file; this should generate a _legacy_arginfo.h file for inclusion
when building for PHP 7.

> 4. Part of #2, because it deletes the headers, it makes rebuilding if
> you generate a change in source *very* annoying, because the header
> won't be found.

See above (question 2).

> 5. Actually downloading PHP-Parser during build is really unexpected. I
> assume if I have it on my include path it won't do that, but for
> isolated builds it could be really confusing. I assume if I ship
> arginfo header in a release tarball, it won't do that?

Indeed.  If _arginfo.h is available and up to date (there is a SHA1 hash
in the file), rebuilding should not happen.

Christoph

--
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php



[PECL-DEV] Using arginfo generating stubs in PECL extensions

2020-12-11 Thread Calvin Buckley
Might be better in php-internals (haven't subbed yet), but:

I noticed one of the new facilities in PHP 8 was generating arginfo
from a PHP stub. This is pretty useful for reasons elaborated
elsewhere, but I'm wondering how this should be used for PECL
extensions. I noticed what PHP itself does is keep the generated
arginfo header. My questions are:

1. Should this be used at all PECL extensions yet? That is, is this
some PHP facility that isn't ready for external usage yet?
2. I noticed the build system deletes the stub after it's built the
object files. Since I might want to keep the header (for PHP 7.x
users), this is a bit annoying, especially as PHP itself keeps them.
3. Are the headers that get generated have any guarantees on usability
in PHP 7.x?
4. Part of #2, because it deletes the headers, it makes rebuilding if
you generate a change in source *very* annoying, because the header
won't be found.
5. Actually downloading PHP-Parser during build is really unexpected. I
assume if I have it on my include path it won't do that, but for
isolated builds it could be really confusing. I assume if I ship
arginfo header in a release tarball, it won't do that?

This facility isn't really documented yet, so I'm left wondering.

-- 
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php