Bug 288888 - [NEW PORT] archivers/php-bzip3: BZip3 extension for PHP
Summary: [NEW PORT] archivers/php-bzip3: BZip3 extension for PHP
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Älven
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-15 18:56 UTC by Paavo-Einari Kaipila
Modified: 2025-10-30 23:56 UTC (History)
4 users (show)

See Also:
pkaipila: maintainer-feedback+
alven: maintainer-feedback? (db)
alven: maintainer-feedback? (yuri)


Attachments
0001-archivers-php-bzip3-new-port.patch (2.33 KB, patch)
2025-08-15 18:57 UTC, Paavo-Einari Kaipila
no flags Details | Diff
bzip3_test.php (624 bytes, application/x-php)
2025-08-15 19:31 UTC, Paavo-Einari Kaipila
no flags Details
add tests to Makefile (847 bytes, patch)
2025-08-19 12:02 UTC, gatekeeper
no flags Details | Diff
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch (2.43 KB, patch)
2025-08-21 05:05 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch (2.39 KB, patch)
2025-08-21 05:10 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch (2.37 KB, patch)
2025-10-09 11:54 UTC, Paavo-Einari Kaipila
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paavo-Einari Kaipila 2025-08-15 18:56:09 UTC
Thanks in advance
Comment 1 Paavo-Einari Kaipila 2025-08-15 18:57:35 UTC
Created attachment 262989 [details]
0001-archivers-php-bzip3-new-port.patch
Comment 2 Paavo-Einari Kaipila 2025-08-15 19:31:30 UTC
Created attachment 262990 [details]
bzip3_test.php
Comment 3 Paavo-Einari Kaipila 2025-08-19 07:13:59 UTC
Just realized there's thing in here to be fixed. I'll submit a revised version sometime in the evening.
Comment 4 gatekeeper 2025-08-19 10:53:04 UTC
Dear Paavo-Einari,

I just tested your submission, and it looks fine for me (both poudriere, portclippy, portfmt, and portlint all are happy :-)

So, I wonder what you found that want to improve...

One suggestion through - since you spent time to develop a test (which works fine!), how about adding the test to the port?

Best,
Tiago
Comment 5 Paavo-Einari Kaipila 2025-08-19 11:19:19 UTC
The issue is a copy/paste artefact and does not affect the extension itself, only the package metadata. cpe shouldn't be here.

The distribution tarball actually ships with tests of  it's own. I provided a simpler one for the committer's convenience if they want to test the new port and aren't familiar with phpt tests.

https://github.com/kjdev/php-ext-bzip3/tree/main/tests

Shipping own tests with a port isn't quite a standard practice.

- Pave
Comment 6 gatekeeper 2025-08-19 12:02:21 UTC
Created attachment 263073 [details]
add tests to Makefile

Dear Pave,

if the distribution has its own tests, even better :-)
I provide an update to your Makefile (see attached patch) to add the "make test" using the distributions' tests for your consideration of inclusion.

Best,
Tiago
Comment 7 gatekeeper 2025-08-19 12:06:28 UTC
And... BTW, here is the result :-)
Running selected tests.
PASS Bzip3\compress()/Bzip3\uncompress() [001.phpt] 
PASS Bzip3\compress(): block_size [002.phpt] 
PASS Bzip3\compress(): heredoc [003.phpt] 
PASS Bzip3\uncompress(): invalid data [004.phpt] 
PASS phpinfo() [info.phpt] 

Cheers.
Comment 8 Paavo-Einari Kaipila 2025-08-19 12:47:27 UTC
Well, yeah perhaps adding them should be a standard practice :) Just haven't thought about this very much, because my particular workflow of running tests is a bit different, because I use the same workflow for things that aren't even ports of any kind.

I'll take your patch and will add similar tests to few other ports of mine too.

Shall I refer you as gatekeeper or Tiago in the commit message?

- Pave
Comment 9 gatekeeper 2025-08-19 13:21:14 UTC
(In reply to Paavo-Einari Kaipila from comment #8)
Dear Pave,

both are fine; but i guess gatekeeper woul be better, as its my handle?
BTW - thats a refecence to Ghostbusters... :-)

Best Regards,
Tiago
Comment 10 Paavo-Einari Kaipila 2025-08-19 23:20:57 UTC
Not quite sure if that test depends should be lang/php or lang/php${PHP_VER}

Portlint doesn't like either one.

Can't find mentions of test being run on poudriere logs and can't find a way to tell it to run them.
Comment 11 gatekeeper 2025-08-20 02:18:51 UTC
(In reply to Paavo-Einari Kaipila from comment #10)

Ah, sorry, my bad.

I think you are right - it should be:
TEST_DEPENDS=	php:lang/php${PHP_VER}

As far as I remember, the "bulk" build does not run the tests, but poudriere has a testport option.
I am on the go now, but will check this ASAP and try to get back to you.
One port I commited (with the help of Nuno) is comms/py-streamdeck, and it has the test enabled...

Cheers,
Tiago
Comment 12 gatekeeper 2025-08-20 02:31:43 UTC
For me, „portlint -AC“ did not complain... strange...
Comment 13 Paavo-Einari Kaipila 2025-08-20 06:21:13 UTC
(In reply to gatekeeper from comment #11)

No need to hurry, my goal is to get this to the tree before Q4 cutoff :D

According to my interpretation of testport command's description, it tests the build process without saving the package. And my observation of it's behaviour also supports this interpretation.
Comment 14 gatekeeper 2025-08-21 03:00:04 UTC
(In reply to Paavo-Einari Kaipila from comment #13)

OK, so after looking a bit arround (porters handbook + source code of poudriere), I find out that poudriere does not run the tests automatically, even if they are defined. Also the testport seems to be a quality check, not a functional test.
From this, it seems to me that "make test" is supposed to be run manually by the maintainers and is not part of CI pipeline - maybe I am wrong here...

We might also be looking at an intended future feature (?), which can run the tests for the ports that define do-test in the Makefile, and report back to maintainers if the tests stop working after some time... that would be awesome to have - not only to ensure the quality but also that the port is doing what it should.

Anyhow, according to the porters handbook "If the original upstream project provides tests along with the software, it is a good idea to run them and check everything works as expected."

So... I think that including the patch is good, even if it does not automatically get run by poudriere; we can still run it manually ;-)

Best,
Tiago
Comment 15 Paavo-Einari Kaipila 2025-08-21 04:26:58 UTC
Yeah, that's what I concluded too.

I must leave it out then, because that is just absolutely incompatible with my particular setup and I'd have to run another another parallel setup building the same packages again only to run same tests I run with my current setup. That's quite a bit of wasted cpu cycles just because something is "a good idea".
Comment 16 Paavo-Einari Kaipila 2025-08-21 05:05:30 UTC
Created attachment 263100 [details]
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch
Comment 17 Paavo-Einari Kaipila 2025-08-21 05:10:11 UTC
Created attachment 263101 [details]
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch

picked up a wrong file for last one
Comment 18 Paavo-Einari Kaipila 2025-10-09 11:54:37 UTC
Created attachment 264436 [details]
0001-archivers-php-bzip3-new-port-bzip3-compression-exten.patch

A small improvement to Makefile (m4 here doesn't actually support specifying lib location and only relies on pkgconfig) and some rewording of pkg-descr.
Comment 19 Yuri Victorovich freebsd_committer freebsd_triage 2025-10-30 07:46:24 UTC
Approved.

Thanks,
Yuri
Comment 20 commit-hook freebsd_committer freebsd_triage 2025-10-30 23:55:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a467fdaf329f9eea6c0b196065496a2e09dc97dc

commit a467fdaf329f9eea6c0b196065496a2e09dc97dc
Author:     Paavo-Einari Kaipila <pave@freebsd.org>
AuthorDate: 2025-08-21 05:07:30 +0000
Commit:     Älven <alven@FreeBSD.org>
CommitDate: 2025-10-30 23:55:08 +0000

    archivers/php-bzip3: [NEW PORT] bzip3 compression extension

    PR:             288888
    Tested by:      gatekeeper <tiago.gasiba@gmail.com>
    Approved by:    yuri@ (Mentor)

 archivers/Makefile                  |  1 +
 archivers/php-bzip3/Makefile (new)  | 23 +++++++++++++++++++++++
 archivers/php-bzip3/distinfo (new)  |  3 +++
 archivers/php-bzip3/pkg-descr (new) |  3 +++
 4 files changed, 30 insertions(+)
Comment 21 Älven freebsd_committer freebsd_triage 2025-10-30 23:56:43 UTC
Thanks for all your work on this. Committed!